What is a sub-query, Database Management System

Assignment Help:

(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.


Related Discussions:- What is a sub-query

Explain domain-oriented relational calculus?, How does Tuple-oriented relat...

How does Tuple-oriented relational calculus vary from domain-oriented relational calculus? The tuple-oriented calculus uses a tuple variables i.e., variable whose only allowed

Should i select imaging software that allows changes, Should I select imagi...

Should I select imaging software that allows changes? An imaging system should not give features to edit or alter images. Images generally are formed as safe and secure records

Design a query plan for distributed query, (a) Design a query plan for the ...

(a) Design a query plan for the following distributed query: An application at site B wants to compute a join of STUDENT ? Id=StudId TRANSCRIPT where STUDENT (Id,Major) is at site

What are the constituents of file, What are the Constituents of File? Also ...

What are the Constituents of File? Also elaborates all the possible file operations? A file is organised logically as sequence of record. These records are mapped onto disk blo

Security-drawbacks of data distribution, Security: In a centralised system...

Security: In a centralised system, access to the data can be simply controlled. Though, in a distributed DBMS not only does access to replicated data have to be controlled in many

When it is better to use files than a dbms, When It is better to use files ...

When It is better to use files than a DBMS? It is better to use files than a DBMS when Multiple users wish to access the data.

We need help in booking system for golf business, We need help in Booking S...

We need help in Booking System for Golf Business Development of a web based booking system which permits clients to book golf lessons with the following features- a) 4 user p

Correlated and uncorrelated queries, need to get answer for questions 3&4 o...

need to get answer for questions 3&4 on this page in part 1

Issues relating to the design of the physical database files, The issues re...

The issues relating to the Design of the Physical Database Files Physical File is a file as stored on the disk. The major issues relating to physical files are:  •      Cons

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd