Week 2.1.pptx - CZ2007 Introduction to Database Systems Last Lecture Constraints Key Referential Integrity Degree Subclasses Weak Entity Sets Key name

Week 2.1.pptx - CZ2007 Introduction to Database Systems...

This preview shows page 1 - 13 out of 47 pages.

CZ2007 Introduction to Database Systems
Image of page 1

Subscribe to view the full document.

Last Lecture Constraints Key Referential Integrity Degree Subclasses Weak Entity Sets
Image of page 2
Key One or more attributes that are underlined Meaning: They uniquely represent each entity in the entity set Example: The names uniquely represent the persons i.e., each person must have a unique name Persons addr name
Image of page 3

Subscribe to view the full document.

Referential Integrity: Exercise A city can be the capital of only one country A country must have a capital Countries Cities Capital of
Image of page 4
Degree Constraint Each company can make at most 1000 product Note Not required in the quiz/exam Degree constraints are not easy to enforce in a DBMS Key and referential integrity constraints can be easily enforced Products Companies Make ≤ 1000
Image of page 5

Subscribe to view the full document.

Subclass PhDs are a special type of Students Subclass = Special type The connection between a subclass and its superclass is captured by the isa relationship , which is represented using a triangle Key of a subclass = key of its superclass Example: Key of Phds = Students.ID Students is referred to as the superclass of PhDs PhDs advisor Students ID name isa
Image of page 6
Weak Entity Sets Problem: there are cities with identical names Observation: cities in the same state would have different names Solution: make Cities a weak entity set associated with the entity set States The relationship In is called the supporting relationship of Cities Weak entity set = Double-lined rectangle Supporting relationship = Double-lined diamond The key of Cities = (State.name, Cities.name) Cities name population States name GDP In
Image of page 7

Subscribe to view the full document.

Subclass vs. Weak Entity Sets PhDs are a special type of Students Cities are NOT a special type of States PhDs advisor Students ID name isa Cities name population States name GDP In
Image of page 8
Road Map Elements of ER Diagrams Entities Sets Relationships Attributes Weak Entities Sets Subclasses How do we design an ER Diagram for an application?
Image of page 9

Subscribe to view the full document.

From Applications to ER Diagrams Identify the objects involved in your application Model each type of objects as an entity set Identify the attributes of each entity set Identify the relationships among the entity sets Refine your design Example: A database for NTU Objects: Students, Faculties, Schools, Courses… Entity sets: Students, Faculties, Schools, Courses… Relationships: course-enrollment, course-lecturer…
Image of page 10
Design Principle 1: Be Faithful Be faithful to the specifications of the application Capture the requirements as much as possible
Image of page 11

Subscribe to view the full document.

Design Principle 2: Avoid Redundancy Avoid repetition of information Example Problems that can be caused by redundancy Waste of space Possible inconsistency Faculties ID name Students ID name mentor Mentor
Image of page 12
Image of page 13
  • Spring '16
  • Entity-relationship model, ER Diagrams

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes