Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do I start sql server?

957


How can you fetch alternate records from a table?

946


What do you understand by replication in sql server? Mention the different types of replication in sql server.

932


What are the different acid properties?

1046


What are the dmvs? : sql server database administration

1043


How do I change my passwords (database, LDAP, and so on) without causing an outage?

1045


What is the importance of a recovery model?

1032


What are .mdf files?

922


How many clustered indexes there can be on table ?

1012


What types of Joins are possible with Sql Server?

1101


What is the benefit of normalization?

1061


What is RAID? What are the different types of RAID configurations?

1106


application server is slow what may be the problem

2206


Does order by actually change the order of the data in the tables or does it just change the output?

1120


What is the significance of null value and why should we avoid permitting null values?

968