0% found this document useful (0 votes)
75 views

ch-11 Simple Queries - Answer Key

Answers for sql

Uploaded by

littlesnowigloo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

ch-11 Simple Queries - Answer Key

Answers for sql

Uploaded by

littlesnowigloo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

BRINDHAVAN VIDHAYALAYA PUBLIC SCHOOL 10.

To display the list of items whose discount is more than 10%


Class: XII Computer science (083) Marks:20 Ans: Select item from KID where discount > 10;
11. To display name of item and their date of purchase that were purchased
Date: 29.07.2024
after 31st Dec2016
I. Answer the following questions: 5 X 1=5 Select item, datapurchase from KID where dtapurchase > 2016-12-31;
1. Which keyword eliminates the redundant data from a query result? 12. To display the details of those item whose unit price is more than 5000.
Ans: Distinct Ans: Select * from KID where unitprice > 5000;
2. Expand the following DDL and DML
Ans: Data definition language, Data Manipulation language Direction: Write the output of the following queries:
3. How do you display the system date as the result of a query? 13. select item, unit price from KID where item = “Baby socks” || item = “Baby
Ans/:2024-07-29 suit”;
4. Write the output of the following: Item Unit price
Select substring(‘quadratically’, 5 , 6); Baby socks 200
Baby suit 600

14. select * from KID;


5. By default, order by clause lists the records in Ascending order.

II. Answer the following questions: 15 X 1 = 15


Consider the table and answer the following queries.

15. select Distinct(Item) from KID;


Item
Cot
Frock
Soft Toy
Baby Socks
Baby Suit
6. Write a query to display item details whose name start from ‘B”
Ans: select item from KID where item like “B%”; Direction: Write the queries for the following instructions.
7. Write a query to arrange the record in descending order based on Unit Price. 16. Write a query to display the name of the employee from the table emp1
Ans: select * from KID order by unitprice Whose name contains ‘T’ as the last alphabet.
8. Write a query to display the item name whose price is maximum. Ans: select empname from emp1 where name like “%T”;
Ans: select item, max(unit price) from KID; 17. Write a query to display the name of the employee from the table emp1
9. Display the details of items whose price between ranges 600 to 800. Who is having ‘L’ as any alphabet of the name.
Item Code Item DatePurchase UnitPrice Discount Ans: select empname from emp1 where name like “%L%”;
102 Frock 2016-09-23 800 10 18. List the details of employee from the table emp1 who earn more than
105 Baby Suit 2016-09-20 600 5 commission than salary.
Ans: Select * from emp1 where commission > salary;
19. Write any 2 String function with examples.
Ans: Concate(), substring() any 2 .
20. List the aggerate functions in SQL
Ans: sum(), total(), average(),max(),min()

Prepared by Archana S Co-Ordinator Signature

Principal Signature

You might also like