120+ Important SQL Practice Questions with Answers for CBSE Class 11 and 12

SQL Practice Questions for classes 11 & 12

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 1

Q1. Write full form of DBMS.

Q2. Define the following term

  1. Primary Key
  2. Foreign Key
  3. Candidate Key
  4. Alternate Key

Q3. A group of rows and columns is called _______________

Q4. Candidate Key – Primary key = ___________________

Q5. Give two examples of DBMS software.

Q6. What is the difference between Data and Information?

Q7. A primary key is one of the candidate key. (True/False)

Q8. What do you mean by degree and cardinality in DBMS?

Q9. What is the alternate name of column in table?

 

Q10. What is the alternate name of row in table?

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 2

Q11. What do you mean by data redundancy?

Q12. What do you mean by data integrity?

Q13. Expand DBMS.

Q14. Name 3 types of data models.

Q15. A ___________ is a collection of logically related data.

Q16. Answer the following questions on the basis the given table.

AdmnoNameSubjectSexAverage
1001AmitMathM85.5
1002SumanEnglishF90
SQL Practice Questions

a. How many attributes are there in above table?

b. How many tuples are there in above table?

c. What is the degree of above table?

d. What is the cardinality of above table?

Q17. Write any five attributes of book entity.

Q18. Write any two advantages of database.

Q20. Which field you choose as primary key out of following in “Employee” table

  1. Emp_id
  2. Emp_name
  3. Emp_salary
  4. Emp_desig

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 3

Q21. Write two advantages of SQL.

Q22. MySQL is an ___________Software. (open source/Proprietary)

Q23. Name two types of SQL commands.

Q24. What is the difference between DDL and DML Commands?

Q25. Identify the DDL and DML commands from the following.

  1. Create
  2. Alter
  3. Insert
  4. Update
  5. Drop
  6. Delete
  7. Select

Q26. What do you mean by data type?

Q27. Name two numeric data type in MySQL.

Q28. Name two String Data type in MySQL.

Q29. Which data type is used for “Date of birth” field in Student table.

Q30. What is the difference between Char and Varchar.

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 4

Q31. In MySQL, date values to be enclosed in { } or in single quotation marks(True/False)

Q32. ______________ is the format of date in MySQL.

Q33. Data type of “name” field in a table is char(25). How many bytes will be  occupied by values “Ram” and “Rohan Kumar”?

Q34. Time data type is used to store time in ________ format.

Q35. Varchar is a fixed length data type.(True/False)

Q36. Name the command which is used to close MySQL.

Q37. Which data type in MySQL is used to store logical values?

Q38. Out of char, varchar and memo, which data type is used to store large amount of data?

Q39. Which data type in MySQL is used to store images, animations, clips etc.

Q40. Write the appropriate data types for the following fields.

  1. DateofBirth
  2. Salary
  3. Name
  4. Address
  5. Phonenumber

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 5

Q41. What do you mean by keyword in MySQL?

Q42. Identify the keyword from the following query.
Select * from book;

Q43. All statements in MySQL is terminated by __________.

Q44. We can create ____________ (database/tables)inside ___________(database/tables).

Q45. SQL is a case sensitive language(T/F)

Q46. _________ statement is used to show all the existing databases in server.

Q47. Which statement is used to show all existing table in database.

Q48. Write statement to open a database named “student”.

Q49. Name the command used to create database.

Q50. Write statement to create database named “book”

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 6

Q51. ___________ command is used to remove database completely.

Q52. Which command is used to show the structure of the table.

Q53. Name the columns which are visible when we execute the following command.

desc book;

Q54. Write the command to create the following table : “Student”

Field Name                        Data type                        Constraint

Rollno                                Integer (5)                      Primary Key

Sname                               Varchar(30)             

Contactno                          Char(10)                         Not Null

Q55. Write query to insert the following record in above created table.

      Roll number —  1, Name–Amit, Contact number– 1234567890

Q56. Write a query to insert the following values only.

       Roll number —  2 , Contact number– 11111111

Q57. Is Null value is equivalent to Zero?

Q58. What do you mean by Null in MySQL?

Q59. Which command is used to modify data in table?

Q60. Write a query to modify the Contactno to 98789878 whose roll number is 1 in table student.(given above)

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 7

Q61. Which command is used to delete data from the table?

Q62. Which command is used to add column in a table?

Q63. Write a query to add the column DOB of data type date in table Student.

Q64. Write a query to add new column “Grade” of data type varchar(2) in table ‘Student’ with default value “A”.

Q65. Write a query to change the data type of above added column (Grade) to varchar(4).

Q66. Write a query to delete column Grade from table student.

Q67. ___________Command is used to delete table completely/permanently.

Q68. Write a query to delete the table “Emp” permanently.

Q69. Delete from emp;

       The above command will delete all the records from table “emp”. (True/False)

Q70. Write a query to display all the records from table “Student”

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 8

Q71. Write the output of the following:

Select 76 + 75%4 from dual;

Q . Write the queries of the following:

                        Table : Student

SQL Practice Questions

Q72. Display all the records of table student.

Q73. Display Roll Number, Name and Class of table Student

Q74. Display records of students of class X.

Q75. Display details of Sumit.

Q76. Display records of student paying fees less than 3000.

Q77. Display fee of Amit

Q78. Display Class and percentage of  Pushkar.

Q79. Delete record of Amit

Q80. Display the structure of table student

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 9

Q81. What do you mean by aggregate function?

Q82. Which keyword is used to arrange records in increasing or decreasing order?

Q83. Which function returns the total number of records in a table?

Q84. Select count( * ) from student; return 5 and Select count(fee) from student; return 4

why different output is coming in above two queries?

Q85. ____________ function return the average value of a numeric column.

Q86. Which function returns the sum of numeric column?

Q87. _______ keywords removes duplicates records from the table.

Q88. Write a query to display all the records of table student whose name starts from “A”

Q89. Identify the error in the following statement.

Select * from student where name = null

Q90. Which function return the minimum value from column fee of table student?

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 10

Q91. What is the difference between drop and delete command?

Q92. Differentiate between Alter and Update command.

Q93. What is group by clause?

Write the output of the following:

Q94. Select 75 + 3*2

Q95. Select 23 + 56%5

Q96. Select power(2,3)

Q97 Select round(10.237,2)

Q98 Select round(12.3454,2)

Q99.Select round(12.3444,2)

Q100. Write the query on the basis of the following table : STUDENT 

Name, Admno, Subject, Average, Position

a. Display all records in ascending order by name

b. Display details of students whose position is “First” and average greater than 70      

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 11

Identify the errors in the following query

Q101 Select * from Student where Name = NULL;

Q102 Select max(salary) from employee group by designation where DOJ > “2020-02-02”;

Q103 Select * from student where name is = “Amit”;

Q104 Select * from employee where salary between 1000, 2000;

Q105. Select * from employee where name = “A%”;

Q106. Select Name , Subject from student where average >20 and < 30;

Q107. Select * from Student where Name = “Amit” and Name =”Sumit”;

Q108. Select highest(Salary) from employee;

Q109. Select all from student;

Q110. Update table student set Name = “Sunita” where admno = 1234;

SQL Practice Questions
SQL Practice Questions

SQL Practice Questions – Test 12

Write the output of the following on the basis of given

Table : Product

SQL Practice Questions

Q111. Select max(price) from product;

Q112. Select avg(price) from product;

Q113. Select min(qty) from product;

Q114. Select count(*) from product;

Q115. Select count(Qty) from product;

Q116. Select distinct(price) from product;

Q117. Select count(distinct(price)) from product;

Q118. Select price * Qty from product;

Q119. Select sum(price) from product;

Q120. Select sum(price) where Qty > 30;

SQL Practice Questions – Test 13

Q121. Write the queries of the following on the basis of given  table : Faculty

SQL Practice Questions

1. Display details of Faculties who joins after 1990.

2. Display details of Faculties whose salary is more than 20000.

3. Show the name of faculties whose DOJ is 12-10-1980.

4. Display the detail of faculties whose name start from alphabet ‘A’.

5. Display details of faculties whose salary is greater than 25000 and name ends with ‘n’.

6. Count number of faculties whose name starts with ‘S’ and salary more than 40000.

7. Display all records in increasing order of name.

8. Display details of faculties who earns maximum.

9. Display name of lowest earning faculty.

10. Display “Annual Salary” of all faculties. (Given salary is monthly)

Class 12 Computer Science Sample Paper 2020-2021.

Class 12 Computer Science Sample Paper Marking Scheme

Class 12 Computer Science Test Series

Leave a Reply

%d bloggers like this: