Skip to content

Instantly share code, notes, and snippets.

@sambhav2612
Last active February 6, 2018 07:07
Show Gist options
  • Save sambhav2612/0f5967dbe5eb980bad60b55925c27260 to your computer and use it in GitHub Desktop.
Save sambhav2612/0f5967dbe5eb980bad60b55925c27260 to your computer and use it in GitHub Desktop.
select * from emp33;
update dept33
set DNAME = 'Accounting'
where DNO = 10;
delete from dept33 where DNO = 60;
select ENO, ENAME from emp33 where MANAGER = null;
select ENO, ENAME from emp33 order by ENAME, ENO;
select * from emp33, dept33 where emp33.DNO = dept33.DNO;
select ENAME, DNAME from emp33 natural join dept33 where HIRE_DATE > '01/JAN/81';
select dname, dno, count(*) from emp33 natural join dept33 group by dname, dno having count(*) > 2;
//nested
select ename from emp33 where dno in (select dno from emp33 group by dno having count(*) > 1) order by ename;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment