write the following queries: 1. Find OrderlD, Date, CustomerID, CustomerName, Address, Phone, Email of all orders....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
write the following queries: 1. Find OrderlD, Date, CustomerID, CustomerName, Address, Phone, Email of all orders. 2. List all orders of all customers including CustomerID, CustomerName, OrderlD, Date. Order the result by descending order of CustomerName (Note that we need to know also the customer who have no order). Try to use left outer join for this question. 3. Same as Question 2 but using right outer join for this exercise. 4. List CustomerID of all customers who have never bought any product. 5. Do the intersect between the list of CutomerID from Customers and the list of CustomerID from Orders? How many rows in the output? 6. Do the union between the list of CutomerID from Customers and the list of CustomerID from Orders? How many rows in the output? 7. Do the union all between the list of CutomerID from Customers and the list of CustomerID from Orders? How many rows in the output? 8. List all orders of 'NGUYEN THI BE' and 'LE VAN SANG', including CustomerID, CustomerName, OrderID, Date; ordered by CustomerName. 9. List OrderlD, ProductCode, ProductName, Price, SellPrice, SoldQuantity, Profit ((SellPrice - Price)*SoldQuantity) by ascending order of OrderID. 10. List CustomerID, CustomerName, OrderID, ProductCode, ProductName, Price, SellPrice, SoldQuantity, Profit (SellPrice - Price)*SoldQuantity) by ascending order of CustomerName. 11. List 5 Orderltems having the highest profit (profit = (SellPrice - Price)*SoldQuantity). 12. List all products (ProductCode, ProductName) bought by both 'NGUYEN THI BE' and 'MAI THI QUE ANH'. 13. List all products with highest price (Note that there could have many products with the highest price). You should not use the aggregate function max(). write the following queries: 1. Find OrderlD, Date, CustomerID, CustomerName, Address, Phone, Email of all orders. 2. List all orders of all customers including CustomerID, CustomerName, OrderlD, Date. Order the result by descending order of CustomerName (Note that we need to know also the customer who have no order). Try to use left outer join for this question. 3. Same as Question 2 but using right outer join for this exercise. 4. List CustomerID of all customers who have never bought any product. 5. Do the intersect between the list of CutomerID from Customers and the list of CustomerID from Orders? How many rows in the output? 6. Do the union between the list of CutomerID from Customers and the list of CustomerID from Orders? How many rows in the output? 7. Do the union all between the list of CutomerID from Customers and the list of CustomerID from Orders? How many rows in the output? 8. List all orders of 'NGUYEN THI BE' and 'LE VAN SANG', including CustomerID, CustomerName, OrderID, Date; ordered by CustomerName. 9. List OrderlD, ProductCode, ProductName, Price, SellPrice, SoldQuantity, Profit ((SellPrice - Price)*SoldQuantity) by ascending order of OrderID. 10. List CustomerID, CustomerName, OrderID, ProductCode, ProductName, Price, SellPrice, SoldQuantity, Profit (SellPrice - Price)*SoldQuantity) by ascending order of CustomerName. 11. List 5 Orderltems having the highest profit (profit = (SellPrice - Price)*SoldQuantity). 12. List all products (ProductCode, ProductName) bought by both 'NGUYEN THI BE' and 'MAI THI QUE ANH'. 13. List all products with highest price (Note that there could have many products with the highest price). You should not use the aggregate function max().
Expert Answer:
Answer rating: 100% (QA)
1 Find OrderlD Date CustomerID CustomerName Address Phone Email of all orders Select POOrderlDPODate... View the full answer
Posted Date:
Students also viewed these databases questions
-
To plan a liquid-liquid extraction we need to know the solute's distribution ratio between the two phases. One approach is to carry out the extraction on a solution containing a known amount of...
-
It is obvious that we need to have spanning trees for both unicasting and multicasting. How many leaves of the tree are involved in a transmission in each case? a. A unicast transmission b. A...
-
A group of psychologists recently argued that we need to revise Maslows Hierarchy. They claim we should delete self-actualization and replace it with parenting. They claim too many people see the...
-
An investor bought a 70-strike European put option on an index with six months to expiration.The premium for this option was 1. The investor also wrote an 80-strike European put optionon the same...
-
In general, if the price of the underlying stock is going up, what will happen to the price of a put option? Briefly explain.
-
Repeat Probs. 18.1 through 18.3 using the Lagrange polynomial.
-
Consider the Amprian path going through the collection of current-carrying wires in Figure 28.19. If the magnitude of the current is the same in all the wires, is the line integral of the magnetic...
-
A six-month $10,000 Treasury bill is selling for $9,844. What is the annual yield according to the discount method? Does this yield understate or overstate the true annual yield? Explain.
-
Ahmed, a foreign qualified accountant, has recently returned to Pakistan and has joined a newly incorporated company Radium Limited (RL), a subsidiary of a listed company. Ahmed has been entrusted...
-
1. What is your assessment of the financial performance of Nelson Nurseries? 2. Do you agree with Christine Barton?s accounts-payable policy? 3. What explains the erosion of the cash balance? 4. What...
-
Entity Relational (ER) diagram, or Extended Entity Relational (EER) diagram based on the information at the bottom. to create the diagram. On a large online retail platform, different users can log...
-
The current share price of Victoria Plc. is $49. The company has just paid a dividend of $2.5 per share. Dividends are expected to rise by 5 percent per year indefinitely. The company is in a higher...
-
If a firm has decided to move from a situation in which it uses a company-wide cost of capital to divisional costs of capital, what problems is it likely to encounter?
-
What is the annual percentage yield (APY), and how does it differ from the annual percentage rate (APR)?
-
Identify and explain three different dividend policies. (Hint: One of these is a constant dividend payout ratio.)
-
How does investing more heavily in current assets (while not increasing the firms current liabilities) decrease both the firms risk and its expected return on its investment?
-
a company generates $1million profit. How can the R&D director convince the other directors to invest this money in R&D? The sales director and the IT director want the budget too. Discuss
-
Carlton Stokes owns and operates a car-detailing business named SuperShine & Detailing. For $150, Carltons business will hand wash and wax customers cars, vacuum the interior, and thoroughly clean...
-
Based on Exhibits 1 and 2, to attempt to profit from the short-term excess return forecast, Capara should increase KUEs portfolio allocation to: A. developed markets equity and decrease its...
-
Given Kovals current portfolio and the tax laws of the country in which he lives, Kovals portfolio would be more tax efficient if he reallocated his taxable account to hold more: A. high-yield bonds....
-
Kovals attitude toward emerging markets equity reflects which of the following behavioral biases? A. Hindsight bias B. Availability bias C. Illusion of control Rebecca Mayer is an asset management...
Study smarter with the SolutionInn App