Consider the conceptual schema given below.
Your task is to perform the steps of logical database design, i.e. to transform a conceptual schema given above into a collection of relational schemas.
Before transformingadd the attribute ‘phone’ to theBRANCH andthe attribute ‘mobile-phone’to the CUSTOMER class.
Draw the resulting conceptual schema addingyour name,student numberandthe dateto the drawing. Use UMLet and paste images of your drawings into your Microsoft Word document using the template provided.
List the names of attributes, primary key, candidate keys (if any), and foreign keys (if any) for each class in the relational schema. Assume that anassociation methodis used to implement the generalisation.
Show your working and explain as you step through the transformation process.Convert your Microsoft Word document based on the template provided into a pdf and submit your answer
as a filequestion1.pdf
DPIT115 Data Management and Security Final Assessment (Summer 2022)
QUESTION 2 (10 marks)
Write the data definition statements of SQL that modify the structures of a database listed on page 2 of this assessment in the way described below.
Note, that some of the modifications may require more than one SQL data definition statement.
(1) Modify the consistency constraint of the sample database such that after the modification, it is possible to record in the database information about the trucks that have a capacity up to and including225.
(2 marks)
(2) Modify the structure and consistency constraints of the sample database such that after the modification, it is possible to store information in the database about the total number of legs a trip contains. Assume that a trip cannot contain more than10legs.
(3) Modify the structure of the sample database so it is possible to store information in a new table in the database about mechanics employed by a transportation company. Assume that a description of a mechanic consists of anemployee number,first name,last name,date of birthandqualification level. A qualification level is a positive integer number1or2or3or4or5 or 6. Remember that a mechanic is an employee.
(4) Modify the consistency constraints of the sample database, so it is possible to store information about thetripwithout providing information about adriver licence number. Such modification is required when a driver leaves a transportation company, and we would like to keep information about alltripsperformed by the driver.
(5) Explain how the use ofconsistency constraintssupports the management of data security. Use original examples that you make up yourself to illustrate your answer.
Add your code into thequestion2.sqltemplate provided and output your report file on your virtual machine
to a file namedquestion2.rpt.Addyour name,student numberandthe dateto the comments section of your SQL script.
Submit your answers as the filesquestion2.sql,question2.rptandquestion2.pdfusing the templates provided.
Note your script may be tested and should not have any errors when run.
If a submitted file has an incorrect filename or file type, it may lose marks.
Page4of6
QUESTION 3 (10 marks)
Write the data manipulation statements of SQL that modify the contents of a database listed on page 2 of this lab task in the ways described below.
Note that you are not allowed to modify and/or to drop any consistency constraints. Also note, that to implement some of the modifications listed below, you may need more than one data manipulation statement.
(1) A new trip has been completed today. The trip was fromWollongongtoOrange. The trip has been performed by the driver with the licence number412443(columnLICENSENUMin a relational tableTRIP) who used the truck with registration numberAD29FZ. Insert the appropriate information into the sample database assuming the next trip number is3452.
(2) Delete the information from the database about trip number53. Remember, that the foreign keys in
allCREATE TABLEstatements have noON DELETE CASCADEclause.
(3) Change the status of all the drivers who have performed more than24trips to beON LEAVE.
(4) Copy information about all employees born before the year2000to a new tableS20CENT. There is no need to enforce any consistency constraints on the new table.
(5) Explain how theData Definition Languate(DDL) statements of SQL are used in data management and security. Use original examples including sample code that you make up yourself to illustrate your answer.
Submit your answer as files namedquestion3.sqlandquestion3.pdfusing the templates provided. Addyour name,student numberandthe dateto the comments section of your SQL script.If a submitted file has an incorrect filename or file type, it may lose marks.
QUESTION 4 (10 marks)
Assume that the userrootwith a password 'DPIT115' created a database calledtransportand the user‘root’executed CREATE TABLE statements given on page 2 of the examination paper to create the relational tables in the database transport.
Write a SQL script that performs the following operations the user‘root’. Assume that the user‘root’has already connected to the database.
(1) The user‘root’nominates a databasetransportas a default database, and then the user creates two roles‘driver’and‘admin’.
(1 mark)
(2) The user‘root’grants read access rights to the relational tables EMPLOYEE and DRIVER to the role‘admin’. The read access rights cannot be propagated to other roles or users.
(3) The user‘root’grants the rights to insert the rows into a relational tables TRIP and TRIPLEG to
the role‘driver’. The access rights can be propagated to other roles or users.
(4) The user‘root’grants the update privilege on all relational tables in thetransportdatabase to the
role‘admin’. The privilege cannot be propagated to other roles or users.
(5) The user‘root’grants the read access rights to information about the total number of trips
performed by each driver to a role‘driver’.
(6) The user‘root’createsfive (5)new users and grants the role‘driver’totwo (2)of the users, and the role‘admin’to theallother users. The names and passwords of the new user accounts are up to you. (1 mark)
(7) The user‘root’sets the resource limits for the users created in the previous step allowingten (10)maximum concurrent connections. Finally, the user‘root’locks all the user accounts created in the previous step. (1 mark)
(8) Explain in your own words the difference betweenAuthenticationandAuthorisation. Use original examples that you make up yourself and diagrams that you draw yourself to illustrate your
answer. (3 marks)
Add your code into thequestion4.sqltemplate provided and output your report file on your virtual machine to a file namedquestion4.rpt
Addyour name,student numberandthe dateto the comments section of your SQL script.Submit your answers as files namedquestion4.sql,question4.rptandquestion4.pdf,use the templates
provided.Note your script may be tested and should not have any errors when run.If a submitted file has an incorrect filename or file type, it may lose marks.
END OF ASSESSMENT
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here