0% found this document useful (0 votes)
2 views1 page

MY SQL

Uploaded by

chawlamanit14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

MY SQL

Uploaded by

chawlamanit14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

create database practicals;

use practicals;
create table teacher(NO int(10),NAME varchar(30),AGE INT (10), BRANCH
varchar(20),SALARY int (10), HIREDATE int(10), GENDER varchar(10));
insert into teacher values(1,'SUDHA',54,'ENG',12000,2022-12-23,'F');
insert into teacher values(2,'RAVI',41,'SCIENCE',23000,2021-07-08,'M');
insert into teacher values(3,'RISHABH',32,'LANGUAGE',20000,2022-09-21,'M');
insert into teacher values(4,'MINAL',25,'ENG',15000,2019-02-02,'F');
insert into teacher values(5,'GUNJAN',40,'ESTBL',47000,2021-11-25,'F');
insert into teacher values(6,'SARITA',29,'ENG',50000,2019-05-15,'F');
insert into teacher values(7,'RAMESH',34,'SCIENCE',30000,2021-06-20,'M');
insert into teacher values(8,'GARIMA',45,'LANGUAGE',29000,2021-07-19,'F');
SELECT * FROM teacher;

(i) select max(salary), min(salary), GENDER from teacher group by GENDER;


(ii)SELECT name from teacher where gender='F' and branch='ENG';
(iii)select name, salary from teacher order by salary;
(iv)select count(GENDER)"NO. OF TEACHERS", GENDER from teacher group by GENDER;
(v)select count(name) , branch from teacher where count(name)<3 groupby Branch;
(vi)select name, dayname(hiredate) from teacher;
(vii) select name, hiredate from teacher where monthname(hiredate)='september';

You might also like