
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This is an example of a many-to-one constraints, that is, many students can be advised by one professor, but each student can only have (at most) one advisor.
Typology: Exercises
1 / 24
This page cannot be seen from the preview
Don't miss anything!
We can express the overall logical structure of a database graphically with an E-R diagram. Its components are:
Students name
City Street Professor name P.I.D advised by since The since attribute in this example is called a descriptive attribute , since it describes the mapping from A to B
We can also use arrows to indicate key constraints (often simply referred to as constraints )
Students name
City Street Professor name P.I.D advised by since Suppose the university has the following rule: A student is allowed to be advised by at most one professor. However, a professor is allowed to advise more than one student. This is an example of a many-to-one constraints , that is, many students can be advised by one professor, but each student can only have (at most) one advisor. We can represent this with an arrow as shown below.
Is Married to Men name Women name Is Married to since Participation Constraints are indicated by bold lines in ER diagrams. We can use bold lines (to indicate participation constraints), and arrow lines (to indicate key constraints) independently of each other to create an expressive language of possibilities.
Sometimes we have to decide whether a property of the world we want to model should be an attribute of an entity, or an entity set which is related to the attribute by a relationship set. A major advantage of the latter approach is that we can easily model the fact that a person can have multiple phones, or that a phone might be shared by several students. (attributes can not be set-valued) Student Name SID Phone Student Name SID Phone # Prefix Number Can be reached at Expires
A classic example of a feature that is best modeled as a an entity set which is related to the attribute by a relationship set is an address. Student Name SID Address Student Name SID Address Num^ Street Has Address City Student Name SID Num Street City Very bad choice for most applications. It would make it difficult to pretty print mailing labels, it would make it difficult to test validity of the data, it would make it difficult/impossible to do queries such as how many students live in Fairfax? A better choice, but it only allows a student to have one address. Many students have a two or more address (i.e. a different address during the summer months) This method cannot handle this. The best choice for this problem