0% found this document useful (0 votes)
13 views6 pages

Tafadzwa Test

The document contains instructions for creating databases and tables to store customer, software, employee, driving school, and supermarket data. Tables are created to store information like customer details, software licenses, employee details, vehicle and instructor details, student details, and customer details. Queries are written to select and insert data into the tables.

Uploaded by

Tafadzwa Mangezi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views6 pages

Tafadzwa Test

The document contains instructions for creating databases and tables to store customer, software, employee, driving school, and supermarket data. Tables are created to store information like customer details, software licenses, employee details, vehicle and instructor details, student details, and customer details. Queries are written to select and insert data into the tables.

Uploaded by

Tafadzwa Mangezi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

TAFADZWA MANGEZI UPPER 6 COMMERCIAL

CREATE DATABASE SOFTWARE

CREATE TABLE CUSTOMER(

CustomerID character (10), PRIMARY KEY

CompanyName varchar (20),

CREATE TABLE SOFTWARE(

SoftwareID character (15), PRIMARY KEY

SoftwareName character (20),

OperatingSystem varchar (20),

Description varchar (25),

CREATE TABLE LICENCE (

LicenceID character (15),PRIMARY KEY

CustomerID character (15),

SoftwareID character

DateOfPurchase character (10),

LicenceType character (10),

Cost character (10),

ExpiryDate character (10) );

SELECT CustomerID , SoftwareID , Licence Type, Cost , ExpiryDate

FROM LICENCE

Where

ExpireDate>=31/12/2019
TAFADZWA MANGEZI UPPER 6 COMMERCIAL

2]

CREATE DATABASE EMPLOYEES

CREATE TABLE EMPLOYEE_DATA(

EmployeeID character (15)PRIMARY KEY ,

FirstName varchar (15),

LastName varchar (15),

DateOfBirth character (10),

Gender varchar (5),

DepartmentNumber integer (10),

CREATE TABLE DEPARTMENT(

DepartmentNumber integer (10) ,

DepartmentName varchar (15) PRIMARYKEY,

CREATE TABLE DEPARTMENT_MANAGER(

DepartmentNumber integer (10)

EmployeeID character (15),

Role varchar (15) );

(156FJEK , ‘Harvey’ , ‘Kim’ , 12/05/1984 , ‘Male’ , S1)

(558RRKL , ‘Catriona’ , ‘Moore’ , 03/03/1978 , ‘Female’, F1)

(388LMDV, ‘Oscar’ , ‘Ciao’ , 01/01/1987, ‘Male’ , f2)

SELECT Firstname , Lastname

FROM EMPLOYEE_DATA

WHERE EMPLOYEES= MALE AND DateOfBirth =<1985


TAFADZWA MANGEZI UPPER 6 COMMERCIAL

3i]

CREATE DATABASE DRIVING_SCHOOL

CREATE TABLE CAR (

Registration character (15) PRIMARY KEY,

Make varchar (15),

Model character (15),

EngineSize varchar (10),

CREATE TABLE INSTRUCTOR_CAR (

InstructorID character (15) PRIMARY KEY ,

Registration character (10),

CREATE TABLE STUDENT(

StudentID character (15) PRIMARY KEY,

FirstName varchar (15),

LastName varchar (15),

DateOfBirth character (10),

Address1 character (15)

CREATE TABLE LESSON(

LessonID integer (10) PRIMARY KEY,

StudentID character (10),

InstructorID character (10),

LessonDate character (10),

LessonTime character (10) );

Ii] INSERT INTO INSTRUCTOR

VALUES ( Ins01, ‘Jayden’ , ‘Han’, 05/06/1974, 1),

(Ins02, ‘Freda’ , ‘Choi’, 06/02/1978, 2),

( Ins03, ‘Kelly’, ‘Kim’, 01/12/1966, 1),

(Ins04, ‘Santana’, ‘Thompson’, 09/09/1985/3);


TAFADZWA MANGEZI UPPER 6 COMMERCIAL

Iii] SELECT *

FROM INSTRUCTOR

Iv] SELECT InstructorID, FirstName

FROM INSTRUCTOR

WHERE DateOfBirth> 1970

V] SELECT* Level1

FROM INSTRUCTORS.

B]INSERT INTO STUDENT

Field (Telephone number character (10))


TAFADZWA MANGEZI UPPER 6 COMMERCIAL

4] CREATE DATABASE SUPERMARKET

CREATE TABLE CUSTOMER(

CustNumb integer (5) PRIMARY KEY,

CustName varchar (10),

City varchar (10),

Country varchar (15);

B] INSERT INTO CUSTOMER

Values (190, ‘ Peter’, ‘ Gaborone’ , ‘Botswana’),

(198, ‘Rachel’, ‘Gweru’, ‘Zimbabwe’),

( 201, ‘Romeo’, ‘Bulawayo’, ‘Zimbabwe’),

(207, ‘Lisalin’, ‘Capetown’,’South Africa’);

C]SELECT*

FROM
CUSTOMERS
where character=a%

D] SELECT CustName

FROM CUSTOMER

WHERE COUNTRY= NOT Zimbabwe


TAFADZWA MANGEZI UPPER 6 COMMERCIAL

You might also like