9 A company uses a relational database.
(a) The company stores data about its customers and their bank details.
Explain the ways in which the database can be set up to only allow certain people to see the
bank details.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) The database contains the following tables that store data about suppliers and stock.
SUPPLIER(SupId, SupName, SupAddress, SupPhone, SupContactName)
STOCK(StockId, SupId, StockName, StockImage, NumberInStock)
(i) Write Data Manipulation Language (DML) statements to return the supplier name, phone
number and contact name, and the number of items in stock for the item with the stock
ID of D930.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(ii) The stock price needs to be included in the stock table.
$10.55 and $299.99 are two examples of stock prices.
Write Data Definition Language (DDL) statements to insert the attribute StockPrice
into the table STOCK.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(c) Three examples of items stored in the data dictionary of a relational database are:
Item Purpose
Field name to store the names of fields so they cannot be repeated in a table
Primary key to uniquely identify each record in a table
Validation rule to ensure that data entered is sensible
Identify three other examples of items stored in a data dictionary and give the purpose of
each.
Item 1 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Item 2 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Item 3 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[6]
11
(d) Draw one line from each database term to its matching description.
Database term Description
An attribute that could be a primary key
but is not selected to be a primary key
Logical schema
An attribute in one table that is a primary
key in another table
Referential integrity
The overview of a database structure
Query processor
An attribute or set of attributes that
uniquely identifies each tuple
Primary key
Data between linked tables is consistent
Secondary key
Changing data to see what would
happen in different scenarios
The part of the DBMS that allows a user
to search for data
[5]