Class 12 | MySQL 10

Query:6
Display roll and name of all the students who have got 2nd division.

mysql>Select roll,name from student where per>=50 and per<60;

Query>7
Display details of all the students who have 1st division in all the subjects.

mysql>Select * from student where m1>=60 and m2>=60 and m3>=60;

Query:8
Display details of all the students who have got 1st division in any of the subject.

mysql>Select * from student where m1>=60 or m2>=60 or m3>=60;

Query:9
Display name of all managers.

mysql>Select name from emp where design=’manager’;

Query:10
Display details of all the employees who have salary in 5 digits.

mysql>Select * from emp where sal>=10000 and sal<=99999;

Query:11
Display name of managers working in production department.

mysql>Select name from emp where design=’manager’ and deptname=’production’;

Query:12
Display name and salary of all the programmers.

mysql>Select name ,sal from emp where design=’programmer’;

Query:13
Display name ,salary and department name of all the managers and clerks.

mysql>Select name,sal ,deptname from emp where design=’manager’ or design=’clerk’;

Query:14
Display Name and designation of all the employees working in department 10 or 20 or 30.

mysql>Select name,design from emp where deptno=10 or deptno=20 or deptno=30;

Query:15
Display details of ram,mohan and sohan.

mysql>Select * from emp where name=’ram’ or name=’mohan’ or name=’sohan’;

Query:16
Display name of all the products.

mysql>Select name from product;

Query:17
Display product details of rin and surf and lux.

mysql>Select * from product where name=’rin’ or name=’surf’ or name=’lux’;


Query:18
Name of all the products which are to be reordered considering that the limit as 10

mysql>Select name from product where qty<10;

Query:19
Name of all the products which are over stocked considering that the limit is 100

mysql>Select name from product where qty>100;

Query:20
Name of all the customers having their account in thatipur branch.

mysql:Select name from bank where bname=’thatipur’;

Query:21
Name and balance of all the customers having their account in morar branch of gwalior city.

mysql>Select name,bal from bank where bname=’morar’ and city=’gwalior’;

Query:22
Display empno,sal and design details of amit,sumit and rohit working in either production or sales department.

mysql>Select empno,sal,design from emp where (name=’amit’ or name=’sumit’ or name=’rohit’) and deptname=’production’ or deptname=’sales’;

Query:23
Display sal and design of manager “amit” working in sales depatment and getting sal more then 40000.

mysql>Select sal,design from emp where name=’amit’ and design=’manager’ and deptname=’sales’ and sal>40000;