Question
Using SQL and an SQL script file, create and execute advanced queries of your choice that demonstrate each of the following: The use of a
Using SQL and an SQL script file, create and execute advanced queries of your choice that demonstrate each of the following:
The use of a GROUP BY clause, with a HAVING clause, and one or more group functions
The use of UNION operator
The use of a subquery
The use of an outer join
Then create and execute at least one SQL UPDATE and at least one SQL DELETE query.
Finally, create and use an SQL view and in a SELECT query.
Submit the following outputs of your SQL script file processing, in this order and appropriately labeled, in a single Word file:
The SQL and results of your INSERT statements to further populate your tables
The SQL and results of your 4 advanced SELECT queries
The SQL and results of your UPDATE and DELETE queries
The SQL and results of your view creation and its use in a SELECT query
I need to know what tables to create and characteristics used in order for these statements to be execute in MySQL. I have tried to use these with no luck. Thanks
2. The use of a GROUP BY clause, with a HAVING clause, and one or more group functions
Select count(orderID) from Orderdata group by No_of_items having Order_total>13;
3. The use of UNION operator Select ItemId, Unitcost from Item Union Select custID, address from Customer;
4. The use of a subquery Select orderId from Orderdata where custId IN(Select custID from Customer where custName='K123');
5. The use of an outer join Select Customer.custId,Customer.custName, Orderdata.ItemId from Customer FULL OUTER JOIN Orderdata where Customer.custId=Orderdata.orderID order by Customer.custId;
6.Update UPDATE Customer SET custName='John Store' WHERE CustomerID='J123';
7. Delete DELETE FROM Customer WHERE custId='K123';
8.create view CREATE VIEW [subquery] AS Select orderId from Orderdata where custId IN(Select custID from Customer where custName='K123');
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started