Their are two tables 'A' and'B'.Table 'A' contains 3 columns
named 'eid','ename','dept'.
Table 'B'contains 3 columns
named'sid','designation','salary'.
We have to retrieve the names of employees working in the
same department,same designation and same salary.
Its urgent can anyone help me out in this problem.

Answer Posted / patan

WE HAVE TABLE A (EID,ENAME,DEPT) AND TABLE B (NAMED,SID,DESIGNATION,SALARY)

--WE WANT TO RETRIEVE FOLLOWING
SELECT
B.NAMES AS NAMES
,B.DEPT AS DEPARTMENT
,B.SALARY AS SALARY
,B.DESIGNATION AS DESIGNATION

FROM TABLEA AS A
LEFT JOIN TABLEB AS B
ON A.EID=B.SID
ORDER BY B.NAMED


NOTE:WHEN WE ARE USING LEFT JOIN IT WILL MATCH THE RECORDS FROM BOTH THE TABLES AND LEFT TABLE OF RECORDS WILL DISPLAY...THAT ONLY I DID HERE

TRY IT..SURE IT WILL USEFUL

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You want to check the syntax of a complicated update sql statement without executing it. What command should you use?

482


What are the properties and different types of sub-queries?

558


Explain about nested stored procedure?

596


What are two difference between sql azure and azure tables?

137


What is clustered primary key?

548






Explain mixed authentication mode of sql server?

541


Can select statements be used on views in ms sql server?

580


What does ss stand for sexually?

582


What is difference between Datepart() and Datename() in SqlServer?

716


Is mysql better than sql server?

538


Tell me about pre-defined functions of sql?

691


How you can get a list of all the table constraints in a database?

511


ow to bring suspect mode datbase online from scratch

1403


What is the status of services on passive node for failover cluster in sql server? : sql server database administration

629


What is the contrast between sql and mysql?

592