Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

Students also viewed these Databases questions

Question

design a simple disciplinary and grievance procedure.

Answered: 1 week ago