Question: QUESTION 4 (10 marks) Assume that the user root with a password 'DPIT115 created a database called transport and the user 'root' executed CREATE TABLE

 QUESTION 4 (10 marks) Assume that the user root with a

password 'DPIT115 created a database called transport and the user 'root' executedCREATE TABLE statements given on page 2 of the examination paper tocreate the relational tables in the database transport. White a SQL script

QUESTION 4 (10 marks) Assume that the user root with a password 'DPIT115 created a database called transport and the user 'root' executed CREATE TABLE statements given on page 2 of the examination paper to create the relational tables in the database transport. White 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 database transport as a defaul 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. (1 mark) (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. (1 mark) (4) The user 'root' grants the update privilege on al relational tables in the transport database to the role 'admin'. The privilege cannot be propagated to other roles or users. (1 mark) (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'. (1 mark) (6) The user 'root' creates five (5) new users and grants the role 'driver' to two (2) of the users, and the role 'admin' to the all other users. The names and passwords of the new user accounts are up to you. (1 mark) (7) The user 'root' sets the resource Imits for the users created in the previous step allowing ten (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 between Authentication and Authorisation. Use original examples that you make up yourself and diagrams that you draw yourself to illustrate your answer. (3 marks) Add your code into the question4.sql template provided and output your report fle on your virtual machine to a file named question4.rpt Add your name, student number and the date to the comments section of your SQL script. Submit your answers as files named question4.sql, question4.rpt and question4.pdf, use the templates provided. Note your script may be tested and should not have any errors when run. /* (0) Assume that the user 'root' with a password 'DPIT115' created a database called transport and the user 'root' executed CREATE TABLE statements given on page 2 of the paper to create the relational tables in the database transport. */ CREATE TABLE EMPLOYEE( EMPNUMFIRSTNAMELASTNAMEDOBDECIMAL(12)VARCHAR(50)VARCHAR(50)DATENOTNULL,NOTNULL,NOTNULL,NULL,/Employeenumber/Firstname/Lastname/Dateofbirth/// CONSTRAINT EMPLOYEE_PKEY PRIMARY KEY(EMPNUM)); CREATE TABLE DRIVER( EMPNUM DECIMAL(12) NOT NULL, / Employee number / LICENSENUM DECIMAL(8) NOT NULL, / Driving license number * / STATUS VARCHAR(10) NOT NULL, /* Driver status / CONSTRAINT DRIVER_PKEY PRIMARY KEY(EMPNUM), CONSTRAINT DRIVER_UNIQUE UNIQUE(LICENSENUM), CONSTRAINT DRIVER_FKEY FOREIGN KEY(EMPNUM) REFERENCES EMPLOYEE(EMPNUM), CONSTRAINT DRIVER_STATUS CHECK (STATUS IN ('AVAILABLE', 'BUSY', 'ON LEAVE')) ); CREATE TABLE TRUCK ( CONSTRAINT TRUCK_PKEY PRIMARY KEY(REGNUM), CONSTRAINT TRUCK_STATUS CHECK (STATUS IN ('AVAILABLE', 'USED', 'MAINTAINED') ), CONSTRAINT TRUCK_WEIGHT CHECK ( WEIGHT >0.0 AND WEIGHT >0.0 AND CAPACITY

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!