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
In which format does an image save in SQL Server database ?
What is the difference between ddl and dml?
Is null vs coalesce?
Explain a checkpoint?
What is the maximum length of an alert name?
What is page-level compression?
Why normalization is used?
Describe in brief databases and sql server databases architecture.
What is importing utility?
What are the triggers in sql?
What is difference between global temporary tables and local temporary tables?
What are the different authentication modes in sql server?
What are constraints in microsoft sql server?
What is an execution plan? When would you use it?
Explain how dts is used to extract, transform and consolidate data?