JOINING THE TWO TABLES
create table employee(eno int primary key, ename varchar(20),salary money,deptid int references dept(deptid) )
create table dept(deptid int primary key,deptname varchar(20))
insert into dept values(101,'.NET')
insert into dept values(102,'JAVA')
insert into dept values(103,'Animation')
insert into employee values(1,'Pavan','10000',101)
insert into employee values(2,'Yuvaraj','20000',102)
insert into employee values(3,'Dhoni','30000',103)
select e.eno,e.ename,e.salary,d.deptid,d.deptname from employee e inner join dept d on e.deptid=d.deptid where eno=1
Tuesday, October 26, 2010
Thursday, January 21, 2010
Subscribe to:
Posts (Atom)