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

Explain how to maintain a fill factor in existing indexes?

626


Why do we use non clustered index?

642


Which sql server is best?

610


What is ddl and dml commands?

587


How many files can a database contain in sql server?how many types of data files exists in sql server? How many of those files can exist for a single database?

742






What are a database and a data warehouse?

654


Can we insert data into view sql server?

616


What are partitioned views?

659


What are different types of raid levels?

638


How to backup encryption key ?

135


Is mysql better than sql server?

624


What is difference between primary key and foreign key?

561


What is log shipping? Can we do logshipping with SQL Server 7.0 ?

656


What is a database in ms sql server?

638


Explain the commands in sql server?

628