0% found this document useful (0 votes)
10 views10 pages

Interview Sheet

Here are the SQL queries to derive the output from the given tables: 1) Zone wise aggregation on premium where premium must be more than 5000 and zone aggregation value more than 100000 select r.zone, r.value from (select zone, sum(premium) value from table where premium > 5000 group by zone) r where r.value > 100000; 2) Count of office above average premium select count(office) from table where premium > (select avg(premium) from table); 3) TOP 2 records by each zone select * from (select zone, premium, rank() over(partition by zone order by premium desc) rank from table) where rank <= 2;

Uploaded by

rahul4.dwivedi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views10 pages

Interview Sheet

Here are the SQL queries to derive the output from the given tables: 1) Zone wise aggregation on premium where premium must be more than 5000 and zone aggregation value more than 100000 select r.zone, r.value from (select zone, sum(premium) value from table where premium > 5000 group by zone) r where r.value > 100000; 2) Count of office above average premium select count(office) from table where premium > (select avg(premium) from table); 3) TOP 2 records by each zone select * from (select zone, premium, rank() over(partition by zone order by premium desc) rank from table) where rank <= 2;

Uploaded by

rahul4.dwivedi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Test Total Marks Candidate Score Result

Excel 10 0%
Logical 5 0%
SQL Test 1 15 0%
SQL Test 2 5 0%
Total 35 0 0%
s.no Question Marks Candidate Answer Result
1 Name any 5 Excel Formulas 1

2 What is Vlookup and how you use it 1

3 Which function is employed to trap and handle errors in excel? 1

What is Index formula and What is Index Match and how it is


4 different from Vlookup 1
5 How can you find end date of current month in excel 1
What do you mean by Relative cell referencing and Absolute cell
6 referencing in MS Excel? 1

7 What is wildcards and how many wildcards are available in Excel? 1

What is the differences between COUNT, COUNTIF, COUNTA and


8 COUNTBLANK. 1

9 Explain the difference between SUBSTITUTE and REPLACE in excel.


10 What are Logical functions available in excel 1
Candidate
s.no Question Marks Answer

1 If today is Monday, what would be the day after 61 days? 1

2 What is the sum of numbers from 1 to 100? 1


A Monkey starts climbing 11 feet pole at 10 AM, he climbs 3 feet and slips by 1 feet in one hour. At what time
3 he will reach the top of the pole? 1

4 How do you cut a Cake in 8 pieces by cutting in 3 times only 1

There are 3 temples and also there are one pond in front of all 3 temples, you start with few flowers, you wash
flowers in pond at first temple, the flowers become double, then you devote few flowers in first temple, you
exit with leftover flowers from first temple, you wash flowers in pond at second temple, the flowers become
double, then you devote few flowers in second temple, you exit with leftover flowers from second temple, you
wash flowers in pond at third temple, the flowers become double, then you devote few flowers in third temple,
when you exit from third temple you have nothing left. how many flowers you had in starting and how many
flowers you devoted in each of the temple.
5 Note: you devoted equal amount of flowers in each of the temple. 1
Result

###
S.No Task To do Tables Marks

How many Unique Orders are placed by Customer


5880 between Jan 01-10; Group the orders by Date
1 Table 01-03 3
and Sum the Total Order Value- Ensure the date is in
the Date format

How many Unique orders have been placed by


2 Customers from HR State between Jan 01-10. What is Table 01-03 3
the Total Order Value. Group by Customer City

Write a query to extract the Item wise Total Amount


where the State is HR, Item Category is Apparel, Date
3 Table 01-03 3
range is between Jan 01-10 and Amount range is
101-600

For the above query rather than Jan 01-10 extract the
4 Table 01-03 2
data for Current date - 100 days

Write a SQL query to fetch Project wise count of


5 Table 04-05 2
employees sorted by Project ID in descending order.

Write a query to fetch employee names and salary


6 records. Return employee details even if the salary Table 04-05 2
record is not present for the employee
Candidate Ans Result
Table 01 Table 02
Order Id Order Date Customer Id Amount Item Description Customer Id Customer City Customer State
6896629 9-Jan-19 5880 1256 Running Shoes 5880 Gurgaon HR
6896730 11-Jan-19 5880 1142 Stove 9462 Delhi DL
4914271 3-Feb-19 9462 1806 Shirt 2383 Noida UP
6952338 19-Jan-19 5880 456 Pants 3983 Meerut UP
5408296 11-Jan-19 9462 1802 Water Bottle 8174 Delhi DL
3876275 4-Mar-19 2383 170 Football 7990 Manesar HR
6990888 12-Feb-19 3983 314 Walking Shoes 5466 Pune MH
2722003 8-Jan-19 9462 1233 Photo Frame 5649 Gurgaon HR
6896629 9-Jan-19 5880 1926 Shorts 2194 Hisar HR
3537549 5-Jan-19 9462 1238 Phone
8189606 8-Jan-19 5880 308 Charger
7669768 2-Jan-19 8174 726 Socks
2343842 7-Jan-19 9462 161 Skipping Rope
6896515 21-Jan-19 3983 991 Wall Shelf
2447423 11-Jan-19 8174 532 Artificial Flowers
Table 05
EmpId Project ID Salary
121 P1 8000
321 P2 1000
421 P1 12000
Table 03 Table 04
Item Description Category EmpId FullName ManagerId DateOfJoining
Running Shoes Shoes 121 John Nash 321 1/31/2014
Shirt Apparel 321 Akash Singh 986 1/30/2015
Pants Apparel 421 Kuldeep Rana 876 27/11/2016
Water Bottle Kitchen 513 Sanjeev Kumar 812 17/05/2018
Football Sports
Walking Shoes Shoes
Photo Frame Home Decor
Shorts Apparel
Phone Mobile
Charger Mobile
Socks Apparel
Skipping Rope Sports
Wall Shelf Home Decor
Artificial Flowers Home Decor
Stove Kitchen
Write SQL to derive the output

1 Zone wise aggregation on premium where premium must be more than 5000 and zone aggregation value more than 100

Candidate Ans

Correct Ans select r.zone,r.value from (select zone,sum(primium) value from table where premium>5000 group by zone) r where r.value>1

2 Count of office above average premium

Candidate Ans

Correct Ans select count(office) from table where primium > average(primium);

3 TOP 2 records by each zone

Candidate Ans

select r.* from (select zone,premium,rank() over(partition by zone order by premium desc) rank from table order by zone,rank)
Correct Ans
rank<=2;
Table
one aggregation value more than 100000 Marks Result Office Zone Premium
ADEl1 South 250000
ADEl2 South 100000
ADEL3 West 300000
2 0
ADEL4 West 4000
000 group by zone) r where r.value>100000; ADEL5 West 40000
ADEl6 West 60000
Marks Result ADEL7 West 3000

1 0
e(primium);

Marks Result

2 0
c) rank from table order by zone,rank) r where

You might also like