
September Rentals
Paulo R. Rodegheri Brazil
The video store is making its semi-annual report and needs your help. All you have to do is select the name of the clients and the date of rental, from the rentals made in September 2016.
Schema
Column | Type |
id (PK) | numeric |
name | varchar |
street | varchar |
city | varchar |
Column | Type |
id (PK) | numeric |
rentals_date | date (ISO/YMD) |
id_customers (FK) | numeric |
Tables
id | name | street | city |
1 | Giovanna Goncalves Oliveira | Rua Mato Grosso | Canoas |
2 | Kauã Azevedo Ribeiro | Travessa Ibiá | Uberlândia |
3 | Rebeca Barbosa Santos | Rua Observatório Meteorológico | Salvador |
4 | Sarah Carvalho Correia | Rua Antônio Carlos da Silva | Apucarana |
5 | João Almeida Lima | Rua Rio Taiuva | Ponta Grossa |
6 | Diogo Melo Dias | Rua Duzentos e Cinqüenta | Várzea Grande |
id | rentals_date | id_customers |
1 | 2016-09-10 | 3 |
2 | 2016-02-09 | 1 |
3 | 2016-02-08 | 4 |
4 | 2016-02-09 | 2 |
5 | 2016-02-03 | 6 |
6 | 2016-04-04 | 4 |
Output Sample
name | rentals_date |
Rebeca Barbosa Santos | 2016-09-10 |
N.B.: It's better if you solve this by your own. Thank you!
URI - BEECROWD Online Judge 2614 Solve in SQL:
-- Solved by IntesarSELECT c.name, r.rentals_dateFROM customers c,rentals rWHERE (r.rentals_date >= '2016-09-01' AND r.rentals_date <= '2016-09-30')ANDr.id_customers = c.id ;
0 Comments