Question: Write a SQL to identify customers (CUSTOMER_ID) who placed more than 3 orders in year 2014 and 2015 each. If a customer placed more than
Write a SQL to identify customers (CUSTOMER_ID) who placed more than 3 orders in year 2014 and 2015 each. If a customer placed more than 3 orders in year 2014 but did NOT place more than 3 orders in 2015, that customer should not be included in the output.
Table Name: CUST_ORDERS
| ORDER_ID | CUSTOMER_ID | ORDER_DATE |
| 101 | 201 | 2014-01-01 |
| 102 | 202 | 2014-02-12 |
| 103 | 203 | 2014-03-05 |
| 104 | 204 | 2014-04-15 |
| 105 | 202 | 2014-05-15 |
| 106 | 202 | 2014-07-10 |
| 107 | 203 | 2014-09-15 |
| 108 | 202 | 2014-12-15 |
| 109 | 201 | 2015-01-01 |
| 110 | 202 | 2015-02-12 |
| 111 | 202 | 2015-03-05 |
| 112 | 201 | 2015-04-15 |
| 113 | 202 | 2015-05-15 |
| 114 | 202 | 2015-07-10 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
