1. Importing data and setting data types
Import data from an existing file, such as a .csv or .txt file, as a new table. Use the field names the question gives, exactly as written, and import only the fields it asks for.
Set the data type given for each field: text, numeric (integer, decimal or currency), date/time or Boolean/logical.
A telephone number is stored as text (alphanumeric), because no calculation will be performed on it. Do not add an ID field the question did not ask for.
Examiner insight
Worked example 15 marks
Using database software, import the file j2621models.csv as a new table. Use these field names and data types. Set Model_Code as the primary key.
Import the file j2621manufacturers.csv as a new table in your database. Use these field names and data types: Manufacturer_Name, Text; Manufacturer_ID, Text; Country_Of_Origin, Text; Incorporated, Number, stored as Integer; Annual_Revenue, Number/Currency; Employees, Number, stored as Integer. Set Manufacturer_ID as the primary key.
| Field name | Data type | Store | Display |
|---|---|---|---|
| Model_Name | Text | ||
| Manufacturer_Code | Text | ||
| Cash_Price | Number/Currency | Decimal | Currency symbol with 0 decimal places |
| Model_Code | Text | ||
| Charge_Time | Number | Integer | Integer |
| Estimated_Range | Number | Integer | Integer |
| Power | Number | Integer | Integer |
| Launch_Year | Number | Integer | Integer |
| SUV | Boolean/Logical | Yes/No | |
| Gov_Subsidy | Number | Percentage symbol with 1 decimal place |
- 1
models table: all 10 field names and data types as given [1]
- 2
manufacturers table: all 6 field names and data types as given [1]
- 3
primary keys set: Model_Code (models), Manufacturer_ID (manufacturers) [1]
- 4
Cash_Price displays the currency symbol with 0 decimal places [1]
- 5
SUV displays Yes/No; Gov_Subsidy displays % to 1 decimal place [1]