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

Define decision tree classifiers, Define decision tree classifiers? As ...

Define decision tree classifiers? As the name suggests decision tree classifiers use a tree: Every leaf node has an associated class, and every internal node has a predicate as

Data replication, Data Replication "If a relation R has its copies kept...

Data Replication "If a relation R has its copies kept at two or more sites, then it is considered replicated". But why do we replicate a relation? There are several advan

What is functional dependency, What is Functional Dependency? A Functi...

What is Functional Dependency? A Functional dependency is shown by X Y among two sets of attributes X and Y that are subsets of R specifies a constraint on the possible tuple

What are the advantages of having an index structure, What are the advantag...

What are the advantages of having an index structure?      Ans: The index structures commonly provide secondary access paths, which offer alternative ways of accessing the reco

Log based recovery, Log based recovery: Let us first describe the term tran...

Log based recovery: Let us first describe the term transaction log in the context of DBMS. A transaction log is a record in DBMS that remains track of all the transactions of a dat

What are the objectives of object design, What are the Objectives of object...

What are the Objectives of object design After going through this unit, you could be able to: explain steps of object design; discuss algorithms that reduce costs;

Forward recovery (redo), Forward Recovery (Redo): In this system the commit...

Forward Recovery (Redo): In this system the committed changes made by a transaction are reapplied to a previous copy of the database.                          In simpler

Describe relational model, Describe relational model? Structure of rela...

Describe relational model? Structure of relational data base Basic structure Database schema Keys Schema diagram Query languages

Trigger , Flights(FlightNo, DeptDateTime, Origin, ArrivalDateTime, Destinat...

Flights(FlightNo, DeptDateTime, Origin, ArrivalDateTime, Destination, Capacity, SoldSeats) Tickets(FlightNo, Seat, CustID) Where - flightNo is the PK of the flights table - DeptDa

Describe the host language, Describe the host language? Host Language:...

Describe the host language? Host Language: You could write applications along with SQL statements embedded inside a host language. The SQL statements give the database inter

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