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 to move database physical files in ms sql server?

1035


what is raid? : Sql server database administration

1045


How to get a list of all tables with "sys.tables" view in ms sql server?

1036


What are the system database in sql server 2008?

1037


What is cross join in sql server joins?

1146


How to declare and use cursor variables?

1173


is there a column to which a default can't be bound? : Sql server database administration

1016


What does executeupdate return?

981


What is use of attribute hierarchy optimized state? : sql server analysis services, ssas

1064


Explain different types of lock modes in sql server 2000?

932


What is wide table?

951


What is reference section?

1009


What is a db view?

904


can you instantiate a com object by using t-sql? : Sql server database administration

1004


How to get the definition of a user defined function back?

1044