Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 9 Weeks Ago, 5 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
/* Query 2.
Read p.130-131 or watch the video on slide#1~2 of part(3) of Chapter 4.
Then, write a statement to execute the procedure sp_addlinkedserver to
create a linked server in your server with a name of your selection
so it represents the instructor's SQL Server running in his office
ENB301A. Write another statement to execute another procedure, which is
sp_addlinkedsrvlogin, to map your Windows login to an existing remote
login of the linked server. This login must be called 'student' with
a password also 'student'.
Â
There is a Products2 table in the ClearWater database of the instructor's
SQL Server described above. Products2 has different contents from Products
of ClearWater.
Â
Your job here is to write a SELECT statement to compare products in
Products2 (of ClearWater in the above remote server) with products in
Products of ClearWater in your own server and find out which have
the same ProductID but different CategoryID. Display their ProductID
(only in one column) and both CategoryID in 'CategoryID_myServer' and
'CategoryID_remoteServer', respectively.
*/
Â
Â
Â
Â
Â
Â
/* Query 3.
Use the same linked server you created in Query 2 and write a SELECT
statement to find catogeries of ClearWater in your server that are not
referenced or used by any product in the Products2 table of the linked
server. Display their CategoryID, CategoryName, and Description.
Â
Hint: outer join
*/
Â
Â
Â
Â
Â
Â
/* Query 4.
Which products in Products table (of your server) have the same supplier
as that of product 63 and have a unit price lower than that of product 63?
Display their ProductID, SupplierID, and UnitPrice.
Â
Do not hard code the supplier's SupplierID or name in your statement.
Â
Hint: self join
*/
Â
Â
Â
Â
Â
----------END----------
-----------