pagila-hw
Background
Pagila is a standard example database for postgresql. The database implements a simple movie rental system like the company Blockbuster might have maintained (before Netflix killed them). The following picture illustrates the database's structure:
Tasks
-
Fork this repo and clone it on the lambda server.
Notice that this repo uses git submodules. These are a tool that allow us to work with very complicated projects by including git repos within other git repos, and here we use submodules to include the original pagila repo. In order to clone the repo with the submodules, you need to run the commands
$ git clone https://github.com/mikeizbicki/pagila-hw $ cd pagila-hw $ git submodule init $ git submodule update -
Modify the
README.mdfile so that the test case image points to your forked repo. -
Solve the each of the problems in the
sqlfolder.-
The folder contains one file for each problem. At the top of each file is a description of what the file is supposed to compute. For each file, write a single
SELECTstatement that computes the correct answer. -
The folder
expectedcontains the expected outputs for each problem. You can verify your answer by checking that the output of yourSELECTstatement matches the output in theanswersfolder. -
The script
check_answers.shwill perform these checks for you automatically using thediffcommand. It must be run from within a postgres docker container.Bring up the docker container with the command
$ docker-compose up -d --buildThen run the the test case script with
$ docker-compose exec pg ./check_answers.sh
-
-
Upload a link to your forked github repo on sakai.
