Please refer to Important Questions Simple Queries In Sql Class 11 Computer Science below. These questions and answers have been prepared based on the latest examination guidelines and NCERT book issued for Class 11 Computer Science for the current academic year. We have provided Important Questions for Class 11 Computer Science for all chapters here. Simple Queries In Sql is an important chapter in Class 11 Computer Science, following Important Questions and their solutions will help you to get more marks in examinations.
Simple Queries In Sql Class 11 Computer Science Important Questions
Very Short Answer Type Questions
Question: Write two usage of DESC in SQL.
Answer: DESC is used with Order by Clause in select statement which displays the data in descendingorder. And another user of DESC is that it is used to display the structure of table.
Question: Name some basic MySQL SQL elements.
Answer: Some basic MySQL SQL elements are : (i) Literals (ii) Datatypes (iii) Nulls (iv) Comments.
Question: Consider the following Table named „empl‟ and Write SQL commands from (a) to (n)
(a) Display all the records from table empl.
Answer: select * from empl;
(b) Display EmpNo and EName of all employees from the table empl.
Answer: select EmpNo, EName from empl;
(c) Display employee name, salary, and department number who are not getting commission from table empl.
Answer: select EName, sal, deptno from empl where comm = NULL;
(d) Display employee number, name, sal*12 as Annual salary whose commission is not NULL from table empl.
Answer: select EmpNo, EName, sal*12 ‗Annual Salary‘ from empl where sal<>NULL;
(e) List all department numbers from table empl.
Answer: select deptno from empl;
(f) List all unique department numbers from table empl.
Answer: select distinct(deptno) from empl;
(g) List the details of all clerks who have not been assigned department as yet.
Answer: select * from empl where job=‘CLERK‘ and deptno=NULL;
(h) Display the details of employees whose name have only four letters.
Answer: select * from empl where EName like ‗_ _ _ _‘;
(i) Display the details of all employee whose annual salary is between 25000 to 40000.
Answer: select * from empl where sal between 25000 and 40000;
(j) How many job types are offered to employees?
Answer: select count(distinct(job)) from empl;
(k) List the employees who earn more commission than their salaries.
Answer: select * from emple where sal<comm;
(l) Display name, job title and salary of employee who do not have manager.
Answer: select EName, job, sal from empl where mgr = NULL;
(m) Display the name of employee whose name contains „A‟ as third letter.
Answer: select EName from empl where EName like ‗_ _ A%‘
(n) Display the name of employee whose name contains „L‟ as any letter.
Answer: select EName from empl where EName like ‗%L%‘
Question: Differentiate between CHAR and VARCHAR Datatypes.
Answer: The difference between CHAR and VACHAR is that of fixed length and variable length respectively.
Question: Write a query to display EName and Sal of employee whose salary is greater than or equal to 2200 from table empl.
Answer: select EName, sal from empl where sal>=2200;
Answer: (a) Select * from CLUB;
(b) Select COACHNAME, DATEOFAPP from CLUB order by DATEOFAPP desc;
(c) Select COACHNAME, PAY, AGE, PAY*15/100 ‗BONUS‘ from CLUB;