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

Slides:



Advertisements
Similar presentations
ER Model For a college DB
Advertisements

ER Modeling Case Studies
More Diagramming & Practice with Relationship Modeling
COP4540 Database Management System Midterm Review
ER to Relational Mapping. Logical DB Design: ER to Relational Entity sets to tables. CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER,
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.
University Car Rental Project Vision Consulting Donna, Lap, Lisa & Tom
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.
The Entity-Relationship Model
(Uses slides from Fernando Farfan and Eduardo J. Ruiz
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
COP5725 – Principles of Database Management Systems
1 Translation of ER-diagram into Relational Schema Prof. Sin-Min Lee Department of Computer Science.
SPRING 2004CENG 3521 The Relational Model Chapter 3.
--The Entity Relationship Model(1)--1 The Entity Relationship Model.
Entity-Relationship Model and Diagrams (continued)
1 Relational Model. 2 Relational Database: Definitions  Relational database: a set of relations  Relation: made up of 2 parts: – Instance : a table,
Announcements Reading for Wednesday Homework 2 - Due 9/22
Database Systems Relational Model Concepts Toqir Ahmad Rana Database Management Systems 1 Lecture 17.
CONSTRAINTS AND UPDATES CHAPTER 3 (6/E) CHAPTER 5 (5/E) 1.
Things are bad. Children no longer obey their parents and everyone is writing a book. -- Marcus Tillius Cicero.
ER Modeling Case Studies
CS 380 Introduction to Database Systems (Chapter 5: The Relational Data Model and Relational Database Constraints)
CSC271 Database Systems Lecture # 6. Summary: Previous Lecture  Relational model terminology  Mathematical relations  Database relations  Properties.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3 Modified by Donghui Zhang.
1 The Relational Model Chapter 3. 2 Why Study the Relational Model?  Most widely used model  Vendors: IBM, Informix, Microsoft, Oracle, Sybase  Recent.
 Relational database: a set of relations.  Relation: made up of 2 parts: › Instance : a table, with rows and columns. #rows = cardinality, #fields =
CS411 Database Systems Kazuhiro Minami 02: The Entity-Relationship Model.
Introduction to Database Systems
1 Translation of ER-diagram into Relational Schema Prof. Sin-Min Lee Department of Computer Science.
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.
1 The Relational Model. 2 Why Study the Relational Model? v Most widely used model. – Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. v “Legacy.
FALL 2004CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
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.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
CMPT 258 Database Systems The Relationship Model PartII (Chapter 3)
Lecture 3 Book Chapter 3 (part 2 ) From ER to Relational.
COMP3030 Database Management System Final Review
Relational Data Model DeSiaMore Powered by DeSiaMore.
ICS 421 Spring 2010 Relational Model & Normal Forms Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 1/19/20101Lipyeow.
COP-5725 Practice Exercises
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Mapping E/R to RM, R. Ramakrishnan and J. Gehrke with Dr. Eick’s additions 1 Mapping E/R Diagrams to Relational Database Schemas Second Half of Chapter.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 CS122A: Introduction to Data Management Lecture #5 (E-R  Relational, Cont.) Instructor: Chen Li.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
Database Management Systems 1 Raghu Ramakrishnan The Relational Model Chapter 3 Instructor: Xin Zhang.
1 The Relational Model Chapter 3. 2 Why Study the Relational Model?  Most widely used model.  Multi-billion dollar industry, $15+ bill in  Vendors:
CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
Database Development Lifecycle
Assignements.
ER Modeling Case Studies
Entity-Relationship Model and Diagrams (continued)
Relational Integrity Constraints
Database Modeling using Entity Relationship Model (E-R Model)
ER Modeling Case Studies
ER Modeling Case Studies
INSTRUCTOR: MRS T.G. ZHOU
Chapter 3 The Relational Model
Presentation transcript:

Assignements

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

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

CSC343: Intro. to Databases4 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 Databases5 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?

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. 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