Use the HW1.sql file given for the table creation and data insertion.
Create the SELECT queries that produce the followg results:

a) For each customer: articles that the customer bought at the same day of month for two consecutive months, e.g. 16.7.2019 and 16.6.2019.
b) For each customer: timeslot in which the customer has been active,i.e. number of days between the first and the last purchases
c) All purchases of customers in February and March of leap years
d) Get pairs of customers - each with more than a singleton purchase - that have overlapping active purchase periods.
For example, Customer_1 buys something on 10.1.2019 and 10.3.2019. Customer_2 buys something on 20.1.2019 and 21.1.2019, now they have overlapping purchase periods.
e) All purchases of the last Fridays of a month.

Each is 2 %, equals to 10 %

Submit your queries in one SQL file to Moodle. Do not submit the output, only the queries you have created.


Table structure (you can find the SQL file in the homework section):
CREATE TABLE purchases (
  id SERIAL,
  n varchar(255) NOT NULL,
  d DATE default NULL,
  i varchar(50) NOT NULL,
  PRIMARY KEY (id)
);