WorksheetsUnderstanding Databases and SQL Concepts
Total questions: 20
Worksheet time: 10mins
Which of the following best describes a relational database?
A database that stores all data in a single table
A database that organises data into multiple related tables
A database that stores data in a hierarchical structure
A database that stores data as plain text files
What is a primary key in a database table?
A field that can have duplicate values
A field that uniquely identifies each record in a table
A field used to link two tables together
A field that stores secondary information
Which of the following is an advantage of using a flat file database?
It is easy to set up and manage for small amounts of data
It supports complex relationships between data
It prevents data redundancy automatically
It is highly scalable for large organisations
What is the main purpose of a foreign key in a relational database?
To uniquely identify records within its own table
To enforce referential integrity between tables
To store secondary information
To speed up search queries
Which of the following best describes an entity in entity relationship modelling?
A single value in a table
A real-world object or concept represented in the database
A relationship between two tables
A type of SQL query
Which of the following wildcards is used in SQL with the LIKE command to represent any sequence of characters?
?
%
#
$
Which SQL statement is used to retrieve all records from a table called "Students"?
SELECT * FROM Students;
GET ALL FROM Students;
RETRIEVE * FROM Students;
SHOW ALL FROM Students;
What is a secondary key in a database?
A key that is always unique
A key used for searching and sorting, but not necessarily unique
A key that links two tables together
A key that is never indexed
Which of the following is NOT a feature of a relational database?
Data is stored in tables
Tables can be related using keys
Data is stored in a single, unstructured file
Supports SQL queries
What does SQL stand for?
Structured Query Language
Simple Query Language
Sequential Query Language
Standard Question Language
Which of the following best describes a flat file database?
A database with multiple related tables
A database that stores all data in a single table or file
A database that uses hierarchical relationships
A database that uses object-oriented structures
Which SQL command is used to add a new record to a table?
INSERT INTO
ADD RECORD
NEW ENTRY
APPEND TO
What is the main disadvantage of using a flat file database for large datasets?
It is difficult to set up
It can lead to data redundancy and inconsistency
It supports complex queries
It is highly secure
Which of the following is an example of a primary key?
Student's surname
Student ID number
Student's date of birth
Student's address
Which SQL clause is used to search for a specified pattern in a column?
LIKE
BETWEEN
IN
EXISTS
Which SQL clause is used to filter records based on a specified condition?
WHERE
ORDER BY
GROUP BY
HAVING
What is referential integrity in the context of relational databases?
Ensuring that all data is encrypted
Ensuring that foreign keys in one table correspond to primary keys in another
Ensuring that all tables have the same number of records
Ensuring that all queries are optimised
Which SQL statement would you use to remove all records from a table called "Orders"?
DELETE FROM Orders;
REMOVE ALL FROM Orders;
ERASE Orders;
DROP Orders;
What is the main purpose of an entity relationship diagram (ERD)?
To show the physical layout of a database server
To visually represent the relationships between entities in a database
To display the results of SQL queries
To list all the data types used in a database
Which of the following SQL statements will return only the "Name" and "Age" columns from a table called "People"?
SELECT Name, Age FROM People;
GET Name, Age FROM People;
SHOW Name, Age FROM People;
RETRIEVE Name, Age FROM People;
