Professional Documents
Culture Documents
PubOps - Initial Assessment
PubOps - Initial Assessment
PubOps - Initial Assessment
Raghavendra K
Email: raghavendrak@aol.in
Using the table you have to find the average monthly salary and maximum monthly salary of the
employees with first letter of their names equal to A.
NOTE: Average monthly salary and Maximum monthly salary are guaranteed to be integers.
Input Format:
Table : Salaries
Field - Type
Name - string
Salary - integer
Output Format:
Field - Type
Average - integer
Maximum - integer
Sample Input:
Name - Salary
Akash- 360000
Saurabh - 240000
Shubham - 120000
Anand - 240000
Pratek - 480000
Sample Output:
Average - Maximum
300000 - 360000
Table Description:
batting_status: Batting status of the player for particular match_id. Batting status can only hold
two values: 1 or 0. 1 means player has got out in the match, 0 means player was not out in the
match.
You have to output a table consisting of name of each player and number of matches in which
the player remained not out (that is, count of match_id for which batting_status for that player is
0).
Input Format:
Table : Match_data
Field - Type
match_id - integer
name - string
batting_status - integer
Output Format:
Field - Type
name - string
not_out_count - integer
Sample Input:
20 - Dhawan - 0
65 - Rohit - 0
43 - Dhawan - 1
77 - Dhawan - 1
101 - Rohit - 0
Sample Output:
name - not_out_count
Dhawan - 1
Rohit - 2
Explanation:
GROUP BY g.matchid
4. You are analyzing the data of hackathons conducted on HackerEarth. You are given three tables:
Tag_info,Event_themes,Event_tags.
Table Description:
You have to output a table consisting of event_id,all tag names used in the event separated
by '#' (the tag whose id is less should come first), all theme names used in the event separated
by '#'(the theme names should be sorted alphabetically in increasing order). The table should be
sorted in increasing order of event_id.
Input Format:
Table : Tag_info
Field - Type
tag_id - integer
tag_title - string
Table : Event_themes
Field - Type
event_id - integer
theme_title - string
Table : Event_tags
Field - Type
event_id - integer
id - integer
Output Format:
Field - Type
event_id - int
tag_names - string
theme_names - string
Sample Input:
tag_id - tag_title
20 - Modelling
44 - Advertising
53 - Agriculture
event_id - theme_title
1 - Productivity
2 - Banking
1 - Fun
event_id - id
1 - 20
1 - 53
2 - 44
1 - 44
2 - 20
Sample Output:
1 - Modelling#Advertising#Agriculture - Fun#Productivity
2 - Modelling#Advertising - Banking
Explanation:
Event with event_id 1 has all three tags, the tags in output table are ordered by their ids.
SImilarly, theme_names are ordered in alphabetically increasing order in the output table. The
ne
output table is sorted in increasing order of event_id.
SELECT C.EVENT_ID,
LISTAGG(A.TAG_TITLE,
'#'),
This content is created by the owner of the form. The data you submit will be sent to the form owner. Microsoft is not responsible for the
privacy or security practices of its customers, including those of this form owner. Never give out your password.
LISTAGG(B.THEME_TITL
E, '#') WITHIN GROUP
(ORDER BY
C.EVENT_ID)
FROM TAG_INFO A,
EVENT_THEMES B,
EVENT_TAGS C
WHERE
B.EVENT_ID=C.EVENT_I
D