Computer Science for IGCSE & O level - Databases (Section 4)
1
In the context of database design, what is the primary purpose of a primary key?
إجابة(B)
To uniquely identify each record in a table.
2
What is the purpose of a primary key in a database table?
إجابة(B)
To uniquely identify each row (record) in the table.
3
What does the SQL command `COUNT(*)` do?
إجابة(B)
Counts the total number of rows in a table.
4
Which of the following are valid types of relationships that can exist between tables in a database?
5
Which SQL statement is used to add a new column to a table?
إجابة(B)
ALTER TABLE ... ADD COLUMN
6
Which of the following is NOT typically a component of a database system?
إجابة(D)
The operating system kernel.
7
Which command is used to remove data from a table?
8
What is the role of fields in the context of databases?
إجابة(C)
To define individual pieces of data within a record.
9
What is a 'join' in SQL used for?
إجابة(A)
To combine data from two or more tables
10
Which keyword is used in SQL to retrieve all columns from a table?
11
Which of the following is an advantage of using a database system?
12
Which are the benefits of using SQL?
13
Which of the following statements is true about indexes in database?
إجابة(B)
Indexes speed up data retrieval.
14
What is the main advantage of using databases?
إجابة(B)
Databases prevent problems because if any changes or additions are made it only has to be done once.
15
What are the characteristics of a primary key?
إجابة(C)
It uniquely identifies each record in a table.
16
Which is used to ensure data consistency?
17
Which of the following is a characteristic of a well-designed database?
إجابة(C)
Efficient data retrieval.
18
Which data type would be used to store true/false values?
19
What is the difference between `TRUNCATE` and `DELETE` statements?
إجابة(A)
TRUNCATE is faster and removes all rows, while DELETE is slower and removes specific rows.
20
What does the acronym SQL stand for?
إجابة(B)
Structured Query Language
21
What is the purpose of the HAVING clause in SQL?
إجابة(A)
To filter rows based on conditions applied to aggregate functions.
22
Which component of an SQL command specifies the table to retrieve data from?
23
In the context of a database, what does 'record' refer to?
24
What is the main purpose of using a database management system (DBMS)?
إجابة(B)
To manage and organize data efficiently.
25
Which SQL statement is used to update data in a table?
26
What is data normalization primarily used for in database design?
إجابة(B)
To reduce data redundancy and improve data integrity.
27
What is a view in a database?
إجابة(B)
A virtual table based on the result-set of an SQL statement.
28
What is the primary purpose of data validation in a database?
إجابة(A)
To ensure data accuracy and consistency.
29
What are the two main components in a database?
30
Which data type would be best suited for storing a unique ID (e.g., customer ID) that is an integer?
31
What does the `COUNT(*)` function typically return in SQL?
إجابة(B)
The number of rows that meet a certain criteria.
32
Which of the following data types is used to store large blocks of text?
33
In the context of a database, what is a 'record'?
إجابة(B)
A single instance of an entity in a table.
34
What is the purpose of an index in a database?
إجابة(B)
To speed up data retrieval.
35
What does the term 'referential integrity' refer to in the context of databases?
إجابة(B)
The consistency of data across related tables.
36
What are the fundamental principles of database normalization aimed at?
إجابة(B)
Reducing data redundancy and improving data integrity.
37
What does the `WHERE` clause in an SQL query typically do?
إجابة(C)
Filters the results based on a condition.
38
What is the purpose of a database trigger?
إجابة(B)
To automatically execute a set of actions in response to a specific event on a table.
39
Which of the following can be a validation rule?
40
Which data type would be most appropriate for storing the ward number of a patient in a hospital database?
41
Which SQL command is used to remove data from a database table?
42
In SQL, what does the `INSERT` statement do?
إجابة(B)
Adds new data into a table.
43
In SQL, what does the FROM clause specify?
إجابة(B)
The table to retrieve data from.
44
Which of the following is a task typically performed by a database administrator (DBA)?
45
What does the `SELECT` statement in SQL typically do?
إجابة(B)
Retrieves data from one or more tables.
46
What is the purpose of an index in a database?
إجابة(B)
To speed up data retrieval.
47
Which SQL command is used to remove a table from a database?
48
What does the `WHERE` clause do in an SQL query?
إجابة(C)
Filters the data based on specified conditions.
49
What is a key characteristic of a primary key field?
إجابة(C)
It uniquely identifies each record.
50
What is the purpose of normalization in database design?
إجابة(B)
To eliminate data redundancy and improve data integrity.