COMP231 Tutorial 1 ER Model and ER to Relational Schema.

Slides:



Advertisements
Similar presentations
ER Model For a college DB
Advertisements

Temple University – CIS Dept. CIS616– Principles of Database Systems
Week 5 Relational Database Design by ER- -to-Relational Mapping.
Weak Entity Sets An entity set that does not have a primary key is referred to as a weak entity set. The existence of a weak entity set depends on the.
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
Systems Development Life Cycle
Text-Book Chapters (7 and 8) Entity-Relationship Model
E/R Exercises – Part I April 16, 2017.
Databases Revision.
Modeling Data The Entity Relationship Model (ER) For Database Design.
Sept ER-to-Relational Mapping Principles ER-to-Relational Mapping And examples.
Carnegie Mellon Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos E-R diagrams.
Entity PrimaryKey Attribute relationship Cardinality: zero to many Cardinality: one and only one Cardinality: one to many Explanation Entity Relationship.
The (min,max) notation (1,1) (0,1) (1,N) (1,1). SUMMARY OF ER-DIAGRAM NOTATION FOR ER SCHEMAS Meaning ENTITY TYPE WEAK ENTITY TYPE RELATIONSHIP TYPE IDENTIFYING.
1 Data Modelling Which data to include in the database.
Amity School of Engineering & Technology E-R Diagram for a University Enterprise.
COURSE REGISTRATION SYSTEM Case study IST2101. Case Study: Course Registration (1) IST2102 You are helping Penn State create a course registration system.
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 7th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
ICOM 5016 – Introduction to Database Systems Lecture 4 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Instructor :Huda Al-Omair
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
CSET 3300 Databases & ER Data Models. Databases A database is a collection of data (information). A DataBase Management System (DBMS) is a software system.
©Silberschatz, Korth and Sudarshan1Database System Concepts - 6 th Edition E-R Diagram for a University Enterprise.
ER Data Models Ctd. CSET 3300.
Chapter 7 Database Design and The E–R Model. 2 Goals n Facilitate DB design and represent the overall logical structure of the DB. n Definition Entities.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
The Hong Kong University of Science and Technology COMP3311 Spring 2013 Tutorial 1 ER Diagrams.
LECTURE 1: Entity Relationship MODEL. Think before doing it! Like most of the software projects, you need to think before you do something. Before developing.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
SE305 Database System Technology 23/10/2014 Quiz-2.
Chapter 3 Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
ICOM 5016 – Introduction to Database Systems Lecture 9 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
E-R to Relational - Basic
DATABASE MANAGEMENT SYSTEM Entity-Relationship Model.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
Databases Illuminated Chapter 3 The Entity Relationship Model.
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.
ICOM 5016 – Introduction to Database Systems Lecture 5 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Computing & Information Sciences Kansas State University Friday, 26 Sep 2008CIS 560: Database System Concepts Lecture 13 of 42 Friday, 26 September 2008.
advanced data modeling
IT2005 System Analysis & Design
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 2 © Akhilesh Bajaj, 2000, 2002, 2003, 2004,
CST203-2 Database Management Systems Lecture 4. Student entity NIDFNameLNameRegNoExamIdBirthdate.
CS157A Lecture 4 ER Model 2 Prof. Sin-Min Lee Department of Computer Science San Jose State University.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
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.
LECTURE 1: Entity Relationship MODEL. Think before doing it! Like most of the software projects, you need to think before you do something. Before developing.
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.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
Database System Concepts, 7 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Module 4: Overview of.
Contents Design Process Modeling Constraints E-R Diagram Design Issues
Entity-Relationship Model
Entity-Relationship Model
Chapter 7 Entity-Relationship Model
Outline of the ER Model By S.Saha
Relational Schemas Classroom (building, room-number, capacity) Department (dept-name, building, budget) Course (course-id, title, dept-name, credits) Instructor.
Order Database – ER Diagram
Entity Relationship Model
Example A university registrar’s office maintains data about the following entities: (a) courses, including number, title, credits, syllabus, and prerequisites;
CS4222 Principles of Database System
Chapter 7: Entity-Relationship Model
ER Modeling Case Studies
Chapter 7: Entity-Relationship Model
ER MODELING Instructor: SAMIA ARSHAD
Presentation transcript:

COMP231 Tutorial 1 ER Model and ER to Relational Schema

E-R Diagram Rectangles – entity sets Ellipses – attributes Diamonds – relationship sets Double ellipses – multivalued attributes Dashed ellipses – derived attributes Double lines – total participation Double rectangles – weak entity sets Double diamonds – identifying relationship sets 2

Exercise 1.1 Construct E-R Diagram A university registrar’s office maintains data about the following entities: courses, including number, title, credits, syllabus, and prerequisites; course offerings, including course number, year, semester, section number, instructor(s), timings, and classroom; students, including student-id, name, and program; instructors, including identification number, name, department, and title. Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled must be appropriately modeled. Construct an E-R diagram for the registrar’s office.

Entities course-offering instructor student course

Course “courses including number, title, credits, syllabus, and prerequisites” Attribute? Relationship? courseno credits prerequisite requires course maincourse syllabus title

Course Offering “course offerings, including course number, year, semester, section number, instructor(s), timings, and classroom” semester time courseno course- offering is_offered room course secno year

Weak Entity A weak entity can only be identified uniquely by combining the primary key of another (owner) entity and the partial key of itself. Owner entity set and weak entity set must participate in one-to-many relationship (one owner entity, many weak entities). Weak entity set must have total participation in this identifying relationship set. 4

Student, Instructor “students, including student-id, name, and program” “instructors, including identification number, name, department, and title” sid name iid name student instructor program dept title

Enrollment “Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled must be appropriately modeled.” course-offering enrolls student grade

Anymore?? Instructor teaches course….. course-offering instructor

E-R Diagram for a University

Exercise 1.2 Covert E-R Diagram into Tables

Entities (Not Weak)

Entities (Not Weak) course (courseno, title, syllabus, credits) student (sid, name, program) instructor (iid, name, dept, title)

Weak Entities

Weak Entities course-offering (courseno, secno, year, semester, time, room)

Relationships (Not defining weak entities)

Relationships (Not defining weak entities) enrolls (sid, courseno, secno, semester, year, grade) teaches (courseno, secno, semester, year, iid) requires (maincourse, prerequisite)

Relationships with Weak Entities

Relationships with Weak Entities There is no extra table for the relationship between a weak entity and its strong entity. The relationship is already present in the schema for the weak entity. course-offering (courseno, secno, year, semester, time, room)

Relational Schemas for a University course (courseno, title, syllabus, credits) student (sid, name, program) instructor (iid, name, dept, title) course-offering (courseno, secno, year, semester, time, room) enrolls (sid, courseno, secno, semester, year, grade) teaches (courseno, secno, semester, year, iid) requires (maincourse, prerequisite)

Submitted for – www.mycollegebag.in