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

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