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?
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?
5
Which of the following clauses are often used with the `JOIN` clause?
6
Which of the following is a valid example of data validation?
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?
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?
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?
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?
23
Which of the following would be considered a benefit of using SQL?
24
Which of the following is NOT a key benefit of using a database?
25
What is the purpose of data normalization in database design?
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?
31
Which SQL clause is used to specify the table(s) from which you want to retrieve data?
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?
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?
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?
39
What does the 'ORDER BY' clause in SQL do?
40
Which data type would you typically use to store a person's name?
41
Which of the following are common actions performed in database design?
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?
44
What is a disadvantage of data redundancy?
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?
48
What are some of the common data types in SQL?
49
In a database table, a 'field' is also known as:
50
Answer(C)
A field in a table that references the primary key of another table.