category 1
category 2
category 3
category 4
category 5
100

Display consumer no(cno) , meter no(mno) and bill amount(bill) where the consumer no is odd from Electric table

select cno,mno,bill

 from electric

where mod(cno,2)!=0;

100

display all the rows in the ascending order of bill amount(bill) from electric table 

select * from electric

order by bill;

100

Display all the rows from the table employees where employee number(empid) is divisible by 5

select * from employees

where mod(empid,5);

100

Display the name(enm) and hire date(hdt) of all the employees from Employee table who do not have a manager.

select enm,hdt 

from employee 

where mgrid is null;

100

display the employee name(enm) labeled as 'Name of the Employee' and salary(sal) as 'Monthly salary' from employee table

select enm 'Name of the employee', sal 'Monthly salary'

from employee;

200

display the employee id(eid), job  id(job_id)  and salary(sal) of all employees whose manager id (mgrid) is 505 or 509 from employee table

select eid,job_id,sal

from employee

where mgrid in(505,509);

200

display the employee id(eid) employee name(enm) and salary(sal) of employees from employee table whose salary is 25000 or more

select eid,enm,sal

from employee

where sal>=25000;

200

display all the rows in the descending order of hire date(hdt) from employee table

select * from employee

order by hdt desc;

200

Display all the rows from employee table where the second letter in the employee name(enm) is 'H'

select * from employee

where enm like '_H%';

200

Display the permanent account number(pan), income tax(inc) and 10% of income tax as 'Surcharges' from tax table

select pan,inc,inc*.10 as surcharges from tax;

300

Display all the rows from the table tax where name(enm) contains 'B'

select * from tax

where enm like'%B%';

300

Display all the rows from table customer where the customer number(cno) is divisible by 4

select * from customer 

where mod(cno,4);

300

display roll number(rno), student name(snm) and marks(mrks) of students born before date(dt) march 10,1998 from table student

select rno,snm,mrks

from student

where dt<'1998-03-10';

300

display roll no(rno), student name(snm) and marks(mrks) from student table where student name (snm) is 'Aditya chopra' 

select rno,snm,mrks

from student

where snm='Aditya chopra';

300

Display all the rows from the table student where the first letter of student name(snm) is 'F'

select * from student

where snm like'F%';

400

display employee number(eno) and bonus(bonus) in the ascending order of employee number from table incent

select eno,bonus from incent

order by eno , bonus;

400

display total number of deposits and maximum amount deposited from table deposit(acno,cname,d_amt,ddate,p_dep) 

select count(acno),max(d_amt)

from deposit;

400

display customers name(cnm) in capital letters, year of deposit(yod) and the amount deposited(amt) from deposit

select upper(cnm),yod,amt

from deposit;

400

display the customer name(cnm) and amount deposited(amt) where the amount deposited is either 100000 or 300000 from deposit table

select cnm,amt

from deposit

where amt in(100000,300000);

400

increase the number of lectures attended(ltotal) by all the students by 5 in attend table

update attend

set ltotal=lotatl+5;

500
add a new column division(divi,character with fixed size 1) to table TYCLASS after name(snm) 

alter table tyclass

add divi char(1) after snm;

500

explain dayname() function with definition,syntax and example

dayname() function is used to find the name of the day from the given date

select dayname(date);

select dayname('2019-07-23');

o/p: Tuesday

500

display the structure of table tyclass

desc tyclass;

500

rename the table tyclass to tybcomclass

rename table tyclass to tybcomclass;

500

display all the rows from the table travel where the passenger's name(pnm) starts with 'a' and ends with 't'

select * from travel

where pnm like'a%t';