Sei sulla pagina 1di 10

Database Management Worksheet

Question# 1 Theory Questions

1|Page
Database Management Worksheet

2|Page
Database Management Worksheet

Question#2

3|Page
Database Management Worksheet

4|Page
Database Management Worksheet

Question# 3

A database contains data on motor vehicle accidents involving the driver, passenger, pedestrian, cyclist
or other factors in recent years. He wants to extract some information based on the following tables:

Table: CATEGORY

Type Name
DR Driver
PA Passenger
PE Pedestrian
CY Cyclist
OT Other

Table: ACCIDENTS

ACCNO CNAME Type Hospitalized INSURANCE


101 Jones, A. DR Y BIC
121 James, P. DR Y MITUAL
124 Hunte, E. DR N SEGIDOR
127 Gill, A. PA Y MITUAL
131 Maughan, F. DR N SEGIDOR
135 Jack, R. PE N BIC
139 Smith, A. CY N BIC
143 Brooks, K. CY Y SEGIDOR
152 Lashley, M. DR N MITUAL
157 Dash, G. PA Y MITUAL
(a) State the most appropriate data type for the Hospitalized field (1 mark)

(b) State the name of a primary key in the ACCIDENTS (1 mark)

(c) State the fields in EACH Table that would be used to link the two tables (2 marks)

(c) Write queries to produce:


(i) all drivers who were hospitalized (2 marks)

(ii) all cyclists who were not insured with BIC (2 marks)

5|Page
Database Management Worksheet

Question# 4

6|Page
Database Management Worksheet

7|Page
Database Management Worksheet

Question# 5

Consider the following database which contains TWO tables that store data on examinations held at a
school.

TABLE 1: SUBJECT

SubjectID SubjectName Cost

25 Biology $45.00

45 English A $40.00

86 Mathematics $40.00

91 IT $55.00

TABLE 2: SCHEDULE

SubjectID Paper Time Location Time in(hours)

25 1 Morning Hall 1

25 2 Afternoon Lab 2

91 1 Afternoon Room 1 1

91 2 Morning Library 2

86 1 Morning Hall 1

2(a) State the number of records in the SUBJECT table above.

(b) Identify the primary key in the SCHEDULE table.

(c) State the data type of EACH field in the SUBJECT table.

(d) Write a query to list all the papers that occur in the Morning and were held in the Hall.

(e) How many fields are in the SCHEDULE table and name them?

(f) List two properties of a field.

Question # 6
A beverage manufacturer uses a database that contains two tables to store information on customers.

8|Page
Database Management Worksheet

TABLE 1: CATEGORY
Type Name
D Distributor
W Wholesaler
R Retailer

TABLE 2: CUSTOMER
CNO CNAME TYPE OUTLETS YTD SALES
D100 Bish and Sons D 5 300,000.00
R100 Saywack R 1 25,000.00
W100 Corbin W 2 75,000.00
D200 Hamilton D 3 100,000.00
W200 Singh W 3 65,000.00
R200 Mohan R 2 50,000.00
W300 Peter W 2 30,000.00

(a) List TWO properties of a field.


(b) Explain how you would delete a field from a table.
(c) Give the name of the primary key in the CUSTOMER table.
(d) Write a query to find ALL distributors with YTD SALES greater than 50,000.00.

Question# 7

The Traffic Department is concerned about reckless driving by drivers of public transportation
vehicles using a particular route. On a daily basis, the traffic development would like to store
information on the Registration Number of the Vehicle, the type of Vehicle (Bus, Mini-Bus, and Hired
Car), the driver of the vehicle and the number of tickets issued to the driver. You have been asked to
create a database table named TICKET to store.
(a) Create the structure of the table TICKET. Your structure should indicate the name, data type and
size for EACH field in your table.
(b) State ONE reason for using a form to input data into your table.
(c) Give ONE example of a record in the TICKET table.
(d) Suppose you now need to store the sex of the driver, what would you do to accomplish this task,
assuming that your table has records already
(e) Write a query to show ALL female drivers of Hired Cars.
(f) How would you print the data in table for the date, 24/12/06?

Question#8

9|Page
Database Management Worksheet

The Office of Investment uses a database named FOREIGN with two tables shown below to store
data on foreign companies operating in the company:

Table 1: COMPANY

CID NAME SECTOR Ccode EMPLOYEES


A200 BJ Petroleum CA 75
M200 CMX Mining RU 120
M100 FEDCO Electricity US 190
A100 TPL Agriculture TT 230
T100 ATM Telecommunications US 550

Table 2: COUNTRY

Ccode Cname
US United State of America
CA Canada
TT Trinidad and Tobago
RU Russia

(a) State the data type of the Sector and Employees fields of the COMPANY table.
(b) Identify a primary key for the COMPANY table.
(c) The records in the COMPANY table are sorted. Indicate the field name and the order of the sort.
(d) State the name of the field that would be used to join the two tables.
(e) Write a query to find ALL companies with over 200 employees in the Telecommunications sector.

10 | P a g e

Potrebbero piacerti anche