1 Quiz 2. 2 One instructor cannot be at two or more class rooms at the same time. One class room cannot be shared by two or more instructors at the same.

Slides:



Advertisements
Similar presentations
ER Model For a college DB
Advertisements

1 Assignment 4 Map entities with relationships to relational schemas. Use DBDL to describe the table schemas.
Assignment Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the.
Entity, Attribute, and Relationship DATA ENTITY TYPE: a noun, i.e. roles, events, locations, people, tangible things about which we wish to maintain.
Assignment6-1 Assignment6-2 Due Wednesday, March 13 1.
Mapping an ERD to a Relational Database To map an ERD to a relational database, five rules are defined to govern how tables are constructed. 1)Rule for.
Relational Model Stores data as tables –Each column contains values about the same attribute –Each column has a distinct name –Each row contains values.
CS 3630 Database Design and Implementation. First Normal Form (1NF) No multi-value attributes Done when mapping E-R model to relational schema DBDL 2.
1 CS 3630 Database Design and Implementation. 2 Final Exam 7:00 – 8:52 PM, Thursday, May 16 Section 1: Ull 009 Section 2: Ull Points –50 points.
Entity PrimaryKey Attribute relationship Cardinality: zero to many Cardinality: one and only one Cardinality: one to many Explanation Entity Relationship.
Amity School of Engineering & Technology E-R Diagram for a University Enterprise.
DATA MODELING AND DATABASE DESIGN
1 Test1 N = {n: n is an integer and n  0} X = {x: x = n + 5, where n  N} Y = {y: y = 7 * n - 1, where n  N} List the three smallest elements of each.
R ELATIONAL D ATA M ODEL Joe Meehean 1. R ELATIONAL D ATA M ODEL Data stored as a set of relations really just tables Tables related to one another through.
Project – Phase II Derive Database Schema from E-R Model DBDL.
1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.
CS 3630 Database Design and Implementation. 2 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
Creating Tables and Inserting Records -- Not easy to edit! -- check constraints! Create table test1 ( C1 char(5) primary key, C2 Varchar2(15) not null.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
SE305 Database System Technology 23/10/2014 Quiz-2.
COMP231 Tutorial 1 ER Model and ER to Relational Schema.
Weak Entity Sets A weak entity is an entity that cannot exist in a database unless another type of entity also exists in that database. Weak entity meets.
CS 3630 Database Design and Implementation. Unnormalized Form (UNF) student courses John CS363 CS334 CS323 Multi-Value attribute Common in reports 2.
Database Design – Lecture 6 Moving to a Logical Model.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
Second Normal Form (2NF) A relation R is in 1NF, and every non-primary-key attribute is fully functionally dependent on the primary key Then R is in 2NF.
Quiz Where to Store Attributes of Relationship Staff (1) Interviews (0..*) Client Attributes: date, time, comment Staff (StaffNo, …) PK: StaffNo.
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
CS 3630 Database Design and Implementation. Null Value The value of an attribute could be NULL NOT known at the moment or NOT Applicable Example Cell.
Database Design 4: Deriving Tables From Data Models CS 320.
Database Design. Database Design Process Data Model Requirements Application 1 Database Requirements Application 2 Requirements Application 4 Requirements.
Howard Paul. Sequential Access Index Files and Data File Random Access.
Chapter 2: Entity-Relationship Model. 3.2 Chapter 2: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Assignment 5–2 For each new relation, Use DBDL to specify the relation scheme Give the functional dependencies Give the corresponding relation instance.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
Hoi Le. Why database? Spreadsheet is not good to: Store very large information Efficiently update data Use in multi-user mode Hoi Le2.
Problems 7/27/02. 3, p5 Student Course Student-Course Stu-ID Course-ID Grade.
CS 3630 Database Design and Implementation
5 Day Forecast Mon Tues Wed Thu Fri.
CS 3630 Database Design and Implementation
COP5725 Database Management ER DIAGRAM AND RELATIONAL DATA MODEL
CS 3630 Database Design and Implementation
Tables and Their Characteristics
CS 3630 Database Design and Implementation
Chapter 7 Entity-Relationship Model
Outline of the ER Model By S.Saha
GANTT CHARTS Example Example Example Example text Tasks Example 1
Chapter 5 STUDENT-COURSE
Assignment 4 Map entities with relationships to relational schemas.
CS 3630 Database Design and Implementation
Assignment 5–2 For each table, Give a meaningful name
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
Foreign key (FK) is defined as follows:
MON TUE WED THU
CS 3630 Database Design and Implementation
Example A university registrar’s office maintains data about the following entities: (a) courses, including number, title, credits, syllabus, and prerequisites;
Chapter 2 Modeling Data in the Organization
From data needs to ER Model to relational DB Schema
2008 Calendar.
Sun Mon Tue Wed Thu Fri Sat
DBMS ER-Relational Mapping
Mapping an ERD to a Relational Database
Sun Mon Tue Wed Thu Fri Sat
1/○~1/○ weekly schedule MON TUE WED THU FRI SAT SUN MEMO
2016 | 10 OCT SUN MON TUE WED THU FRI SAT
Sun Mon Tue Wed Thu Fri Sat
Mapping an ERD to a Relational Database
2008 Calendar.
Presentation transcript:

1 Quiz 2

2 One instructor cannot be at two or more class rooms at the same time. One class room cannot be shared by two or more instructors at the same time. Section Number (SecNo) includes lecture, lab, discussion, and all other possible sections. InstructorNo and CourseID are unique for instructors and courses, respectively. HallID and RoomNum together uniquely identify class rooms. Classes are scheduled only for weekdays (Mon, Tue, Wed, Thu, Fri). Schedule (HallID, RoomNum, InstructorID, InstructorName, WeekDay, TimeStart, TimeEnd, CourseID, SecNo) Ullrich002YangQQiWed10:0010:52CS Ullrich002YangQQiWed11:0011:52CS Ullrich111YangQQiTue09:3010:48CS Ullrich111YangQQiThu09:3010:48CS Ullrich002LandgrafLisaWed09:0009:52CS

3 Which of the following are functional dependencies on the table? InstructorName  InstructorID YesNo InstructorID  InstructorName YesNo HallID, RoomNum, WeekDay  InstructorID YesNo HallID, RoomNum, WeekDay, TimeStart  All YesNo InstructorID, HallID, RoomNum  All YesNo

4 Derive table schemas(s) for the following entity. Use DBDL to specify the table schema(s). EntityOne A1 A2 A3: multi-value A4: composite (A41, A42) A5 Primary Key: (A1, A2) A4: composite (A41, A42)Use A41 and A42 to replace A4 A3: multi-valueNeed a new table A3 and (A1, A2)

5 EntityOne A1 A2 A3: multi-value A4: composite (A41, A42) A5 Primary Key: (A1, A2) EntityOne (A1, A2, A41, A42, A5) PK: A1, A2 AK: None FK: None EntityM (ID, A1, A2, A3) PK: ID (new attribute) AK: None FK: (A1, A2) references EntityOne

6 Derive table schemas for the following entities with a one-to-many relationship. Use DBDL to specify the table schemas. EntityTwo EntityThree B1 C1 B2: composite (B21, B22) C2 PK: B1 PK: C1 EntityTwo (1..*) IsRelatedTo EntityThree (1) Attributes: D1, D2 EntityTwo (B1, B21, B22, C1, D1, D2)EntiyThree (C1, C2)

7 EntityTwo EntityThree B1 C1 B2: composite (B21, B22) C2 PK: B1 PK: C1 EntityTwo (1..*) IsRelatedTo EntityThree (1) Attributes: D1, D2 EntityTwo (B1, B21, B22, C1, D1, D2) PK: B1 AK: None FK: C1 references EntiyThree EntiyThree (C1, C2) PK: C1 AK: None FK: None

8 Derive table schemas for the following entities with a many-to-many relationship. Use DBDL to specify the table schemas. EntityFour EntityFive E1F1 E2F2: composite (F21, F22) E3: composite (E31, E32)F3 PK: E1 PK: F1 EntityFour (1..*) IsRelatedTo EntityFive (0..*) Attributes: R1, R2 Many-to-Many: New table

9 EntityFour EntityFive E1F1 E2F2: composite (F21, F22) E3: composite (E31, E32)F3 PK: E1 PK: F1 EntityFour (1..*) IsRelatedTo EntityFive (0..*) Attributes: R1, R2 EntityFour (E1, E2, E31, E32) PK: E1 AK: None FK: None EntityFive (F1, F21, F22, F3) PK: F1 AK: None FK: None EntityR (NewAtt, E1, F1, R1, R2) PK: NewAtt (new attribute) AK: None FK: E1 references EntityFour F1 references EntityFive

10 EntitySix EntitySeven G1 H1 G2: composite (G21, G22) H2 G3: multi-value H3: composite (H31, H32, H33) composite (G31, G32, G33) H4: multi-value PK: G2 PK: H1 EntitySix (0..*) IsRelatedTo EntitySeven (1) Attribute: K1, K2 G3: multi-value: new table H4: multi-value: new table One-to-Many: No new table Copy H1 to EntitySix with K1 and K2

11 EntitySix EntitySeven G1 H1 G2: composite (G21, G22) H2 G3: multi-value H3: composite (H31, H32, H33) composite (G31, G32, G33) H4: multi-value PK: G2 PK: H1 EntitySix (0..*) IsRelatedTo EntitySeven (1) Attribute: K1, K2 EntitySix (G1, G21, G22, H1, K1, K2) PK: G21, G22 AK: None FK: H1 references EntitySeven EntitySeven (H1, H2, H31, H32, H33) PK: H1 AK: None FK: None EntitySevenMV (NewAtt, H1, H4) PK: NewAtt (new attribute) AK: None FK: H1 references EntitySeven EntitySixMV (ID, G21, G22, G31, G32, G33) PK: ID AK: None FK: (G21, G22) references EntitySix