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?
    Απάντηση
    A
    B
    D
  • 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?
    Απάντηση
    (B)
    DELETE FROM
  • 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?
    Απάντηση
    (A)
    *
  • 11
    Which of the following is an advantage of using a database system?
    Απάντηση
    B
    C
    D
  • 12
    Which are the benefits of using SQL?
    Απάντηση
    A
    B
    C
    D
  • 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?
    Απάντηση
    A
    B
    C
    D
  • 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?
    Απάντηση
    (C)
    BOOLEAN
  • 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?
    Απάντηση
    (C)
    FROM
  • 23
    In the context of a database, what does 'record' refer to?
    Απάντηση
    (C)
    A row in a table.
  • 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?
    Απάντηση
    (C)
    UPDATE
  • 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?
    Απάντηση
    (C)
    Data and Schema
  • 30
    Which data type would be best suited for storing a unique ID (e.g., customer ID) that is an integer?
    Απάντηση
    (B)
    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?
    Απάντηση
    (C)
    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?
    Απάντηση
    A
    B
    C
  • 40
    Which data type would be most appropriate for storing the ward number of a patient in a hospital database?
    Απάντηση
    (B)
    Integer
  • 41
    Which SQL command is used to remove data from a database table?
    Απάντηση
    (C)
    DELETE
  • 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)?
    Απάντηση
    A
    B
    C
  • 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?
    Απάντηση
    (B)
    DROP TABLE
  • 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.