NEED ANSWER FOR QUESTION 6 ASAP
page 2:
QUESTION 5 (10 marks) Write SELECT statements that implement the following queries. (1) (2) (3) Find the first and the last names of all drivers who are not on leave. (1 mark) Find the registration numbers of all trucks that have not been used so far. (1 mark) Find the registration numbers of all trucks that have been used more than 50 times. (1 mark) Find the distinct names of all cities visited during the trip number 30 or the trip number 33. Note that a city is visited if it is either a departure city or a destination city of any leg included within a trip. (1 mark) Find the registration numbers of all trucks that have been used by both drivers with a driving licence number 311607 and with a driving license number 901107 (1 mark) Data security is an important consideration when operating a database system, consider the database as outlined on page 2, as the Database Administrator what security considerations would you address. How would you address these issues to reduce the chance of the problem occurring? What would you do if the problem occurs? Provide an original example to illustrate your answer. (5 marks) (5) (6) Submit your answer as the files question5.sql and question5.pdf using the templates provided. Add your name, student number and the date to the comments section of your SQL script. 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 will receive no marks. CREATE TABLE STAFF ENUM DECIMAL (12) NOT NULL, /* Staft employee number ENAME VARCHAR (50) NOT NULL, First name LNAME VARCHAR (50) NOT NULL, Last name DOR DATE NULL, Date of birth CONSTRAINT STAFF_PKEY PRIMARY KEY (ENUM)); CREATE TABLE DRIVER ( ENUM DECIMAL (12) NOT NULL, Staff employee number LNUM DECIMAL (8) NOT NULL, Driving license number STATUS VARCHAR(10) NOT NULL Driver status CONSTRAINT DRIVER_PKEY PRIMARY KEY (ENUM), CONSTRAINT DRIVER UNIQUE UNIQUE (LNUM). CONSTRAINT DRIVER FKEY FOREIGN KEY CENUM REFERENCES STAFF (ENUM), CONSTRAINT DRIVER STATUS CHECK STATUS IN AVAILABLE", "IN SERVICES, ON LEAVE'>> ): CREATE TABLE TRUCK REGNUM VARCHAR(10) NOT NULL, Registration number CAPACITY DECIMAL (7) NOT NULL, 1. Capacity WEIGHT DECIMAL (7) NOT NULL, Weight STATUS VARCHAR(10) NOT NULL, 1. Present status 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