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
How to create new databases with "create database" statements?
Determine how to use the inserted and deleted pseudo tables?
What are the steps you will take to improve the performance of a poor performing query?
What are the underflow and overflow behaviors on float literals?
What is use of except clause? How it differs from not in clause?
How do I make a resultset scrollable?
What are the difference between primary keys and foreign keys?
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?
What is the difference between char and varchar2 datatype in sql?
Can primary key be null?
How to find the source of a table in sql server?
How to move database physical files in ms sql server?
How would you add a section to a table?
What is the difference between a clustered index and a non-clustered index?
Difference between Logical Page and Physical Page in SSRS.