Searching...
Friday, 2 November 2012

My Sql : Joins

9:45 am

Joins

TABLE1.CREATE TABLE EMP(EMPNO INT(10) PRIMARY KEY, ENAME VARCHAR(20), SAL FLOAT(10,2),DEPTNO INT(2));
TABLE2. CREATE TABLE DEPT(DEPTNO INT(2) PRIMARY KEY,DNAME VARCHAR(20), LOC VARCHAR(20));
TABLE1: INSERT INTO EMP(EMPNO,ENAME,SAL,DEPTNO) VALUES(101,’CHANDU’,123.45,10),(102,’KARANAM’,124.34,20),(103,’ASWINI’,145.23,10);
TABLE2:INSERT INTO DEPT(DEPTNO,DNAME,LOC) VALUES(10,’TECHNICAL’,’HYD’),(20,’ACCOUNTS’,’CHANNAI’);

SELECT E.EMPNO , E.ENAME,E.ESAL,E.DEPTNO,D.DNAME,D.LOC FROM EMP E , DEPT D WHERE E.DEPTNO = D.DEPTNO;

1 comments:

  1. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your..
    SEO Company in India

    ReplyDelete