Computer Science for IGCSE & O level - Databases (Section 5)

1
What is the purpose of the 'SUM' function in SQL?
Answer
(D)
To calculate the sum of values in a column.
2
Which of the following statements are true about a primary key?
Answer
A
C
D
3
What is the purpose of an `INSERT` statement in SQL?
Answer
(C)
To add new data to a table.
4
What is the main benefit of using a stored procedure in a database?
Answer
(D)
All of the above.
5
Which of the following clauses are often used with the `JOIN` clause?
Answer
A
B
D
6
Which of the following is a valid example of data validation?
Answer
A
C
7
What is the purpose of a `JOIN` operation in SQL?
Answer
(B)
To combine rows from two or more tables based on a related column.
8
What is the purpose of using indexes in a database?
Answer
(B)
To speed up data retrieval by creating a quick lookup path.
9
What does the term 'attribute' refer to in a database context?
Answer
(C)
A field.
10
What is the role of the `NOT NULL` constraint in a database?
Answer
(B)
Ensures that a column cannot have a null value.
11
What type of relationships between tables can exist in a relational database?
Answer
A
B
C
D
12
In SQL, what does the term 'NULL' represent?
Answer
(C)
A missing or unknown value.
13
What is the main purpose of the ORDER BY clause in an SQL query?
Answer
(B)
To sort the results of a query.
14
Which of the following is NOT a basic data type commonly used in databases?
Answer
(D)
Image
15
In an SQL query, what does the `DISTINCT` keyword do?
Answer
(B)
Returns only unique values in a column.
16
What is the function of the `HAVING` clause in an SQL query?
Answer
(A)
To filter the results after the `GROUP BY` clause has been applied.
17
What is the purpose of a 'constraint' in a database?
Answer
(B)
To enforce rules and restrictions on data.
18
What is the benefit of using a database management system (DBMS) for data storage?
Answer
(C)
DBMS makes data management easier and more efficient.
19
What does the `ON DELETE CASCADE` constraint do in a foreign key relationship?
Answer
(B)
Automatically deletes related child records when a parent record is deleted.
20
What is a primary function of data validation within a database system?
Answer
(B)
To ensure data integrity and accuracy.
21
What does the acronym SQL stand for?
Answer
(A)
Structured Query Language
22
Which of the following is NOT a component of the ACID properties of transactions?
Answer
(C)
Indexing
23
Which of the following would be considered a benefit of using SQL?
Answer
A
B
C
D
24
Which of the following is NOT a key benefit of using a database?
Answer
(C)
Data redundancy
25
What is the purpose of data normalization in database design?
Answer
A
B
26
What does the acronym DBMS stand for?
Answer
(C)
Data Base Management System
27
What is the primary goal of data normalization?
Answer
(B)
To reduce data redundancy and improve data integrity.
28
In database design, what does the term 'relationship' refer to?
Answer
(B)
How tables are connected and related to each other.
29
What is the purpose of the `COMMIT` statement in a database transaction?
Answer
(B)
To end a transaction and save the changes.
30
Which SQL keyword is used to rename a column or table?
Answer
(C)
RENAME
31
Which SQL clause is used to specify the table(s) from which you want to retrieve data?
Answer
(C)
FROM
32
What is the purpose of the 'COUNT' function in SQL?
Answer
(B)
To count the number of rows.
33
Which SQL clause is used to filter data based on a specific condition?
Answer
(C)
WHERE
34
In database validation, what is the purpose of a 'presence check'?
Answer
(B)
To verify that a field contains a value.
35
What are the advantages of using indexes in a database?
Answer
(A)
Faster data retrieval.
36
What is the main function of the `ORDER BY` clause?
Answer
(B)
To sort the data in the result set.
37
What is the primary benefit of storing data in a database compared to storing it in simple files?
Answer
(C)
Databases provide better data organization and prevent redundancy.
38
Which SQL command removes one or more row(s) from the database?
Answer
(D)
DELETE
39
What does the 'ORDER BY' clause in SQL do?
Answer
(B)
Sorts the results.
40
Which data type would you typically use to store a person's name?
Answer
(B)
TEXT or VARCHAR
41
Which of the following are common actions performed in database design?
Answer
A
B
C
42
What is the purpose of the 'FROM' clause in an SQL query?
Answer
(B)
To specify the table(s) to retrieve data from.
43
Which of the following is an example of Data Manipulation Language (DML) command?
Answer
(C)
SELECT
44
What is a disadvantage of data redundancy?
Answer
A
B
45
What does the term 'relational database' refer to?
Answer
(B)
A database that stores data in tables with rows and columns and uses relationships between tables.
46
What does the acronym DBMS stand for?
Answer
(A)
Data Base Management System
47
What are the two main parts of a database?
Answer
(B)
Data and metadata
48
What are some of the common data types in SQL?
Answer
A
C
D
49
In a database table, a 'field' is also known as:
Answer
(C)
an attribute
50
What is a foreign key?
Answer
(C)
A field in a table that references the primary key of another table.