HI5033-Tutorial 6
HI5033-Tutorial 6
In this tutorial we will get some further experience in developing ER diagrams, and then translate
these to SQL DDL Statements.
Task 1
List the attributes you would expect to find in each of the tables mentioned above
Task 2
Task 3
Review the PostgreSQL Data types from the PostgreSQL Data Tupe documentation. This
can be found online at
https://www.postgresql.org/docs/9.5/datatype.html
Task 4
Review the PostgreSQL documentation on Table Basics, Default Values and Constraints.
This can be located online at
1
https://www.postgresql.org/docs/9.5/ddl.html
Once you do this write the SQL DDL Statements to create the above tables we identified in
Task 1 and refined in Task 2 above. Making sure to identify all the primary and foreign keys.
Task 5
In PostgreSQL and DBeaver, create the new database (call it MovieDB, prefixed by your
Student ID number), as we did in the first tutorial, and create a new DBeaver connection to
this new database.
Create the new tables in the database by running the SQL DDL statements you created in
Task 4 as scripts in the new database. You will need to fix any errors in the SQL statements
as they appear.