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 / litmus rav

If there is many to many relationship between two tables
then this will work,

you need to create thired table name A_B with attributes
eid references A(eid),sid references B(sid)

SELECT * FROM A,B,A_B WHERE A.eid=A_B.eid AND B.sid=A_B.sid
AND ORDER BY ename;

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the properties of the relational tables?

643


What is a heap?

795


How fixed length strings are truncated and padded?

738


What is the difference between Clustered and Non-Clustered Index?

797


What are the two authentication modes in sql server?

802


What is transaction server consistency?

736


How do database indexes work?

742


how many clustered indexes can be created on a table? : Sql server database administration

790


Differentiate between mongodb vs. Sql server?

803


How does the report manager work in SSRS?

131


How to find tables without indexes?

802


What is 1nf 2nf?

778


If no size is defined while creating the database, what size will the database have?

751


Define candidate key, alternate key, and composite key.

705


Is null vs coalesce?

653