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

How to create new databases with "create database" statements?

565


Determine how to use the inserted and deleted pseudo tables?

533


What are the steps you will take to improve the performance of a poor performing query?

593


What are the underflow and overflow behaviors on float literals?

572


What is use of except clause? How it differs from not in clause?

598






How do I make a resultset scrollable?

502


What are the difference between primary keys and foreign keys?

537


What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

487


What is the difference between char and varchar2 datatype in sql?

539


Can primary key be null?

511


How to find the source of a table in sql server?

523


How to move database physical files in ms sql server?

527


How would you add a section to a table?

563


What is the difference between a clustered index and a non-clustered index?

528


Difference between Logical Page and Physical Page in SSRS.

340