An er diagram for the system show all entities


Part -1:

Prepare the following:

a) An ER diagram for the system. Show all entities, relationships, cardinalities and optionalities. Also, include all intersection entities. You must use the Finkelstein methodology as per the study book and tutorials.

b) A list of relations (equivalent to Finkelstein entity list). Produce complete relations for all entities and attributes. Show all primary and foreign keys. Include all attributes that are specifically mentioned and all key attributes. You may need to create primary and foreign keys that are not specifically mentioned. You must use the Finkelstein methodology as per the study book and tutorials.

c) A SQL CREATE TABLE statement for the ITEM relation along with the creation of primary and foreign key constraints as required.

Part -2:

Produce a set of relations (equivalent to the Finkelstein entity list) in third normal form (3NF) from the following un-normalised relation for a flight reservation system. You must use the Finkelstein methodology as used in the study book and tutorials.

FLIGHT (departure airport code, departure airport name, departure time, departure date, arrival airport code, arrival airport name, arrival time, arrival date,  aircraft name, manufacture date, first class seats, business class seats, economy class seats, ((flight crew member, date joined, hours worked, crew member position, ((crew member role)) )), (( booking number, booking type, booking date, ((passenger surname, passenger first name, passenger dob, passenger contact number, seat number, special requests)), ticket price, booking fee))

Notes:

  1. Name of an aircraft can uniquely identify any aircraft.
  2. The number of seats in the economy, business and first class can be different for each aircraft.
  3. Each flight has a service of several crew members. Each crew member has one position but can have multiple roles such as cabin service and supervisor that must be recorded.
  4. The number of hours that each crew member worked in a particular flight regardless of their role is stored in the "hours worked" attribute.
  5. A departure airport for one flight can be an arrival airport for another flight and vice versa. Hence, it is important to uniquely identify an airport.
  6. A particular booking can be of two types: direct or through agent.
  7. Ticket price can be different for every flight under different bookings.
  8. Seat number and special requests by a passenger are associated with the corresponding flight and booking reference along with the passenger.

Part -3:

For each question, four marks will be awarded for the query and one mark for the screen capture of the results obtained after executing the query. Please copy the screenshot and paste it in your assignment solution document for every question.

The following E-R diagram represents a Car Hire database.

1383_ER diagram for the system.png

In this question, you will use the CAR HIRE database. The CAR HIRE database including appropriate data will be made available on the USQ Oracle server. You may query any of these tables but may not make changes.

Write SQL queries to solve the following specifications. Provide the queries and the output.

1. Display full details of all car bookings where (a) the odometer reading of cars is greater than 30,000 miles at the start of their rental and the reservation was done by a staff called REDMOND, OR (b) the car has not been returned and the car model name ends with 'TR'. Order the output by the date on which the booking was made, showing the most recent date first.

2. Using a set operator, find out all names of the customers that have not had any bookings.

3. Display the booking number, rental rate per day, rental period and the current status of the car for all car bookings. Filter your results to show only the records where the car is on hire and the rental rate per day is greater than $35.

4. Display the car registration number and the average miles travelled in all booking by each car where the average miles travelled is less than 1,000 miles and registration number begins with H.

5. Display the total rental income to date from the least expensive car available for rental. Format the output as a currency value (i.e. formatted as $9,999.99).

6. Display the car registration, rental cost, mileage of the car when it was last serviced and current mileage of the car for all completed bookings where the car is rented more than 30 months after it was bought.

7. Display booking number, date on which the booking was made and the cost of the rental for all the bookings made in the year 2012 and the car is already returned. Also include the name and full description of the corresponding model of the car used in the rental.

8. Display the customer number and the average rental income from that customer from all bookings where the average rental income is greater than the highest rental income in all bookings reserved by a staff named REDMOND. Exclude all bookings where the rental period is less than 10 days.

Solution Preview :

Prepared by a verified Expert
Database Management System: An er diagram for the system show all entities
Reference No:- TGS0941327

Now Priced at $70 (50% Discount)

Recommended (95%)

Rated (4.7/5)