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

Assignment#1-Databases(encrypted)

The document consists of a series of database-related assignments focusing on creating and managing databases for properties, student marks, pictures, and boats. It includes questions about primary keys, data types, validation checks, and query-by-example grids. Each section requires specific answers related to the structure and functionality of the databases discussed.

Uploaded by

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

Assignment#1-Databases(encrypted)

The document consists of a series of database-related assignments focusing on creating and managing databases for properties, student marks, pictures, and boats. It includes questions about primary keys, data types, validation checks, and query-by-example grids. Each section requires specific answers related to the structure and functionality of the databases discussed.

Uploaded by

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

Assignment #1 - Databases

Q1. A database, PROPERTY, was set up to show the prices of properties for sale
and the features of each property. Part of the database is shown below.

NISAR
(a) Give the number of fields that are in each record.
...................................................................................................................................[1]

(b) State which field you would choose for the primary key.
........................................................................................................................................

SAMREEN
Give a reason for choosing this field.
........................................................................................................................................
....................................................................................................................................[2]

(c) State the data type you would choose for each of the following fields.
Garage ...........................................................................................................................
Number of Bedrooms ..................................................................................................
Price in $ ...................................................................................................................[3]
1 Page

[[email protected]] [Computer Science – 2210] [0333-2262955]


(d) The query-by-example grid below selects all houses with more than 1 bathroom
and more than 2 bedrooms.

Show what would be output.

NISAR
........................................................................................................................................
....................................................................................................................................[2]

(e) Complete the query-by-example grid below to select and show the brochure
number, property type and price of all properties with a garage below $200,000. [4]

SAMREEN
2 Page

[[email protected]] [Computer Science – 2210] [0333-2262955]


Q2. A database, MARKS, was set up to record the test results for a class of students.
Part of the database is shown below.

NISAR
(a) Give the number of fields that are in each record.
...................................................................................................................................[1]

(b) State which field you would choose for the primary key.
........................................................................................................................................

SAMREEN
Give a reason for choosing this field.
........................................................................................................................................
....................................................................................................................................[2]
3 Page

[[email protected]] [Computer Science – 2210] [0333-2262955]


(c) The query-by-example grid below selects all students with more than 60 marks in
History or more than 60 marks in Geography.

Show what would be output.


........................................................................................................................................

NISAR
........................................................................................................................................
....................................................................................................................................[2]

(d) Complete the query-by-example grid below to select and show the student names
only of all students with less than 40 marks in both Maths and English. [3]

SAMREEN
4 Page

[[email protected]] [Computer Science – 2210] [0333-2262955]


Q3. A picture gallery owner has decided to set up a database to keep information
about the pictures he has for sale. The database table, PICTURE, will contain the
following fields:
Title; Artist; Description; Catalogue Number; Size (area in square centimetres);
Price; Arrived (date picture arrived at gallery); Sold (whether picture is already sold)
(a) (i) State what data type you would choose for each field.
Title ...............................................................................................................................
Artist...............................................................................................................................
Description ....................................................................................................................
Catalogue Number ........................................................................................................
Size ................................................................................................................................
Price ..............................................................................................................................
Arrived ..........................................................................................................................
Sold ...........................................................................................................................[4]

(ii) State which field you would choose for the primary key.
....................................................................................................................................[1]

NISAR
(b) Give a validation check that you can perform on each of these fields. Each
validation check must be different.
Catalogue Number ........................................................................................................
Size ................................................................................................................................
Price ..............................................................................................................................
Arrived ......................................................................................................................[4]

SAMREEN
(c) Complete the query-by-example grid below to select and show the Catalogue
Number, Title and Price of all unsold pictures by the artist ‘Twister’. [5]

5 Page

[[email protected]] [Computer Science – 2210] [0333-2262955]


Q4. A motor boat hire company decides to set up a database to keep information
about boats that are available for hire. The database table, BOAT, will contain the
following fields:
Boat Name; Model; Engine Power (in hp); Number of Seats; Life Raft (whether
there is a life raft kept on the boat); Day Price (price for a day’s hire).

(a) Give the data type you would choose for each field.
Boat Name ....................................................................................................................
Model ............................................................................................................................
Engine Power ................................................................................................................
Number of Seats ...........................................................................................................
Life Raft ........................................................................................................................
Day Price ..................................................................................................................[3]

(b) State a validation check that you can perform on each of these fields. Each
validation check must be different.

NISAR
Boat Name ....................................................................................................................
Model ............................................................................................................................
Number of Seats ...........................................................................................................
Day Price ..................................................................................................................[4]

(c) Complete the query-by-example grid below to select and show the Boat Name,
Model and Day Price of a day’s hire for all boats with 4 seats and an Engine Power

SAMREEN
of more than 100 hp.

6 Page

[[email protected]] [Computer Science – 2210] [0333-2262955]

You might also like