To 🔥 celebrate the holiday season, Also check out our NEWLY launched Annual plan (Up to 50% off). Use coupon code THANKSGIVING15 and enjoy additional 15% off all paid plans. Coupon expires at 2020/11/30 .
30. Inactive customers in May easy

Instruction

  • Write a query to return the total number of customers who didn't rent any movies in May 2020.
Hint
  • You can use NOT IN to exclude customers who have rented movies in May 2020.

Table 1: rental

   col_name   | col_type
--------------+--------------------------
 rental_id    | integer
 rental_ts    | timestamp with time zone
 inventory_id | integer
 customer_id  | smallint
 return_ts    | timestamp with time zone
 staff_id     | smallint
 last_update  | timestamp with time zone

  

Table 2: customer

  col_name   | col_type
-------------+--------------------------
 customer_id | integer
 store_id    | smallint
 first_name  | text
 last_name   | text
 email       | text
 address_id  | smallint
 activebool  | boolean
 create_date | date
 last_update | timestamp with time zone
 active      | integer

  

Sample results

 count
-------
 1234

Subscribe for solution