Day3 Live
Day3 Live
4 -->
2 tech mcq 2
3 tech coding test
data structure : 30 min
4 group discussion
10 min
topics :
pandamic
AI
globalization
population in india
woman empowerment
IOT
resce
attendance comp in edu
digital
5 hr interview
=================================================================
--display the all details other than smith , jones and allen
select * from emp
where ename not in ('smith', 'jones', 'allen')
--display the all details who are not working for deptno 10, 20
select * from emp
where deptno not in (10, 20)
eg : gmail sever
login : priti
pass : 123
13. Nonsubversion Rule
bypass the integrity rules or constraints is not allowed
eg pk , fk;
====================
ename like '%m%'
--predicates
1 in : exact mathc
2 between : range
3 like : search for the pattern
--between
--eg display name of emp earning the sal >= 1000 and <= 3000
select ename, sal from emp
where sal >= 1000 and sal <=3000;
or
select ename, sal from emp
where sal between 1000 and 3000;
---------|----------|----------
1000 3000
--eg display name of emp earning the sal < 1000 and > 3000
select ename, sal from emp
where sal not between 1000 and 3000;
=====================================
Execution plan -->
select ename from emp
where ename ='smith';
plan 1 : 3s
plan 2 2.5s
plan 3 1 s
plan 4 5s
--ends with R
select ename from emp
where ename like '%R';
--anywhere A
select ename from emp
where ename like '%A%';
--ename should be 5 ch
select ename from emp
where ename like '_____';
===========
--display first 3 records
select * from emp
limit 3;
--order by :
used to sort the record
--4 expression
select ename name , sal + 5000 as newsal ,comm commission
from emp
order by sal + 5000;
===
select ename name , sal + 5000 as newsal ,comm commission
from emp
where sal > 2000
order by newsal;
--1
select * from emp where
job ='clerk' ;
--2
select * from emp where
job in ('clerk','manager', 'analyst') ;
==aggregate functions
called as MRF --> multiple row functions
it is used to create the summary report
1 sum()
2 min()
3 max()
4 avg()
5 count()
--14
select count(*) from emp;
--4
select count(comm) from emp;
null values are not counted
== group by clause
it is used to group the records
select deptno, count(empno) totemp
from emp
group by deptno;
deptno totemp
10 4
20 6
30 5
--department wise calculat the min sal, max sal
wise --> use group by
select deptno, min(sal) , max(sal) totemp
from emp
group by deptno
order by deptno;
job totemp
clerk 3
manager 4
salesman 6
president 1
analyst 3
--tomo
having
data type
er models
database objects
==================
--changing the heading of the col
select ename , sal + 3000 newsal , hiredate
from emp |
|
alias
--display the ename , sal, comm , change ename as name and comm as commission
select ename name , sal ,comm commission
from emp;
===========================
--using alias : +
--tomo
data types
ER diagrams
aggr fun
constraints
alter
===