please can anyone answer this query
Table 1 has 2 columns: EmployeeId,Age
Table 2 has 2 columns: EmployeeId, Region
Write SQL to Find the region who has the oldest person
Answer Posted / krishna murari chaubey
create table Employee(empId int,age int)
create table Area(empId int,Region varchar(20))
Use Inner Join
select e.empid,e.age,a.region from Employee e inner join
area a on e.empid=a.empid and e.age in
(select max(age) from Employee)
OR
select empid,region from area where empid in
(select empid from Employee where age
in(select max(age) from Employee))
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Why I am getting this error when dropping a database in ms sql server?
What are the advantages of passing name-value pairs as parameters?
Do you know what are the steps to process a single select statement?
1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do
How to fetch the next row from a cursor with a "fetch" statement?
How will you monitor replication activity and performance? What privilege do you need to use replication monitor? : sql server replication
What functions can a view be used to performed?
Why are views required in the sql server or in any other database?
What is the difference between having clause and where clause in sql server?
Explain tablesample?
Do you know what is fill factor and pad index?
What is the use of =,==,=== operators?
What is SQL Azure?
What is global temp table?
What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?