CBSE eBooks CBSE Guess > eBooks > Class XII > Computer Science By . Mr. MRK
Chapter – 8 . STRUCTURED QUERY LANGUAGE Delhi 2008. 5.b. Consider the following tables Product and Client. Write SQL commands for the statement (i) to (iv) and give outputs for SQL queries (v) to (viii).
(i) To display the details of those Clients whose city is Delhi Ans. Select all from Client where City=”Delhi” (ii) To display the details of Products whose Price is in the range of 50 to 100 (Both values included). Ans. Select all from product where Price between 50 and 100 (iii) To display the ClientName, City from table Client, and ProductName and Price from table Product, with their corresponding matching P_ID. Ans. Select ClientName,City,ProductName,Price from Product,Client where Product.P_ID=Client.P_ID. (iv). To increase the Price of all Products by 10 Ans. Update Product Set Price=Price +10 (v) SELECT DISTINCT Address FROM Client Ans. ( The above question may consist DISTINCT City. If it is DISTINCT City, the following is the answer) City (vi). SELECT Manufacturer, MAX(Price), Min(Price), Count(*) FROM Product GROUP BY Manufacturer; Ans.
|