Font size
WorksheetsKS5 Databases mmd
Total questions: 101
Worksheet time: 47mins
A database is...
a structured system for holding records
a spreadsheet of information
reliant on good design, as poor structure can cause many problems
simple and easy to create
An entity is...
A thing, about which data is stored in the database such as Student
A property such as Name or Age
An attribute is...
A thing, about which data is stored in the database such as Student
A property such as Name or Age
Entity relationships can be:
One-to-One
Many-to-Many
Many-to-One
One-to-Many
In a hospital system, the relationship between a consultant to a patient would be:
One-to-One
One-to-Many
Many-to-Many
Many-to-One
In a hospital system, the relationship between a nurse to a ward would be:
One-to-One
One-to-Many
Many-to-Many
Many-to-One
In a hospital system, the relationship between a patient to a surgeon would be:
One-to-One
One-to-Many
Many-to-Many
Many-to-One
In a hospital system, the relationship between a consultant to a student would be:
One-to-One
One-to-Many
Many-to-Many
Many-to-One
In a school system, the relationship between a teacher to a pupil would be:
One-to-One
One-to-Many
Many-to-Many
Many-to-One
In a school system, the relationship between a teacher to a department would be:
One-to-One
One-to-Many
Many-to-Many
Many-to-One
A primary key is...
A unique identifier for each record
An identifier which can be shared between multiple records
The first number in the record
A way of looking up data in related tables
A foreign key is...
A unique identifier which links a record to a related record in another table
A unique identifier for each record in a table
A shared identifier for all records in one table
What is the primary key?
Sales ID
Item ID
Item Name
Address
Payment Complete?
Which field is likely to be a foreign key?
Sales ID
Item ID
Item Name
Address
Payment Complete?
What will be returned by the SQL query:
SELECT * FROM Sales WHERE Sales ID = "00113"
00112 1151213215 Keyring 123 Example Ln 1
00112 65465654688 Pencil 123 Example Ln 1
00112 87954121321 Bag 123 Example Ln 1
00113 65465654688 Pencil 77 Bay St 0
00114 65465654688 Pencil 999 Letsbey Ave 1
Which of the following SQL statements will return the Sales ID of all sales which involve a pencil?
SELECT * FROM Sales WHERE Item Name = "Pencil"
SELECT * FROM Sales WHERE Item Name = Pencil
SELECT Sales ID FROM Sales WHERE Item Name = "Pencil"
SELECT Sales ID FROM Sales WHERE Item Name = Pencil
SELECT "Sales ID" FROM Sales WHERE Item Name = "Pencil"
Which of the following SQL statements will return the address of anyone who has ordered a pencil and has paid.
SELECT Address FROM Sales WHERE Item Name = "Pencil" and Payment Complete? = TRUE
SELECT Address FROM Sales WHERE Item Name = "Pencil" and Payment Complete? = "TRUE"
SELECT Address FROM Sales WHERE Item Name = Pencil and Payment Complete? = TRUE
SELECT Address FROM Sales WHERE Item Name = "Pencil" or Payment Complete? = TRUE
SELECT Address FROM Sales WHERE "Item Name" = "Pencil" and "Payment Complete?" = TRUE
Is this table in first normal form?
Yes
No
Don't Know
Is this table in first normal form?
Yes
No
Don't Know
Is this table in second normal form?
Yes
No
Don't Know
Is this table in second normal form?
Yes
No
Don't Know
Is this table in third normal form?
Yes
No
Don't Know
Select the things which are true for a database in 1NF:
Each entity has a unique identifier
Each attribute is atomic (divided as small as possible)
Each attribute has a single value
There is no repetition
There are no transitive relationships
Select the things which are true for a database in 2NF:
The database is in 1NF
All attributes depend on the primary key
There is no dependence
There is no repetition
There are no transitive relationships
Select the things which are true for a database in 3NF:
The database is in 2NF
There are at least 4 tables in the database
There is no dependence
All attributes have a separate table
There are no transitive relationships
What normal form is this table in?
1NF
2NF
3NF
What normal form is this table in?
1NF
2NF
3NF
What normal form is this table in?
1NF
2NF
3NF
An entity is represented by what in a database?
Table
Row
Column
Cell
A record is represented by what in a database?
Table
Row
Column
Cell
An attribute is represented by what in a database?
Table
Row
Column
Cell
Which of these are required for a relational database to meet 1st normal form?
Data must be atomic
No repeating groups of data
No repeating attributes
Sets of data must have a unique identifier
Must meet 2nd normal form
Which of these are required for a relational database to meet 2nd normal form?
Must meet 1st normal form
All the non-key attributes must depend on the whole primary key
All the non-key attributes must not depend on another non-key attribute
Must meet 3rd normal form
Which of these are required for a relational database to meet 3rd normal form?
Must meet 2nd normal form
All the non-key attributes must depend on another non-key attribute
All the non-key attributes must not depend on another non-key attribute
Must meet 4th normal form
What is the purpose of normalisation?
Eliminate redundant data
Reduce data inconsistencies
Produce redundant data
Increase data inconsistencies
Which type of relationship does the ERD represent?
One-to-many
Many-to-many
One-to-one
Which type of relationship does the ERD represent?
One-to-many
Many-to-many
One-to-one
In a RDBMS such as MS Access, which type of relationship is required to create relationships between entities?
One-to-many
Many-to-many
One-to-one
Which keys are required to create relationships between entities?
Primary key and foreign key
Primary key and secondary key
Foreign key and domestic key
Secondary key and foreign key
What is a foreign key?
Uniquely identifies the records in a table
An attribute that is a primary key in another table
A record that meets 3rd normal form
A primary key made up from two or more attributes
What is a composite primary key?
A primary key that can be duplicated in the same table
An attribute that is a primary key in another table
A foreign key that is a primary key in more than one other table
A primary key made up from two or more attributes
Data type used for telephone numbers
Text
Number
Date/Time
Yes/No
Currency
Data type used for age
Text
Number
Date/Time
Yes/No
Currency
What is used if a postcode needs to have particular format, such as LL09 0LL?
Input mask
Range check
Value lookup
Presence check
In an input mask, what does the character 'A' represent?
User must enter a letter or a digit
User can enter a letter or a digit
User must enter a letter
User can enter a digit, space, plus or minus sign
In an input mask, what does the character '0' represent?
User must enter a digit (0 to 9)
User can enter a digit (0 to 9)
User must enter either a character or a space
User can enter a letter or a digit
Validation rule to ensure data must be entered into that field...
Is Not Null
Is Complete
Is Not Empty
Is Not Nothing
Can be used to create one-to-many relationships between tables...
Table lookup
Value lookup
Input mask
Presence check
Data redundancy is..
when data is repeated unnecessarily
the accuracy and consistency of data
The amount of data stored by organisations
The speed at which data can be processed
Which of these is not a relationship type
One-to-One
One-to-Many
One-to-Two
Many-to-Many
Which of these are required for a relational database to meet 1st normal form?
Data must be atomic
No repeating groups of data
No repeating attributes
Sets of data must have a unique identifier
Must meet 2nd normal form
Which of these are required for a relational database to meet 2nd normal form?
Must meet 1st normal form
All the non-key attributes must depend on the whole primary key
All the non-key attributes must not depend on another non-key attribute
Must meet 3rd normal form
Which of these are required for a relational database to meet 3rd normal form?
Must meet 2nd normal form
All the non-key attributes must depend on another non-key attribute
All the non-key attributes must not depend on another non-key attribute
Must meet 4th normal form
What is the purpose of normalisation?
Eliminate redundant data
Reduce data inconsistencies
Produce redundant data
Increase data inconsistencies
What is a composite primary key?
A primary key that can be duplicated in the same table
An attribute that is a primary key in another table
A foreign key that is a primary key in more than one other table
A primary key made up from two or more attributes
A simple database consisting of only one entity
Relational Database
ERD
Flat-file database
Table
SELECT *
_______ CUSTOMER;
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
SELECT [all] FROM Persons WHERE FirstName='Peter'
SELECT * FROM Persons WHERE FirstName<>'Peter'
SELECT * FROM Persons WHERE FirstName='Peter'
To remove a record from a table which SQL statement would you use?
Remove
Cancel
Delete
Eradicate
Which statement allows us to add a record to a table?
Add To
Update To
Add Into
Insert Into
