Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions