ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
10 marks · Data dictionary and validation
The design structure of the database looks like this. Field Name Field Type Field Size Validation Dept ID Number 2 >0 and <11 Dept Name Text 20 Department Manager Text 20 Product Code Text 6 Required Product Type Text 20 Product Name Text 20 Name two types of validation that could be applied to the field Product Code. Validation 1 Validation 2 The supermarket decides to change the name of the “Cleaning Products” department to “Household Products”. Describe a potential problem when changing this data in a flat file database design. A decision is made to modify the design of the database to linked tables with two tables: DEPARTMENT and PRODUCT. Each table will have a primary key. State the purpose of a primary key. Identify a suitable primary key for each table. DEPARTMENT PRODUCT Three new fields Product In Stock, Product Picture and Product Price are to be inserted into the PRODUCT table as shown below. Product Code Product Type Product Name Product in Stock Product Picture Product Price 100356 Toothpaste Dentasparkle True 1·99 204672 Cereal Oatycrunch False 2·45 Name a suitable field type for the following new fields. Product In Stock Product Picture The supermarket decides to replace its current computers. Explain two ways the company should dispose of the “old” computer systems. A supermarket has a flat file database storing information about the 20,000 products it stocks. Part of the database is shown below. Dept ID Dept Name Department Manager Product Code Product Type Product Name 4 Toiletries H Green 100356 Toothpaste Dentasparkle 10 Dry Goods A Ahmed 204672 Cereal Oatycrunch 6 Cleaning Products F McMaster 318410 Shoe Polish Shine 10 Dry Goods A Ahmed 396039 Packet Soup Mug-o-Soup 10 Dry Goods A Ahmed 401284 Biscuits Choco Snaps 4 Toiletries H Green 672936 Shower Gel Clean & Fresh 6 Cleaning Products F McMaster 324221 Wipes GermGo
Presence check Length check/field length Accept ‘restricted choice’ as the database could be set up to only allow entry of one of the 20000 product codes in the database. Not ‘field size’ or ‘required’ as both are given in question. Potential for increased errors due to: • update anomalies • lots of changes being made Answer must be a ‘description’. ‘Update Anomalies’ contains enough information to require no further description. Unique identifier for a row/record in a table. Dept ID Product Code Must be in this order Boolean Graphic/Object/Container Must be in this order One mark for each bullet (max 2) • Removing data from hard drive • Using collection company • Recycle individual components appropriately • Dispose of dangerous elements