Databases Ia 2022/23: Supervision Sheet 2A Questions

These are suggested questions that supervisors might want to use in their supervisions. They are meant to indicate the type of questions that will be on the Tripos exam.

  1. Make sure you are working through the relational tutorial ready for the first tick.

  2. Explain how SQL relates to multisets and when to use the DISTINCT keyword.

  3. A relational database has two tables that both have 100 records in them. Give many distinct reasons why it might be a very bad idea to replace these with a single table that has 100 records in where the records have the combined set of attributes.

  4. On our movie database, will the SQL query

       select person_id, movie_id, position
       from credits
       where not((not (position is null)) or position = 17);
    

    return the same results as the query

       select person_id, movie_id, position from credits
       where position <> 17;
    

    Explain your answer.

  5. Suppose that a and b are 3-valued expressions in SQL (true, false, or null). Can the expression (a and b) is null be rewritten as an equivalent boolean combination of a, b, a is null, and b is null?

  6. In boolean logic, the expression not(a and b) always has the same value as (not a) or (not b). Is that true in 3-valued logic?

    What about the expression not(a or b) and the expression (not a) and (not b)?

    Is the expression a or (not a) always true in 3-valued logic? If not, can you extend this axiom to make it always true?

  7. 7. 8. These three questions relate to Lecture 5+ material. Owing to the spaced-out timetabling of the lectures this year, these questions have been split out to a sheet 2B. However, if sticking to the total-of-3-supervisions recommendation for this course, sheet 2B would likely be included in the second supervision along with 2A.

END. (C) TGG 2021 (C) 2022 DJG, University of Cambridge, Computer Laboratory.