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

In which format does an image save in SQL Server database ?

1056


What is the difference between ddl and dml?

1098


Is null vs coalesce?

927


Explain a checkpoint?

1086


What is the maximum length of an alert name?

1038


What is page-level compression?

1009


Why normalization is used?

1068


Describe in brief databases and sql server databases architecture.

1065


What is importing utility?

1038


What are the triggers in sql?

1168


What is difference between global temporary tables and local temporary tables?

1280


What are the different authentication modes in sql server?

1167


What are constraints in microsoft sql server?

1215


What is an execution plan? When would you use it?

1026


Explain how dts is used to extract, transform and consolidate data?

1045