Download presentation
Presentation is loading. Please wait.
Published byEvan Miles Modified over 9 years ago
1
Ashima Wadhwa
2
database A database can be modeled as: ◦ a collection of entities, ◦ relationship among entities. entity An entity is an object that exists and is distinguishable from other objects. Example: specific person, company, event, plant attributes Entities are described using attributes Example: people have names and addresses entity set An entity set is a set of entities of the same type that share the same properties. Example: set of all persons, companies, trees, holidays
3
customer-id customer- customer- customer- loan- amount name street city number
4
An entity is represented by a set of attributes, that is descriptive properties possessed by all members of an entity set. Example: customer = (customer-id, customer-name, customer-street, customer-city) loan = (loan-number, amount) Domain Domain – the set of permitted values for each attribute Keys: Minimal set of attributes whose values uniquely identify an entity in the set ◦ Candidate Keys: all sets of attributes that can potentially be a key. ◦ Primary Key: One of the candidate keys is chosen to be a “primary” key.
5
Simple - atomic, non-divisible – this is what we use Derived – value not stored, but derived from other stored attributes - Age from birthdate Null – No value ◦ Not applicable ◦ Missing - exists ◦ Not known - may or may not exist Key attribute - Value of this attribute uniquely identifies the entity - possibly composite – student id number, social security number, apartment number with building number
6
Entity Type Faculty Attribute SSN State City Street Zip
7
Cardinality ratio - specifies number of relationship instances that an entity may participate in. Possible ratios - 1:1, 1:N, M:N M and N can be thought of as "1 or more"
8
A single faculty member would chair one department (at most). A single department would be chaired by one faculty member. FacultyDepartments Chairs 1 1
9
ComputersDepartments AssignedTo N1 A single computer would be assigned to a single department. A single department could have multiple computers assigned to it.
10
StudentsSections EnrolledIn MN A single student could be enrolled in multiple sections. A single section would have multiple students enrolled in it.
11
StatesCities CapitolOf 1 1 OrdersCustomers OrderedBy N1 MoviesCustomers RecommendedFor M N
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.