17
17
Final Examination
Semester 1 2017
INSTRUCTIONS
Instructions:
Identify and circle the choice that best completes the statement or answers the question in the provided
answer sheet on page 7. There is only one possible answer.
1) Database design
a. focuses on the design of the database structure that will be used to store and manage
end-user data
b. focuses on the design of the database structure that will be used to store and manage
business rules
c. focuses on the design of the database structure that will be used to manage business
operations
d. focuses on the design of the database structure that will be used to operate business
processes
e. none of the above
2) Well-designed database
a. can facilitate data management
b. has no errors
c. has no redundancy
d. has no management costs
e. none of the above
3) ______ provide a description of the data characteristics and the set of relationships that link the
data found within the database
a. queries
b. end-user data
c. metadata
d. schemas
e. none of the above
Page 2 of 21
Student ID_____________________ Student Name_____________________
6) Business rules
a. allow the designer to set company polices with regard to data
b. allow the designer to develop business processes
c. can serve as a communication tool between the users and designers
d. provide a framework for the company’s self-actualization
e. none of the above
7) The ____ model is the end users’ view of the data environment
a. abstract
b. external
c. conceptual
d. internal
e. none of the above
8) An internal _____ refers to a specific representation of an internal model, using the database
constructs supported by the chosen database.
a. tuple
b. schema
c. object
d. value
e. none of the above
9) A ____ key can be described as a minimal superkey, a superkey without any unnecessary
attributes
a. secondary
b. candidate
c. primary
d. foreign
e. none of the above
10) A ____ key is defined as a key that is used strictly for data retrieval purposes
a. lookup
b. foreign
c. candidate
d. secondary
e. none of the above
Page 3 of 21
Student ID_____________________ Student Name_____________________
11) ______ is the SQL command that lets you save your work to disk.
a. UPDATE
b. INSERT
c. SAVE
d. COMMIT
e. none of the above
12) In the PRODUCT table, if a product is to be deleted, the ______ command will be used to delete
that product from the PRODUCT table.
a. INSERT
b. ERASE
c. KILL
d. DELETE
e. none of the above
13) If the price of a product in the PRODUCT table increased and needs to be changed, the ______
command will be used to make this change.
a. COMMIT
b. UPDATE
c. INSERT
d. EDIT
e. none of the above
14) To enter a new product into the PRODUCT table, the _______ command should be used.
a. ENTER
b. UPDATE
c. MODIFY
d. INSERT
e. none of the above
15) Special operators may be used in conjunction with the WHERE clause to further restrict search
results. A special operator used to check whether an attribute value matches a value contained
within a subset of listed values is ____.
a. BETWEEN
b. LIKE
c. IN
d. WITHIN
e. none of the above
Page 4 of 21
Student ID_____________________ Student Name_____________________
16) To determine the most expensive product in the PRODUCT table, the ______ function may be
used in conjunction with the PRODUCT_PRICE column.
a. COUNT
b. TOP
c. MAX
d. SUM
e. none of the above
17) To determine the total number of PRODUCTS in the PRODUCT table, the ______ function may
be used in conjunction with the PRODUCT column.
a. COUNT
b. TOP
c. MAX
d. SUM
e. none of the above
18) A query was executed to list all the PRODUCTS that have been selling quite well and this result
was added to a column named BEST_SELLERS, generated as a result of this query. BEST_SELLERS
is a/n _____.
a. Alias
b. Stored function
c. Trigger
d. All of the above
e. none of the above
19) To determine whether or not there is a PRODUCT in the PRODUCT table that matches a certain
description, the special operator _______ may be used in conjunction with the WHERE clause.
a. BETWEEN
b. LIKE
c. EXISTS
d. IN
e. none of the above
Page 5 of 21
Student ID_____________________ Student Name_____________________
20) Which of the following commands will create a Natural Join between the P_DESCRIPT and
P_PRICE fields from the PRODUCT table and the V_NAME, V_AREACODE, V_PHONE, and
V_CONTACT fields from the VENDOR table where the value of V_CODE match?
Page 6 of 21
Student ID_____________________ Student Name_____________________
a b c d e
1.
a b c d e
2.
a b c d e
3.
a b c d e
4.
a b c d e
5.
a b c d e
6.
a b c d e
7.
a b c d e
8.
a b c d e
9.
a b c d e
10.
a b c d e
11.
a b c d e
12.
a b c d e
13.
a b c d e
14.
a b c d e
15.
a b c d e
16.
a b c d e
17.
a b c d e
18.
a b c d e
19.
a b c d e
20.
Page 7 of 21
Student ID_____________________ Student Name_____________________
Instructions:
Identify and circle the correct option based on whether or not the statement is true in the provided
answer sheet on page 10.
1) The only way to access the data in database is through the DBMS.
2) Islands of information can increases the probability of having different versions of the same
data.
3) A disadvantage of the RDBMS is its inability to hide the complexities of the relational model
from the user.
4) Each row in the relational table is known as an entity instance or entity occurrence in the ER
model.
9) The 1:M relationship is easily implemented in the relational model by putting the foreign key of
the “1” side in the table of the “many” side as a primary key.
10) Each table in a relational database must have a primary key and a foreign key.
11) Any changes made to the table contents are not physically saved on disk until you use the SAVE
<table name> command.
12) The TOTAL function computes the total for any specified attribute, using whatever condition(s)
you have imposed.
13) The FOREIGN KEY constraint is used to ensure that all values in a column are unique.
14) The default order in which records will be sorted using the ORDER BY clause is ascending order.
15) To delete the PRODUCT table from the database, the DROP command may be used.
16) In the context of Transaction Properties, Atomicity refers to all operations of a transaction must
be completed else the transaction is aborted.
Page 8 of 21
Student ID_____________________ Student Name_____________________
17) Concurrency Control refers to the coordination of the simultaneous transactions execution in a
multiuser database system.
18) Pessimistic locking is a Concurrency Control locking method that is based on the assumption
that conflict between transactions is likely.
19) In the context of Deadlocks, a deadly embrace refers to two transactions waiting indefinitely for
each other to unlock data.
Page 9 of 21
Student ID_____________________ Student Name_____________________
True False
1.
True False
2.
True False
3.
True False
4.
True False
5.
True False
6.
True False
7.
True False
8.
True False
9.
True False
10.
True False
11.
True False
12.
True False
13.
True False
14.
True False
15.
True False
16.
True False
17.
True False
18.
True False
19.
True False
20.
Page 10 of 21
Student ID_____________________ Student Name_____________________
The Youth Football Club (YFC) needs a database system to track children that sign up to play football.
Once signed up, children will be assigned to a team and regarded as players.
A team may have no or many players; however, a player must have a team. A team may also have no or
many coaches; but a coach needs to coach a team. Each team has a unique team color. While a team
can have many players and coaches, a player can only be assigned to one team and a coach can only
coach one team. Each player must have at least one parent; each parent must have at least one player.
Parents can be referred to as mother and/or father. Multiple players can come from the same family.
YFC keeps the following information on file: name of all players, parents, coaches and teams; mobile
phone number of all parents and coaches; age of each player and their parents’ home address.
Question 1
Page 11 of 21
Student ID_____________________ Student Name_____________________
b. Use Crow’s Foot notation to draw an implementation-ready ERD for the YFC. Show all the attributes
of all the entities you identify and indicate all primary keys and foreign keys in the ERD. (8 Marks)
Page 12 of 21
Student ID_____________________ Student Name_____________________
Question 2
b. Use dependency diagram(s) to demonstrate how the schema you wrote in point a (above) can
be normalized to 3NF through 1NF and 2NF. (10 Marks)
Page 13 of 21
Student ID_____________________ Student Name_____________________
AA Rentals is a rental car company that has branches in Suva, Pacific Harbour, Lautoka, Tavua, Nadi and
Nausori. A rental car can be picked up at any of the branches represented by Rent_Pickup and must be
returned to that same branch. Once a rental car is returned, the return date represented by
Rent_Return is recorded and the car is inspected to determine the mileage. AA Rentals’ management
team needs some reports for their upcoming meeting. In the following questions you will be required to
write the relevant queries that will provide the required information for their report. You are required to
use the given attribute names in the following ERD diagram in your queries.
Page 14 of 21
Student ID_____________________ Student Name_____________________
Question 1
a. Write a query that will create AA Rentals’ database. The respective tables should have the
appropriate attributes, appropriate data types, primary keys, foreign keys and required
constraints. (8 Marks)
Page 15 of 21
Student ID_____________________ Student Name_____________________
b. Mr. John Smith a new customer rented one of the cars with Car_Reg X101GA during the Easter
weekend. Write a query that will add this new record into the database
(2 Marks)
Question 2
A list of all the customers and which branch they picked up the rental car is required. Write a query to
generate this information. (2 Marks)
Question 3
Management would like to know where the customers were from, what cars they rented and for how
long they rented the car. Write a query to generate this information. (2 Marks)
Page 16 of 21
Student ID_____________________ Student Name_____________________
Question 4
The fleet of cars is very important to the company and as such, management would like a list of all the
cars and the mileage for each car during each car’s latest inspection. Write a query to generate this
information. (2 Marks)
Question 5
In preparation for an upcoming promotional deal, management will need to determine how many
customers qualify. To qualify for this promotional deal a customer must have rented the most popular
rental car model for a period of 3 days or more. The most popular car is one which has been rented the
most. Management will need the contact details for these customers to invite them to participate in this
promotional deal. Write a query that will generate this information.
(5 Marks)
Page 17 of 21
Student ID_____________________ Student Name_____________________
Question 6
One of the inspectors, Mr. Tom Harrison is migrating and has submitted his letter of resignation.
Management has decided to throw a farewell party in his honour. To organise this party, management
will need help from the other inspectors at the branch he inspected cars. Write a query that will
alphabetically list the names of the inspectors who are based at the same branch as Mr. Harrison.
Insp_ID for Mr. Harrison is TH101. (5 Marks)
Question 7
As with inspectors and cars, management would like to maintain up to date details.
a. Write a query that will update a car’s mileage after inspection. (2 Marks)
Page 18 of 21
Student ID_____________________ Student Name_____________________
b. Write a query to add a new car inspection record to the database. (1 Mark)
c. Write a query to remove a car that has been totalled in an accident from the database.
(1 Mark)
Page 19 of 21
Student ID_____________________ Student Name_____________________
Question 1
Two techniques used in transaction recovery procedures are Deferred-write and Write-through. Briefly
describe these two procedures highlighting similarities and differences (2 Marks)
Question 2
Question 3
Five transaction properties contribute towards maintaining a consistent database state. Briefly describe
these transaction properties. (2 Marks)
Page 20 of 21
Student ID_____________________ Student Name_____________________
THE END
Page 21 of 21