a what is a sub-queryb what is the difference


(a) What is a Sub-Query?

(b) What is the difference between a scalar sub-query and a tabular sub-query?

(c) Write an equivalent SQL statement to get the Name of Product which has the same price list as the Chainring Bolts. Use the following relational schema to answer this question: Production.Product (ProductID, PName, ListPrice)

(d) Convert the following SQL Statement to display the same result by using a sub-query instead of the join.

SELECT p.Name, p.ProductNumber
FROM Production.Product p
JOIN Sales.SalesOrderDetail AS sod
ON p.ProductID = sod.ProductID
WHERE sod.OrderQty > 41

(e) SQL Server may produce unexpected results when performing calculations on columns that have NULL values. So, to resolve this problem you need to use the ISNULL, NULLIF, and COALESCE functions of SQL Server 2005 when your columns hold NULL values. Explain briefly the purpose of each of the above function and support your answer with an appropriate example.

Request for Solution File

Ask an Expert for Answer!!
Database Management System: a what is a sub-queryb what is the difference
Reference No:- TGS0358816

Expected delivery within 24 Hours