Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ICT285 Databases

Final Examination

Jan Trimester, 2022

QUESTION 1 (10 MARKS)

Read the following scenario and answer ALL questions. Your explanations MUST be entirely based on the provided relation.

A company uses below“Inventory”database to record data about their IT equipment. The database is mainly used to store data about two types of hardware: Laptops and Printers. The company stores data on the vendor (manufacturer), Asset_ID (unique number of the asset), Asset_type (i.e., laptop or printer), L_ram (RAMs for laptops), L_screen (screen size of laptops), P_type (Printer type i.e

ink_jet, laser, etc..), P_Colour (colour of printer), and Prices of assets.

Inventory Database (unpopulated with data):

Vendor

Asset_ID

Asset_Type

L_ram

L_Screen

P_Type

P_Colour

Price

 

 

 

 

 

 

 


a)                                                                                                                                   E xplain what are the major concerns or problems associated with this database design. Provide     examples of these problems, your explanation should be entirely based on the above relation. (3  marks)

b)  How would you change the design above to address the problems you have identified? Make  sure you provide the new design, define the primary keys (by underlying the attributes that are primary keys), define the foreign keys (by indicating them in bold). (4 marks)

c)  Consider the following SQL query and explain what information will be retrieved when it’s      executed (1.5 marks). As the DBA in this company, explain what you can do to restrict access to this retrieved information for a specific group of users (*hint you should provide an SQL query to support your response) (1.5 marks). (3 marks total)


SELECT R1.P_Type

FROM Printer R1

WHERE NOT EXISTS

(SELECT *

FROM Printer R2

WHERE R1.price > R2.price)

QUESTION 2 (20 MARKS)

The following tables form part of a database held in a relational DBMS (  Primary Key, Foreign Key):

Book (Book_ID, Publisher, Type, Year, Edition, Price)

Employee (Employee_No, FirstName, LastName, Role)

EmployeeBook (Book_ID, Employee_No, Date_Taken, Date_Returned)

Provide the SQL for the following queries:

a)  List the numbers of Books taken by each IT Officer

b)  Show the employees who have taken more than two Books

c)  List the maximum number of Books taken by any Employee

d)  Show the Employees who are Managers and have not taken any Book

e)  List the full details of the most expensive as well as the cheapest Book

QUESTION 3 (15 MARKS)

Give the relational algebra (not SQL) expressions for each of the queries in Question 2:

a)  List the numbers of Books taken by each IT Officer

b)  Show the employees who have taken more than two Books

c)  List the maximum number of Books taken by any Employee

d)  Show the Employees who are Managers and have not taken any Book

e)  List the full details of the most expensive as well as the cheapest Book

QUESTION 4 (15 MARKS)

Convert the following relation into a relation or set of relations in at least 3NF:

Name

Address

Contact

BookingID

Date_fro

m

Date_to

Rego

Made

Year

Rate

OfficeID

Address

Jack

Hay st.

015926

B009

19-2-21

21-2-21

C201

BMW

2020

50

L1

Monk st

Charlie

Rea st.

032569

B003

B004

30-1-21

30-1-21

5-2-21

7-2-21

B302

T210

Suzuki

BMW

2021

2018

30

50

L2

L2

Bland st

Bland st

Jack

Kings st.

087954

B006

10-2-21

19-2-21

C265

Honda

Twenty

Twenty

45

L1

Monk st

Ali

Kings st.

052949

NA

1-12-9999

31-12-

9999

NA

NA

9999

0

NA

NOT

QUESTION 5 (25 MARKS)

.    Create an ERD from the given case below using the Crow’s Foot notation                    .    Use Visio or any other appropriate tool to create the ERD and legend, it should be clear,

readable, concise, and complete. Attention to the naming of entities and overall presentation.

.    If you prefer, sketch it on a paper first as a draft. Note, a hand drawn ERD will not be accepted.

Your client is a company that supplies building materials. The company want you to design a stock order database (they keep none or very little stock on hand). Once this database is implemented,     your client will then integrate it into its existing invoice system.

After interviewing members of the organisation, you have accumulated the following information:

Your client keeps track of its customer’s details, including their name, address and contact details, which includes multiple phone numbers. Each customer has a unique number (CustID) and a      nominated discount rate, which is applied to the list price of any product they purchase.

Customers purchase products from the company by placing an order, which has a unique number (OrderNo) and the date the order was placed. An order may be for many products. Each product has a unique product number (ProductNo), a description and a list price.

When a customer’s order is assembled (i.e., is complete), it is sometimes collected from the           company by the customer, in which case no other documentation is required. Alternatively, a       customer’s order may be dispatched to a specified location (a delivery site) via a nominated freight company. For each jobsite, your client records the name of the delivery site, the address and        multiple phone numbers. The delivery site is not unique to, nor owned by, the customer, for           example, many customers may have their deliveries sent to a particular mine site.

Your client has their own consignment book, which the nominated freight company’s driver signs     and dates when an order is collected. A unique consignment note number (ConNote) is provided for each delivery. An order is not dispatched until it is completed (i.e., an order is only ever dispatched once).

A customer can have multiple orders for a particular delivery site, and different freight companies may deliver these orders. This depends on the availability of the delivery vehicles, the size of the order and when the order is ready to be dispatched.

Your client keeps a record of the details of the various freight companies it uses, including their name, account number, address and contact details, which include multiple telephone numbers.

Each freight company has different vehicle types available, such as utilities, flatbeds, semitrailers,  enclosed vans, etc. The vehicle type used for a delivery depends upon where the order is going and what size the order is.

QUESTION 6 (15 MARKS)

Read the below scenario and answer ALL the following questions:

A tourist arrives in Perth city on a leisure trip. They are looking to visit Rottnest Island by taking the ferry. There are different ports for departure/arrival. Consider the transaction where this tourist (now customer) wants to book a ferry that goes from port A to port B on a given date and time.

a)  Explain step-by-step the different steps that are needed in order to update the database when a customer books a ferry. (7 marks)

b)  Assuming that multiple customers can access the booking system from different locations. Identify the major issue that may arise in this situation. (2 marks)

c)  In each of the situations below, the users are accessing the same data at the same time. Which of the situations could give rise to a major problem? You should name the Major problem and fill  in the provided table using X in relevant cell). (3 marks)

Situation

Yes

No

3 users executing SELECT statements

 

 

2 users executing SELECT statements

1 user executing an INSERT statement

 

 

2 users executing SELECT statements

1 user executing an UPDATE statement

 

 

3 users executing UPDATE statements

 

 

d)  Using the transactions table above as an example, explain the concepts of Atomicity and Isolation. (3 marks)