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
How do I start sql server?
How can you fetch alternate records from a table?
What do you understand by replication in sql server? Mention the different types of replication in sql server.
What are the different acid properties?
What are the dmvs? : sql server database administration
How do I change my passwords (database, LDAP, and so on) without causing an outage?
What is the importance of a recovery model?
What are .mdf files?
How many clustered indexes there can be on table ?
What types of Joins are possible with Sql Server?
What is the benefit of normalization?
What is RAID? What are the different types of RAID configurations?
application server is slow what may be the problem
Does order by actually change the order of the data in the tables or does it just change the output?
What is the significance of null value and why should we avoid permitting null values?