Question: Write a SQL query to display all products where there is an order containing exactly two units of the product for each of the products.
Write a SQL query to display all products where there is an order containing exactly two units of the product for each of the products.
In database_1 there is the following:
Orders(order_id(Primary, int), registered_date(date), user_id(MUL, int)
OrdersProducts(order_id(Primary, int), price(float), product_id(Primary, int), quantity(int)
Ratings(order_id(Primary, int), product_id(Primary, int), rate(int), comment(VARCHAR)
Users(email(UNIQUE, VARCHAR), name(VARCHAR), password(VARCHAR), registered_date(date), username(UNIQUE, VARCHAR), user_id(Primary, int)
Step by Step Solution
3.34 Rating (145 Votes )
There are 3 Steps involved in it
You can use the following SQL query to display all pro... View full answer
Get step-by-step solutions from verified subject matter experts
