Introduction to Database Systems: Labs



These are exercises to be discussed in the labs. Once the lab is over, you will find here also sample solutions to some of the exercises.
  1. Conceptual Modeling  (Exercises, Sample-Solution Question 2)
  2. Database Construction in PostgreSQL  (Exercises, Script with Sample Solution)

    Here is the SQL script for populating the demographic data toy database.

  3. Translating Conceptual Models into Relational Schemas  (Exercises)
  4. Relational Algebra  (Exercises, Sample Solutions)
  5. Relational Algebra and SQL  (Exercises)
  6. SQL Queries (I)  (Exercises, Sample Solutions)

    For these exercises you need to create a toy database with employees and departments.

  7. SQL Queries (II)  (Exercises, Sample Solutions)

    For these exercises you need to create a toy database with sailors and boats.

  8. JDBC Applications  (Exercises)
  9. For these exercises you may want to use some sample code to access a database.

  10. Indexing and Query Execution  (Exercises)

    For these exercises you need to create random instances for the tables of the employees database.
    Here is a script for the creation of the tables.
    These are the Java files RandomData, RandomDept, RandomEmp, PrintRandomDeptsAndEmps, which can be used to create files with random instance data for the tables.
    The files can then be bulk loaded with the PostgreSQL copy command.
    (Note that the previous version of the employees db would not work because the scripts generate strings for some columns that could not be stored.)
    Finally, you will create indexes on those tables.




BACK Back to the course homepage