select * from emp where sal>1000 group by  ;





select * from emp where sal>1000 group by deptno;





select deptno from emp where sal>1000 group by deptno;





select deptno,job from emp where sal>1000 group by deptno,job;


select deptno,job,sum(sal) from emp where sal>1000 group by deptno,job;



select deptno,job,count(*),sum(sal) from emp where sal>1000 group by deptno,job;



select sal+comm from emp group by; 





select saL+comm from emp where sal>1000 group by saL+comm;

select * from emp;
select * from dept;


select * from emp,dept;



select * from emp cross join dept;

select deptno,deptno_1 from emp,dept;



select deptno x,deptno_1 y from emp,dept;


select emp.deptno,dept.deptno from emp,dept;



select emp.deptno x,dept.deptno y from emp,dept;


select * from emp;
select * from dept;


select * from emp,dept where emp.deptno=dept.deptno;



select * from emp natural join dept;

select * from emp natural join emp;

select distinct * from emp natural join emp;


select * from emp a,emp b;

select a.empno,a.ename,a.job.... 
from emp a,emp b where a.empno=b.empno and a.ename=b.ename....and a.comm=b.comm.... and a.deptno=b.deptno;

select * from emp natural join sz;


select * from emp left outer join dept using(deptno);

select * from emp right outer join dept using(deptno);

select * from emp full outer join dept using(deptno);

select * from emp left outer join dept on (emp.deptno=dept.deptno);

select * from emp right outer join dept on (emp.deptno=dept.deptno);
select * from emp full outer join dept on (emp.deptno=dept.deptno);


select * from emp,dept where emp.deptno=dept.deptno (+);

select * from emp,dept where emp.deptno (+)=dept.deptno;
select * from emp,dept where emp.deptno (+)=dept.deptno (+);
-------------------------------------------------------------------------




rollback;


drop table silaszeret;

select * from sila.szeret;


create table silaszeret as select * from sila.szeret;

select * from silaszeret;
select * from sz;

drop table ujemp;

create table ujemp as select * from sila.emp;
select * from ujemp;
select * from emp;


desc sila.emp
desc ujemp

select * from emp;

select * from nikovits.cikk;
desc nikovits.cikk
create table ujcikk as select * from nikovits.cikk;
select * from ujcikk;
drop table ujcikk;

select * from nikovits.cikk where ;

create table ujcikk as select * from nikovits.cikk where
0=1;

desc ujcikk
select * from ujcikk;
drop table ujcikk;


create table empdept as select * from emp natural join dept;
select * from empdept;
drop table empdept;





create table bigyo
(
sorszam number,
nev varchar2(20),
szuldat date,
nem char(1),
fizetes number(8,2)
);

select * from bigyo;
drop table bigyo;

-- megszorítások ----------------------------------------------------------


create table bigyo
(
sorszam number primary key,
vnev varchar2(20) unique,
knev varchar2(20) unique,
szuldat date null,
nem char(1) check(nem in ('f','F','N')),
fizetes number(8,2) not null
);
select * from bigyo;
drop table bigyo;

create table bigyo
(
sorszam number,
vnev varchar2(20),
knev varchar2(20),
szuldat date default sysdate null,
nem char(1) check (upper(nem)='N' or nem='F' OR NEM='S'),
fizetes number(8,2) not null,
kieg number,
unique(vnev,knev),
check(fizetes+kieg>1000)
);

create table bigyo
(
sorszam number,
vnev varchar2(20),
knev varchar2(20),
szuldat date default sysdate null,
nem char(1) check (upper(nem)='N' or nem='F' OR NEM='S'),
fizetes number(8,2) not null check(fizetes>0),
potlek number,
primary key(vnev,knev),
check(fizetes+potlek>1000)
);

drop table bigyo;

alter table sz add column (m int);
