Ask DBMS Expert


Home >> DBMS

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.

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M92701150

Have any Question?


Related Questions in DBMS

Data mining assignment -in this assignment you are asked to

Data Mining Assignment - In this assignment you are asked to explore the use of neural networks for classification and numeric prediction. You are also asked to carry out a data mining investigation on a real-world data ...

Sql query assignment -for this assignment you are to write

SQL Query Assignment - For this assignment you are to write your answers in a word document. This assignment is in three parts: Part A (reporting queries), Part B (query performance), Part C (query design). For this assi ...

The groceries datasetimagine 10000 receipts sitting on your

The groceries Dataset Imagine 10000 receipts sitting on your table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer's basket. That ...

You are in a real estate business renting apartments to

You are in a real estate business renting apartments to customers. Your job is to define an appropriate schema using SQL DDL in MySQL. The relations are Property(Id, Address, NumberOfUnits), Unit(ApartmentNumber, Propert ...

Objectivethe objective of this lab is to be familiar with a

OBJECTIVE: The objective of this lab is to be familiar with a process in big data modeling. You're required to produce three big data models using the MS PowerPoint software. This tool is available on UMUC Virtual Deskto ...

The relation memberstudentid organizationid roleid stores

The relation Member(StudentId, OrganizationId, RoleId) stores the membership information of student joining organization. For example, ('S1', 'O2', 'R3') indicates that student with Id 'S1' joined the organization with i ...

Relational database exerciseyou have been assigned to a new

Relational Database Exercise: You have been assigned to a new development team. A client is requesting a relational database system to manage their present store with the anticipation of adding more stores in the future. ...

Relational database design a given the following business

Relational Database Design A) Given the following business rules, identify entity types, attributes (at least two attributes for each entity, including the primary key) and relationships, and then draw an Entity-Relation ...

We can represent a data set as a collection of object nodes

We can represent a data set as a collection of object nodes and a collection of attribute nodes, where there is a link between each object and each attribute, and where the weight of that link is the value of the object ...

Data model development and implementationpurpose of the

Data model development and implementation Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop data models and map Database System into a standard development environment to gain unde ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As