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.