In-Class Exercises

Fri Jan 26, 2018

Please refer to lecture notes for Day 4.

  1. Problem: Given the tables shown on Page 9 of Lecture 4,
    Table R
    A
    1
    3
    Table S
    B C
    2 3
    3 4
    3 5
    Table T
    A B C
    1 3 6
    2 4 7
    3 5 8
    1. Write and execute the SQLite3 commands to generate the result
    2. Table Output
      A
      3
      3
    3. Write and execute the SQLite3 commands to generate the result of cross product of R and S.
    4. Table Cross-Product
      A B C
      1 2 3
      1 3 4
      1 3 5
      3 2 3
      3 3 4
      3 3 5
    5. Write and execute the SQLite3 commands to generate the result of selection (R.A == S.B).
    6. Table Selection
      A B C
      3 3 4
      3 3 5

  2. Problem Using the tables created in the above Problem, R,S, and T, write and execute the SFW query examples on Pages 10, 21, 22, and 24 of Lecture 4.

  3. Problem Down load the Excel file sample_data.xslx which contains similar information of company and product shown in Pages 25, 28, and 30. Try out those queries.