SQL Commands Class 10 IT Code 402
SESSION 4: RETRIEVE DATA USING QUERY
Q1. What do you mean by query in Open Office Base?
Q2. In how many ways you can create query in Open Office Base?
Q3. Name the Query language which is used in Base?
Q4. Which command is used to retrieve data from the table?
SQL Commands Class 10 IT Code 402
Q5. Name two categories of SQL Commands.
Q6. Differentiate between DDL and DML Commands.
Q7. Identify the DML Commands from the following :
- Create
- Alter
- Insert
- Delete
Q8. __________ is the most commonly used Data Manipulation Language(DML) command.
SQL Commands Class 10 IT Code 402
Q9. Name two clauses which can be used with Select Command.
Q10. Write the Select command to display all the records of table “book”.
Q11. Write the shortcut to execute query in “Create query in SQL view” of Base.
Q12. What is the purpose of Where clause in Select Command?
SQL Commands Class 10 IT Code 402
Q13. What is the purpose of Order by clause in Select Command?
Q14. Write the queries for the following table : Emp
Emp_id | Ename | Salary |
1 | Suman | 20000 |
2 | Sanjay | 32000 |
3 | Ravi | 30000 |
a. Display the salary of all the employees after incrementing by Rs 1000.
b. Display the Employee id and salary of all the employees after decreasing by Rs 500.
c. Display the Name and salary of all the employees after incrementing it as thrice the amount of present salary.
d. Display the Employee id, Name and salary of all the employees after decrementing it as half the amount of present salary.
e. Display the Employee id and Name of all the employees.
SQL Commands Class 10 IT Code 402
Q15. Write the queries for the following table : Student
Admno | Name | Class | House |
1001 | Sonam | 9 | Blue |
1002 | Ravi | 10 | Yellow |
1003 | Poonam | 10 | Green |
a. Display the entire table
b. Display the list of students whose house color is blue.
c. Display the admission number of students whose house color is green.
d. To view records in ascending order of Admission Number.
e. Display the records of Class 10 Students.
f. Display the class of ‘Ravi’
g. Insert the given record : 1004, “Aman”, 11, “Blue”
SQL Commands Class 10 IT Code 402
Q16. Which command is used for the following task in database?
- To insert a new record
- To modify the existing data.
- To delete a record
- To display record
Q17. Write the queries for the following table : Item
Itemno | Iname | Price | Qty |
12 | Pen | 10 | 17 |
13 | Eraser | 5 | 15 |
14 | Notebook | 15 | 20 |
a. Write a query to insert a new record of following details
15, “Pencil”, 20, 10
b. Write a query to display detail of items whose quantity is more than 10.
c. Write a query to change the quantity of Item number 13 to 25.
d. Display the total amount of each item. The amount must be calculated as the price multiplied by quantity for each item
e. Display the name of item whose price is 10.
f. Display all the records in descending order of price.
g. Identify the Primary key from table Item.
h. Write the suitable data type of field “Iname”.
i. Write a query to increase the price of all items by Rs2.
j. Write a query to decrease the price of all items by Rs2 whose price is less than 20.
Q18. By default, data is arranged in _________ order using ORDER BY clause.
Q19. Which clause is used for the following:
a. To display specific record.
b. To display records in a particular order.
Q20. Consider the following table: STUDENT [C.B.S.E. – 2021]
ADMNO | NAME | GRADE | DOB | MARKS | HOUSE | GENDER |
1001 | RUPAL | 9 | 10/04/2006 | 76 | GREEN | M |
1002 | RASHMI | 9 | 08/12/2005 | 87 | RED | F |
1003 | ARNAV | 10 | 25/05/2004 | 81 | GREEN | M |
1004 | SUMONA | 9 | 23/08/2005 | 68 | RED | F |
1005 | ARUN | 9 | 16/07/2005 | 72 | GREEN | M |
1006 | TIA | 9 | 22/09/2005 | 91 | BLUE | F |
1007 | ROSHAN | 10 | 26/08/2004 | 89 | BLUE | M |
Write SQL Commands:
a) To Display the details of all students of Green House.
b) To increase the marks by 5 whose ADMNO is 1005.
c) To display the details of all students whose MARKS are less than 80.
d) Display the list of all students in descending order of MARKS.
Q21. Identify any two Column name/Attribute and their data types from a given table: PLAYER. [C.B.S.E.]
PID | PNAME | RUNS | GENDER | DOB |
P101 | SACHIN | 13000 | M | 10/04/2001 |
P102 | KAPIL | 7000 | M | 12/02/1998 |
P103 | SAURABH | 12000 | M | 13/04/2001 |
P104 | VIRAT | 12500 | M | 17/03/2005 |
Q22. Consider the following table: EMPLOYEE [C.B.S.E.]
EMPID | NAME | SALARY | DOJ | COMM | DEPT | GENDER |
1001 | ROHAN | 7000 | 10/04/2006 | 300 | SALES | M |
1002 | RISHU | 12000 | 08/12/2005 | 100 | FINANCE | F |
1003 | DEVANSH | 9000 | 25/05/2004 | 500 | SALES | M |
1004 | SUMAN | 10000 | 23/08/2005 | 300 | MARKETING | F |
1005 | ARYAN | 11000 | 16/07/2005 | 500 | SALES | M |
1006 | TAMANNA | 15000 | 22/09/2005 | 200 | FINANCE | F |
1007 | ROHIT | 8000 | 26/08/2004 | 900 | SALES | M |
Write SQL Commands :
a) To display the details of all employees of SALES Department.
b) To increase the SALARY by 1000 whose EMPID is 1007.
c) To display the details of all employees whose SALARY is more than 10000.
d) To display the list of all employees in descending order of SALARY.
Q23. Consider the following table: Sales [Sample Paper-2022]
Sale_Id | Prod_Name | Price | Discount |
1101 | Laptop | 65000 | 2500 |
1103 | Pen Tab | 29500 | 1000 |
1105 | Desktop | 50000 | 1550 |
1106 | Printer | 12000 | 2000 |
- How many fields and records are there in Sales table?
- Write SQL commands for the following:
i. Display Sales ID and price of all products whose discount is more than 1000.
ii. Display the details alphabetically by product name.
iii. Display product name and sales price after deducting the discount from the price.
Note: Sales price can be calculated as (price-discount)
Q24. Consider the following table: Teachers
NUMBER | NAME | AGE | SUBJECT | DATEOFJOIN | SALARY | GENDER |
1 | JUGAL | 34 | COMPUTER | 10/01/2019 | 12000 | M |
2 | PRATIGYA | 31 | SCIENCE | 24/03/2019 | 20000 | F |
3 | SANDEEP | 32 | MATHS | 12/12/2019 | 30000 | M |
4 | SANGEETA | 35 | SCIENCE | 01/07/2020 | 40000 | F |
5 | SATTI | 42 | MATHS | 05/09/2020 | 25000 | M |
6 | SHYAM | 50 | SCIENCE | 27/06/2021 | 30000 | M |
7 | SHIV OM | 44 | COMPUTER | 25/02/2021 | 21000 | M |
8 | SHALAKHA | 33 | MATHS | 31/07/2020 | 20000 | F |
Write SQL commands:
a. To show all the information about IT teachers.
b. To list the details of all the teachers who are getting salary between 20000 to 35000.
c. To display the subject of all the teachers whose age is more than 40 years.
d. To display the list of names of all the teachers in alphabetical order.
Q25. Consider the following table “Datesheet” and write the queries for the following: [CBSE Sample Paper – 2023]
Sub_Code | Sub_Name | DateofExam | Days |
E001 | English | 11-03-2021 | Monday |
H002 | Hindi | 15-03-2021 | Friday |
S003 | Social Sci | 18-03-2021 | Monday |
S004 | Science | 21-03-2021 | Thursday |
i. Write a SQL command to display the records in ascending order by date of exam.
ii. Write a query to display the above date sheet.
iii. Write a query to display the subject name and date of the exam held on ‘Monday’
iv. Write a SQL command to display the date of exam and Sub_Name of Science subject.
Q26. Consider the following table “School” and write the queries for the following:
Roll_no | Student_Name | DateofBirth | Class |
R12 | Aman | 11-03-2012 | 10 |
R43 | Sumit | 15-03-2015 | 9 |
R23 | Dhriti | 18-03-2010 | 10 |
R1 | Parth | 21-03-2010 | 9 |
- Write a query to display all records in alphabetical order of Name.
- Write a query to change the class of “Dhriti” from 10 to 7.
- Write a query to display the above table.
- Write a query to display Roll number and Name of Class 10 students.
- Display detail of all students of class 9.
- Insert a new record with value: ‘R24’, ‘Kamal’, ’15-05-2010′, 8
- Display detail of all students whose class is greater than 9.
SESSION 1: APPRECIATE THE CONCEPT OF DATABASE MANAGEMENT SYSTEM
SESSION 2: CREATE AND EDIT TABLES USING WIZARD AND SQL COMMANDS
SESSION 3: PERFORM OPERATIONS ON TABLE
SESSION 5: CREATE FORMS AND REPORTS USING WIZARD
SQL Commands Class 10 IT Code 402
Disclaimer : I tried to give you the correct answers of above SQL Commands Class 10 but if you feel that there is some mistake in above SQL Commands, feel free to contact me at csiplearninghub@gmail.com
Ques15 c part query wrong house should be green not yellow
Thank you Ridit for your feedback.
Thanks a lot sir. This has been very helpful to me.
My pleasure Sunita
Yesss
Jay hind sir thnx
Thanks a lot sir 😌