Uploaded by Yi Long Phua David

ICT330 JUL 2020 TOA 

advertisement
ICT330
Timed Online Assignment – July Semester 2020
Database Management Systems
Monday, 09 November 2020
1:00 pm – 3:30 pm
____________________________________________________________________________________
Time allowed: 2.5 hours
____________________________________________________________________________________
INSTRUCTIONS TO STUDENTS:
1. This Timed Online Assignment (TOA) contains FOUR (4) questions and comprises
FIVE (5) pages (including cover page).
2. You must answer ALL questions.
3. If you have any queries about a question, or believe there is an error in the question,
briefly explain your understanding and assumptions about that question before
attempting it.
4. You MUST submit your answers via Canvas (similar to TMA submission) at the
end time of this TOA (as stated on this cover page). The 15 minutes grace period as
shown on Canvas is strictly meant for technical issues encountered during
submission. Thereafter, you will not be able to submit your answers and you will be
considered as having withdrawn from the course. No appeal will be allowed.
5. You are to include the following particulars in your submission: TOACourse Code,
SUSS PI No., and Your Name. Name your submission file as
TOACourseCode_FullName_StudentPI.
6. Your submission should consist of only one file and must not exceed 500MB in size.
The file must be a Microsoft Word file saved in .doc or .docx format. All answers are
to be typed. Flowcharts and graphs may be scanned or photographed and embedded
in the Word file provided it does not exceed the file size limit of 500MB. Images of
handwritten answers will not be marked.
ICT330 Copyright © 2020 Singapore University of Social Sciences (SUSS)
TOA –July Semester 2020
Page 1 of 5
7. You are required to sketch a diagram in some of the questions, if you are unable to
include them into the word document, you may upload them as pdf.
Please ensure that the total file size including word document does not exceed 500
MB and rename your pdf with the following naming convention:
CourseCode_FullName_StudentPI_PDF1
All uploaded hand written diagram and sketch must be clear, readable and complete.
Marks will not be awarded for un-readable or incomplete images.
8. To prevent plagiarism and collusion, your submission will be reviewed by Turnitin.
The Turnitin report will only be made available to the marker and you will not be
able to view it.
9. The University takes plagiarism and collusion seriously, and your Turnitin report will
be examined thoroughly as part of the marking process.
____________________________________________________________________________________
Answer all questions. (Total 100 marks)
Question 1
A baking school conducts classes that run on a regular basis, e.g., fortnightly, monthly
or quarterly. Each class has a name such as Bread 101 and has a fixed number of
sessions, e.g., four sessions. Each class is conducted by two instructors from a pool of
instructors employed by the baking school, and the different runs of a class may be
instructed by a different set of two instructors.
Each run has a run id, a start date and schedule which is either daily or weekly. For
example, the four sessions for Bread 101 may be conducted on four consecutive days in
one run and on four consecutive weeks in another run (that is, conducted weekly).
Students enrolled in one run are allowed to have a maximum of one make-up session in
another run should they be unable to come to class. Attendance for every session is
recorded, and 75% attendance is required for a student to earn a certificate of
completion.
Construct a conceptual (ER) model from the statements of requirements to represent the
data model for the baking school, showing
(i)
entities, with entities name, relevant attributes and identifier.
(10 marks)
(ii)
relationships with maximum and minimum cardinalities and relationship name.
(10 marks)
State your assumption(s) for only data requirements that are not specified.
ICT330 Copyright © 2020 Singapore University of Social Sciences (SUSS)
Examination – January Semester 2020
Page 2 of 5
Question 2
After buying an air condition system, a customer may purchase one or more servicing
packages. The different types of packages offer a different number of servicing sessions
and cost. When a customer uses a service session, the service date and the staff
performing the service must be recorded.
You are given the Servicing table:
Servicing (packageNumber, packageType, numberSessions, packageCost, customerId,
customerName, address, dateService, staffNum)
(a)
Formulate and list the functional and multi-valued dependencies. Then, propose
candidate key(s) for the table.
(9 marks)
(b)
For each MVD, state whether it is subsumed.
Normalise the table to BCNF and 4NF by applying the BCNF approach.
Show and discuss how you apply the steps to arrive at the tables, and at each
iteration, explain whether each derived table is already in BCNF and 4NF (if
applicable).
(9 marks)
(c)
Assemble your 4NF tables and constraints clearly.
(i)
Give each table in this form:
TABLE-NAME(col-name1, col-name2, ..., col-namen)

indicate (PK) against the primary key and

indicate (FK) against the foreign keys, if any.
(ii)
State the referential integrity constraint(s), if any, together with the
correct table in this form:
TABLE-NAMEx.col-namex1 ...col-namexn must exist in
TABLE-NAMEy.col-namey1...col-nameyn
(7 marks)
ICT330 Copyright © 2020 Singapore University of Social Sciences (SUSS)
Examination – January Semester 2020
Page 3 of 5
Question 3
(a)
Transform the ERD in Figure Q3(a) into a logical model, and then implement
tables: Employee and Department. List the SQL statements according to the
order that they should be executed.
Figure Q3(a)
Assume the following:
 for the Employee table,
 all columns except contact are required,
 employeeId is exactly 4 character long, and starts with a letter followed
by 3 digits.
 name is at most 30 characters long,
 address is at most 50 characters.
 dateJoined is a datetime.
 salary is from $1200 to $10000.
 for the Department table,
 all columns are required,
 departmentNumber is a surrogate key with value starting at 1 and
incremented by 1.
 department name is either HR, sales or research, and is exactly 12
characters long, and is an alternate key.
 budget is a whole number and is at least 15000 with default value 15000.
 constraints
C1:
Minimum cardinality between Department and Employee for the worksIn
relationship is 1:N, M:O with delete and update disallowed.
C2:
Minimum cardinality between Employee and Department for the manages
relationship is 1:N, M:O with delete and update disallowed.
C3:
Minimum cardinality between Employee and Employee for the supervises
relationship is 1:N, O:O with delete and update disallowed.
(10 marks)
ICT330 Copyright © 2020 Singapore University of Social Sciences (SUSS)
Examination – January Semester 2020
Page 4 of 5
(b)
(c)
Formulate SQL queries to display the following resultsets:
(i)
Display the details of the employees who join this year in descending
order of their salary and ascending order of their names.
(ii)
Display the number of employees presently working in the sales
department. Use subquery.
(iii)
First, create a view to compute the total salary of employees in each
department. Using the view, write an SQL query to display the details of
departments whose budget is exceeded by the total salary of employees
in the department.
(15 marks)
Write and apply a trigger that prevents the salary of any employee to be more
than 10 % of the budget of the department that he works in.
(10 marks)
Question 4
(a)
Demonstrate the basic techniques of concurrency control and (ACID) and their
application.
Suppose there are two concurrent transactions: ta and tb, running at transaction
level read uncommitted. At this level, ta and tb, do not make lock request. Both
transactions ta and tb are performing a bank transfer. ta is transferring $500 from
bank account 101 to bank account 102 while tb is transferring $200 from bank
account 102 to bank account 101. Assume there is sufficient fund in both accounts
for both transfer operations.
(i)
Can a lost update problem occur? If the lost update problem can occur,
explain how it arises though an example. If the lost update problem cannot
occur, explain why.
(5 marks)
(ii)
Can deadlock occur? If deadlock can occur, show how it arises though an
example. If deadlock cannot occur, explain why.
(5 marks)
(b)
Explain how a DBMS authenticates users, and how it ensures that authenticated
users can perform only authorised operations.
(4 marks)
(c)
Explain checkpoint. Suppose a transaction has committed before a system crash
occur. List situations and explain why recovery is still necessary for these
situations even after a checkpoint has been issued.
(6 marks)
----- END OF PAPER -----
ICT330 Copyright © 2020 Singapore University of Social Sciences (SUSS)
Examination – January Semester 2020
Page 5 of 5
Download