Assignements.

Slides:



Advertisements
Similar presentations
ER Modeling Case Studies
Advertisements

Exercise 1 Consider the ER diagram below. Assume that an employee may work in up to two departments or may not be assigned to any department. Assume that.
COP4540 Database Management System Midterm Review
Logical DB Design: ER to Relational Entity sets to tables. Employees ssn name lot CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER, PRIMARY.
CSC343: Intro. to Databases1 Tutorial for CSC343 Introduction to Databases Fall 2006 Week 2.
ER Modeling Case Studies
COP-5725 Practice Exercises
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
COP5725 – Principles of Database Management Systems
SPRING 2004CENG 3521 The Relational Model Chapter 3.
Entity-Relationship Model and Diagrams (continued)
Database Systems Relational Model Concepts Toqir Ahmad Rana Database Management Systems 1 Lecture 17.
Things are bad. Children no longer obey their parents and everyone is writing a book. -- Marcus Tillius Cicero.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 The Relational Model Chapter 3. 2 Why Study the Relational Model?  Most widely used model  Vendors: IBM, Informix, Microsoft, Oracle, Sybase  Recent.
CS411 Database Systems Kazuhiro Minami 02: The Entity-Relationship Model.
1 The Relational Model Chapter 3. 2 Why Study the Relational Model?  Most widely used model.  Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc.
1 The Relational Model Chapter 3. 2 Why Study the Relational Model?  Most widely used model.  Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc.
Assignements. CSC343: Intro. to Databases2 Exercise 1 Superkeys: Candidate keys: Primary key:
1.1 CAS CS 460/660 Relational Model. 1.2 Review E/R Model: Entities, relationships, attributes Cardinalities: 1:1, 1:n, m:1, m:n Keys: superkeys, candidate.
The Relational Model1 ER-to-Relational Mapping and Views.
ICS 321 Fall 2009 The Relational Model (ii) Asst. Prof. Lipyeow Lim Information and Computer Science Department University of Hawaii at Manoa 9/10/20091Lipyeow.
Principles of Database Systems Yunsheng Liu. YSLiu-DBS-Exercise 2 Exercise 1 1.Please give at least four main differences between a DBMS and a file system.
CMPT 258 Database Systems The Relationship Model PartII (Chapter 3)
COMP3030 Database Management System Final Review
COP-5725 Practice Exercises
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Example COMPANY Database
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
Data Base Design Steps 1.Define Entity Classes (Relations/Tables) and Keys. 2.Define Relationships between Entity Classes. Normalization Steps Eliminate.
Chapter 3 The Relational Data Model and Relational Database Constraints Copyright © 2004 Pearson Education, Inc.
ER Diagrams and Relational Model CS 174a (Winter 2015)
Database Development Lifecycle
COP Introduction to Database Structures
SQL: Schema Definition and Constraints Chapter 6 week 6
The Relational Data Model and Relational Database Constraints
E-R Diagram (Cont.) Draw ER Diagram for the following scenario:
Entity-Relationship Model
Tables and Their Characteristics
Dept. of Computer & Information Sciences
ER MODEL Lecture 3.
Constraints AND Examples
ER Modeling Case Studies
Translation of ER-diagram into Relational Schema
Entity-Relationship Model and Diagrams (continued)
Relational Integrity Constraints
From ER to Relational Model
Database Systems (資料庫系統)
Chapter 3 The Relational Model.
The Relational Model Chapter 3
Question Which of the following plays an important role in representing information about the real world in a database? Explain briefly 1)DDL.
Question 01 A company database needs to store information about employees (identified by NIC, with salary and phone as attributes), departments (identified.
Translation of ER-diagram into Relational Schema
These are slides from Dr. Phil Cannata’s Class
Functional Dependencies
Database Modeling using Entity Relationship Model (E-R Model)
ER Modeling Case Studies
Database Systems (資料庫系統)
ER Modeling Case Studies
Day 2 - Basic Database Backbone
INSTRUCTOR: MRS T.G. ZHOU
CS4433 Database Systems Relational Model.
Database Dr. Roueida Mohammed.
Conceptual modeling of databases
Constraints AND Examples
CS4222 Principles of Database System
CS 405G: Introduction to Database Systems
Chapter 3 The Relational Model
Presentation transcript:

Assignements

CSC343: Intro. to Databases Exercise 1 Superkeys: Candidate keys: Primary key: CSC343: Intro. to Databases

CSC343: Intro. to Databases Exercise2 What is a foreign key constraint? Why are such constraints important? What is referential integrity? CSC343: Intro. to Databases

CSC343: Intro. to Databases Exercise 3 Answer each of the following questions briefly. The questions are based on the following relational schema: Emp (eid: integer, ename: string, age: integer, salary: real) Works (eid: integer, did: integer, pcttime: integer) Dept (did: integer, dname: string, budget: real, managerid: integer) CSC343: Intro. to Databases

CSC343: Intro. to Databases Exercise 3 Give an example of a foreign key constraint that involves the Dept relation. What are the options for enforcing this constraint when a user attempts to delete a Dept tuple? CSC343: Intro. to Databases

Consider the following ER diagram Consider the following ER diagram!!. List all superkeys , candidate keys, and primary keys for entities sets Students and Courses, and for relationship set Enrolled.

Assignement 2 Draw UML class diagrams for a car rental agency database , keeping track of current rental location of each car, its current condition and history of repairs, and customer information for a local office, expected return date, return location, car status (ready, being-repaired, currently rented, being-cleaned). Select attributes from your intuition about the situation. Draw one diagram showing the relationships of the classes without the attributes listed. Translate the diagram into relations

Hotel reservations Each hotel is designed by its name , address , city, price for each kind of room , and the number of rooms for each kind. Customers are identified by name , surname, address and tel number. They can book one or more rooms for one or more consecutive days. For each reservation, it is necessary to store the name of the customer, the date of the resrvation as well as the arrival date and departure date.

Hotel reservations We also want to store info about the actual stay of the hosts: the actual arrival and departure dates (that might be different from the ones specified during the reservation), the advance paid at the booking time, the balance ( amount of money still to be paid) and the status of the payment (paid/ to be paid). Draw UML diagram and translate it into relations?

Translate the following diagram into relations Translate the following diagram into relations. Make the translation of the hierarchical structure between the Part entity sets in the three variants.

Web store The UML diagram below describes a web store, which sells DVD’s and CD’s (“items”) to customers. Items may belong to several categories. Customers may write reviews of the items that they have purchased. Translate the model into a relational model.

Translate the following model into a relational model