NOTE! Remember to empty your table / partitions when adding constraints. So in short, create the partitions and constraints before inserting data.
Additional tips & tricks:
- You may have to create a default partition for part d)
- pgAdmin may fail all inserts in case of an error, you can use SQL Shell to circumvent this problem.

a) Partition the Orders table using orderdate with the following constraints:
  1. Orders between: 20060703 00:00:00.000 and 20070205 00:00:00.000
  2. Orders between: 20070205 00:00:00.000 and 20070819 00:00:00.000
  3. Orders between: 20070819 00:00:00.000 and 20080123 00:00:00.000
  4. Orders between: 20080123 00:00:00.000 and 20080507 00:00:00.000

b) Alter the third partition and add a contraint where the freight cost is higher than 50 €
c) Alter the fourth partition and add a constraint that the shipped date should not be null
d) Create two partitions of the first partition (so a partition of partitions) using shipcountry so that:
  1. Orders shipped to USA and UK are in one
  2. Orders shipped to Germany and Finland are in another

e) How many rows are in each partition?

Use the HW2.sql given in Moodle for creating (and inserting) data.

Submit your SQL statements (and answer for the question in e) in one SQL file to Moodle. In e), specify each partition and the amount of rows they have.