Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
join ans
CREATE TABLE EMP (EMPID INT, EMPNAME CHAR(20), MANAGERELD INT, HIREDATE DATE ); INSERT INTO EMP( EMPID, EMPNAME, MANAGERELD, HIREDATE ) VALUES ( 101, 'TARUN malik', 321, '20/feb/2014'), (102, 'POPU sharma ', 322, '30/jan/2015'), (103, 'HARSH chaudhary', 323, '27/nov/2016'), (104, 'shubham chaudhary',324,'20/mar/2016'); SELECT * FROM EMP; CREATE TABLE EMPSAL( EMPID INT, SAL INT, PROJECT VARCHAR(20)); INSERT INTO EMPSAL( EMPID, SAL, PROJECT) VALUES( 101, 8000, 'P1'), (102, 1000, 'P2'), (103, 12000, 'P1'); SELECT * FROM EMPSAL; /*select count(*) from emp join empsal on emp.empid=empsal.empid where project='p1'; select empname, sal from emp join empsal on emp.empid=empsal.empid where sal >1000 and sal<12000; select count(*), project from empsal group by project order by project desc; select substring('tarun malik',0, charindex(' ', 'tarun malik')); select empname , sal from emp left join empsal on emp.empid=empsal.empid; select distinct empname from emp join empsal on emp.empid=empsal.empid; select empname, sal from emp right join empsal on emp.empid=empsal.empid; select empname from emp where empid%2=0;*/
run
|
edit
|
history
|
help
0
Count by days
How to find 2nd highest salary
ElaineBrown**
Stored procedure
Week 6 Data Base IET
Practice
QLSV
Select empID whose salary is greater than their managers
/Users/svetlanakanevskaa/Downloads/ACDB_LIGHT_MS.sql
Libros