0% found this document useful (0 votes)
57 views

Homework 4: Defining A Database Table: Unit 8 System Design and Databases

The document defines a database table for a newsagent with the following fields: PaperID, NewspaperName, Price, Frequency, and SundayDelivery. It suggests data types for each field and identifies PaperID as the primary key field since each record must have a unique value. It also provides two validation rules - a format check for PaperID and a presence check for NewspaperName.

Uploaded by

dgergeger
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)
57 views

Homework 4: Defining A Database Table: Unit 8 System Design and Databases

The document defines a database table for a newsagent with the following fields: PaperID, NewspaperName, Price, Frequency, and SundayDelivery. It suggests data types for each field and identifies PaperID as the primary key field since each record must have a unique value. It also provides two validation rules - a format check for PaperID and a presence check for NewspaperName.

Uploaded by

dgergeger
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/ 1

Homework 4 Defining a database table

Unit 8 System design and databases

Homework 4: Defining a database table


1. A database table for a newsagent has the following fields:

Field name Data type Comment


Text but might be What’s the
PaperID number(depending on whats in the number/barcode of this
id) newspaper?
Is it the Sun, The Times?
NewspaperName Text What newspaper
company is it from?
How many pounds is it?
Price Number/Real
Is it below a pound?
Frequency Number/Integer Daily, weekly or monthly
SundayDelivery Text Is it a Sunday paper?

2. (a) Suggest an appropriate data type for each of the fields. [5]
(b) (i) Which field would you suggest should be the Primary Key field?
PaperID
(b) (ii) What is special about a primary key field? [2]
Each record in this field must have a different value so it uniquely identifies all
items in this field

Suggest two different validation rules that could be applied to fields in this database. [2]

Field name: Validation type:


Validation 1:
PaperID Format Check
Validation rule:
All values must be confined to a particular format, whether they are all the same length,
or whether they have groups of 4 numbers like 1923-2314-3465-7832

Field name: Validation type:


Validation 2:
NewspaperName Presence Check
Validation rule:
There must be data present here

[Total 10 marks]

You might also like