1 / 13

Assignements

Assignements. Exercise 1. Superkeys : Candidate keys : Primary key :. Exercise2. What is a foreign key constraint? Why are such constraints important? What is referential integrity?. Exercise 3.

aloha
Download Presentation

Assignements

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Assignements

  2. Exercise 1 • Superkeys: • Candidatekeys: • Primary key: CSC343: Intro. to Databases

  3. Exercise2 What is a foreign key constraint? Why are such constraints important? What is referential integrity? CSC343: Intro. to Databases

  4. Exercise 3 Answer each of the following questions briefly. The questions are based on the following relational schema: • Emp (eid: integer, ename: string, age: integer, salary: real) • Works (eid: integer, did: integer, pcttime: integer) • Dept (did: integer, dname: string, budget: real, managerid: integer) CSC343: Intro. to Databases

  5. Exercise 3 • Give an example of a foreign key constraint that involves the Dept relation. • What are the options for enforcing this constraint when a user attempts to delete a Dept tuple? CSC343: Intro. to Databases

  6. Consider the following ER diagram!!. List all superkeys , candidatekeys, and primarykeys for entities sets Students and Courses, and for relationship set Enrolled.

  7. Assignement 2 • Draw UML class diagrams for a car rental agency database , keeping track of current rental location of each car, its current condition and history of repairs, and customer information for a local office, expected return date, return location, car status (ready, being-repaired, currently rented, being-cleaned). • Select attributes from your intuition about the situation. Draw one diagram showing the relationships of the classes without the attributes listed. • Translate the diagram into relations

  8. Hotel reservations • Each hotel is designed by itsname , address , city, price for each kind of room , and the number of rooms for each kind. • Customers areidentified by name , surname, address and telnumber. They can book one or more rooms for one or more consecutivedays. For each reservation, it is necessary to store the name of the customer, the date of the resrvation as well as the arrival date and departure date.

  9. Hotel reservations • Wealsowant to store info about the actualstay of the hosts: the actual arrival and departure dates (thatmightbedifferent from the onesspecifiedduring the reservation), the advancepaid at the booking time, the balance ( amount of money still to bepaid) and the status of the payment (paid/ to bepaid). Draw UML diagram and translate it into relations?

  10. Translate the following diagram into relations. Make the translation of the hierarchical structure between the Part entity sets in the three variants.

  11. Web store The UML diagram below describes a web store, which sells DVD’s and CD’s (“items”) to customers. Items may belong to several categories. Customers may write reviews of the items that they have purchased. Translate the model into a relational model.

  12. Translate the followingmodel into a relational model

More Related