Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please answer all parts QUESTION 5 (10 marks) Write SELECT statements that implement the following queries. (1) (2) (3) (4) Find the first and the

please answer all parts image text in transcribed
image text in transcribed
QUESTION 5 (10 marks) Write SELECT statements that implement the following queries. (1) (2) (3) (4) 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) (5) LISTED BELOW NULL, CREATE TABLE STAFF ENUM DECIMAL (12) NOT NULL / Staft employee number FNAME VARCHAR(50) NOT NULL, 1. First se LNAME VARCHAR(50) NOT NULLA / Last name DOR DATE Date of birth CONSTRAINT STAFF_PKEY PRIMARY KEY (EUR): CREATE TABLE DRIVER ENUM DECIMAL (12) NOT NULL, Statt ployee 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 FREY FOREIGN KEY CENTIM) REFERENCES STAFF LEBUH). CONSTRAINT DRIVER STATUS CHECK STATUS IN "AVAILABLE IN SERVICE", "ON LEAVE"> CREATE TABLE TRUCK REGNUM VARCHAR(10) NOT NULL, Registration number CAPACITY DECIMAL (7) NOT NULL Capacity WEIGHT DECIMAL (7) NOT NULL Weight STATUS VARCHAR(10) NOT NULL Present states CONSTRAINT TRUCK PKEY PRIMARY KEY (REGNUM), CONSTRAINT TRICK_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_2

Step: 3

blur-text-image_3

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

a. How are members selected to join the team?

Answered: 1 week ago

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago