List the functional dependencies for the car mechanics

Assignment Help Database Management System
Reference no: EM131872800

Question 1: ER Model (30 marks)

You must use only the following notation:

876_1.jpg

Use of Crows feet, UML, IE notation or any other form is not permitted and will incur a penalty for this question.

A tour company, "Total Escapes" wants to implement a simple database to keep records on some aspects of its operation. They describe key elements of the requirements in the following dot points. Use this information to understand their requirements and draw an ER Diagram.

1010_11.jpg

• Total Escapes has a wide variety of tours on offer to its customers. Each tour can be uniquely identified by a route ID. A tour also has associated with it a name, an estimated duration and a description of the tour itself.

• Customer details are to be recorded in the database, with a unique customer ID generated for each customer. Additional details include a name, date of birth and an email address.

• A Tour run is defined as one instance of a tour, i.e. a tour has a number of tour runs per day. For example, a ‘Melbourne City Tour' runs twice every day, 8:30am and 2:30pm. A number is allocated to each tour run for the day on which it is run. The time the tour is run is also recorded.

e.g.

Tour name  Tour date Tour Number     Tour time

Melbourne   City Tour    1/1/2018 1      8:30 a.m.

Melbourne   City Tour    1/1/2018 2      2:30 p.m.

• A customer can book tour runs. Each booking is given a special Booking ID. The date, price paid and status(paid/unpaid) for the booking is recorded.

• Each tour run requires the usage of exactly one vehicle. Each vehicle can be identified by it registration plates. Other attributes such as vehicle type, capacity and transmission are also recorded.

• A Tour guide also attends a tour run. The tour guide must have a unique certificate number to be recorded in the system. Their name, mobile number and address are also required.

• The driver responsible for operating the vehicle on a tour run can be identified by their D/L number. A name and mobile phone number are also recorded in the database for each driver.

• Some tour guides train other tour guides to manage tours themselves. Each trainee has one supervisor while a supervisor can guide many trainees.

According to the given description, construct an Entity Relationship (ER) diagram for the database, and make assumptions where necessary. You must represent entities, relationships and their attributes, and all applicable constraints in your ER diagram. Explain any concepts in the description that cannot be expressed in the ER diagram.

Do not create any new attributes not already provided in this business description.

Question 2: The Relational Model (15 marks)

2.1 Convert the following ER diagram for a real estate system into a relational schema.

1746_2.jpg


For each relation in your relational database schema, you should:

• Underline a primary key for each relation

• Denote any foreign keys with asterisks(*) in your relations

Yes No

relationName(attribute1, attribute2*)

Relations not expressed in the approved representation are not permitted and will incur a penalty for this question.

Question 3: Relational Design (20 marks)

3.1. The following relation holds data about a car mechanics database:

Mechanics(customerID, customerName, mechanicID, mechanicName, partID, costOfRepair, VIN, make, model)

• A customer has a unique ID and associated with that ID is the customer's name.

• Each mechanic is identified by a unique ID and also has a name recorded in the system.

• A customer's vehicle is identified by its unique Vehicle Identification Number(VIN). A customer can own many vehicles but each vehicle has one registered owner.

• Each vehicle has details such as make and model recorded in the database.

• The estimate for repair costs is calculated based on the vehicle identifier and the part that needs replacing.

3.1.1. List the functional dependencies for the car mechanics relation.

3.1.2. Work out what the Primary Key of the car mechanics relation is and prove it using closure notation.

3.1.3. Using the functional dependencies you have created in 3.1.1., show which normal form the car mechanics relation is in.

3.1.4. Decompose the car mechanics relation into separate relations so that each can be considered as being in BCNF. Show the final schema in full with all primary keys and foreign keys marked appropriately.

Question 4: Short answer (10 marks)

4.1 When should we use ternary relationships / binary relationships?

Consider a medical clinic DBMS. There are 3 entities ‘Doctor', ‘Patient' and ‘Consultation' in the

ER diagram and the system allows for the following actions:

• A doctor can conduct many consultations.

• A patient can have many consultations.

• Each consultation must have exactly one doctor and exactly one patient.

According to the above description, decide which ER diagram below best describes the relationship and would be the most practical to implement. Explain your reasoning.

2150_4.jpg

Responses should be limited to no more than 2 or 3 sentences but this is not a strict requirement. The use of images/diagrams to aid in your explanation is also acceptable.

Question 5: Advanced SQL (25 marks)

The "Big Bank" banking organisation has been upgraded and is shown below:

2363_5.jpg

Customer(ID, firstName, lastName, address, email, phone, dateOfBirth)

Transaction(code, type, dateExecuted, amount)

Account(accNumber, balance, type)

Branch(BSB, phone, streetAddress, town)

Atm(AtmNumber, atmType)

Employee(employeeID, firstName, lastName, address, phone, TFN, dateOfBirth)

performs(code*, accNumber*, ID*)

has(ID*, accNumber*)

registered(accNumber*, BSB*)

locatedAt(AtmNumber*, streetAddress, BSB*)

worksAt(employeeID*, BSB*, occupation)

• Primary keys are underlined and foreign keys are denoted with asterisks (*).

• A customer can have more than one account and an account can be jointly owned by more than one customer.

• An employee can only work at one branch.
• All accounts must be registered with a branch.

Write one SQL query for each question below to extract information from the database. Each question is worth 5 marks. Do not supply the output of the query. Only the SQL query is required for each question.

Hardcoding of identifiers not given in the question is not permitted and will incur a penalty for the question. Only use the information provided in each question.

5.1. Which couple works at the same bank? (hint: They live at the same address and share the same last name)

There should be no repeated pairs of results for your query.

5.2. Using IN or NOT IN operator compose a query that can determine which branches do not have any ATMs.

5.3. Find all low-net-worth customers who have a total balance of less than $5,000 from all their accounts combined total. List their first and last name and the balance for each account they own. The output should be in ascending order of last name of customers.

5.4. Use a set operator to find new customers, i.e. those customers who have performed no more than two transactions thus far. List the customer ID of these customers.

5.5. Find all customers whose accounts are all held in only one branch. List customer ID and email address of these customers.

Reference no: EM131872800

Questions Cloud

Conflict theory to the michael browns police : Apply the conflict theory to the Michael Browns police shooting in Ferguson, Missouri. Provide at least 2 examples of how the theory applies to the case.
What about a tablet or even some of our phones : How do you all feel a company should go about implementing an employee monitoring policy? What should be the foundation?
Is the hospital entitled to tax exempt status : The hospital has only 50 beds, so it limits number of physicians that can admit and treat patients at the hospital. Is Hospital entitled to tax exempt status
Explain the behavior : How does conflict theory explain the behavior? How does conflict theory apply to the case?
List the functional dependencies for the car mechanics : According to the given description, construct an Entity Relationship (ER) diagram for the database, and make assumptions where necessary.
Positive and negative consequences of having american law : What are some of the positive and negative consequences of having American law enforcement fragmented among so many different jurisdictions?
Incident command system : List the five functional areas of the Incident Command System. Describe each of them briefly.
Doctrine of transferred malice : In regards to the Doctrine of Transferred Malice, if A has intent to kill B, but kills C and B as well, can the doctrine still apply?
Should leland purchase the parts from scott : If Leland purchases the KJ37 units from Scott, the capacity Leland was using to manufacture these parts would be idle. Should Leland purchase parts from Scott

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd