Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

u can use whatever one you use and just save it as LabPart6.sql could you do the work and i plug the info in myself

u can use whatever one you use and just save it as LabPart6.sql could you do the work and i plug the info in myself

Write original seven queries using the database you created for Lab Part 5. Write one demonstrating your understanding of aggregate functions and set operators: AVE, CUBE ROLLUP, GROUPING, UNION, INTERSECT and MINUS.

For each query, write a question that the return set of the query answers in the space below. Place the sql for each query in a file named LabPart6.sql. Include a description of the query in the file.

Query 1

The query contains a subquery because a SELECT statement is coded within another SQL statement. The subquery is coded in the WHERE clause of the SELECT statement.

The query answers the question: What returned orders have reason Product Damaged?

Query 2

The query contains a subquery because a SELECT statement is coded within another SQL statement. The subquery is coded in the WHERE clause of the SELECT statement.

The query answers the question: What subquery orders have reason subquery ID?

Query 3

The query contains a subquery because a SELECT statement is coded within another SQL statement. The subquery is coded in the WHERE clause of the SELECT statement.

The query answers the question: What returned orders have reason number of IDs?

Query 4

The query contains a join because a SELECT statement is coded within another SQL statement. The join is coded in the join clause of the SELECT statement.

The query answers the question: What from orders the order ID?

Query 5

The query contains a subquery because a SELECT statement is coded within another SQL statement. The subquery is coded in the join clause of the SELECT statement.

The query answers the question: What from orders have reason order ID?

Query 6

The query contains a distinct because a SELECT statement is coded within another SQL statement. The distinct is coded in the WHERE clause of the SELECT statement.

The query answers the question: What from to date orders have reason 2016?

2016 is greater than the selected distinct

Query 7

Only those clients who have not order any product whose Name %Product%. The c_no column for the outer query table, customer, have relation to c_no column for the c_order table for the sub query.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

Students also viewed these Databases questions

Question

How does cognitive behaviorism work?

Answered: 1 week ago