2.3 Databases Flashcards
What are the 5 database datatypes you need to know?
Number: Used for both integers and real numbers
Text: Used for both strings and chars
Date or Date/Time: Used for the date and/or time
Boolean: Yes/No or True/False
Currency: Used for money e.g. $, £
What is a field?
One piece of information about an object e.g. student name (column)
What is a record?
A collection of fields about the same object e.g. one student (row)
What is a table?
A collection of records about the same entity e.g. students
What is a primary key?
A field that uniquely identifies each record. No duplicates e.g. StudentID
What is a database?
A persistent and structured collection of data
How many fields are in the table?
How many records are in the table?
How many fields are in the table? 5
How many records are in the table? 8
Which field is suitable as a primary key and why?
Show Number because it uniquely identifies each show/record
State an appropriate data type for the field PCID
State an appropriate data type for the field Screen Size
State an appropriate data type for the field Price
State an appropriate data type for the field PCID: Text
State an appropriate data type for the field Screen Size: Number
State an appropriate data type for the field Price: Currency
Which field is suitable as a primary key and why?
PCID because it uniquely identifies each stock item/record
State an appropriate data type for the field PCID
State an appropriate data type for the field Screen Size
State an appropriate data type for the field Price
State an appropriate data type for the field PCID: text
State an appropriate data type for the field Screen Size: number
State an appropriate data type for the field Price: currency