Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
new
CREATE TABLE EMP (EMPNO INT, EMPNAME CHAR(20), JOB CHAR(20), HIREDATE CHAR(20), SAL FLOAT, COMM FLOAT, DEPT_NO INT); INSERT INTO EMP (EMPNO,EMPNAME,JOB,HIREDATE,SAL,COMM,DEPT_NO) VALUES (320,'SUMIT KUMAR','ANALYST','14-MARCH-2019',50000,600,48), (322,'GITESH KUMAR','ASSISTANT MANAGER','14-APRIL-2019',40000,400,45), (305,'MUKESH KUMAR','PRESIDENT','10-MARCH-2010',100000,6008,01), (323,'HARSH','ANALYST','14-OCTOBER-2017',45000,1500,09), (329,'HARSHIT','ASSOCIATE ANALYST','14-MARCH-2019',40000,900,89), (31,'ARVIND','HR','14-JUNE-2010',49000,2000,51), (309,'SAJAL','SENIOR ANALYST','14-NOVEMBER-2009',40000,900,69); INSERT INTO EMP (EMPNO,EMPNAME,JOB,SAL) VALUES (320,'NAVEED','CLERK',50000); select * from emp; select empname from emp where job='analyst'; select count( distinct job)from emp; create table emp2( age int, empno int , address varchar (100) ); insert into emp2 values ( 24 , 320 , 'ggn'), ( 24, 323 , 'meerut' ), ( 23, 329 , 'delhi'); select * from emp2; select * from emp where empname ='harsh' and (job='clerk' or job='analyst'); select *from emp where not empname = 'harsh'; select *from emp order by job ,empname asc; select *from emp where comm is not null; update emp set job = 'sarkari' where empno = 320;
run
|
edit
|
history
|
help
0
NAMES CODE
Department revenue pivot
Microsoft SQL Server in 10 mn - Lesson 14 Joining Tables samples...
TEST 1
New
test
1
Status History
EXP 8 q2
sum vs count with multiple options in group by clause