Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 50

INFO

Name
Email ID
Contact No.

General Instructions
1 Save the filename in the format given below
Zivame PA Test_<Test Date in YYYYMMDD>_<Name>.xlsx
Eg: Test Date is 15-Dec-2022 and Name is Samantha Queen, then save the filename as
Zivame PA Test_20221215_Samantha Queen.xlsx

There are 4 Sections for the test

Section Time Limit (min) # of Questions


SQL Section A 10 6
SQL Section B 40 7
Excel Section A 10 6
Excel Section B 30 3
Total 90 22
he filename as
SQL SECTION A

Table: Customers
Customer_ID Cust_First_Name Cust_Last_Name Cust_Middle_Name Cust_Suffix

Write SQL queries for below questions (Time: 10 minutes)

A1 Get First name, Last name and Suffix of the Customers who doesn't have Suffix as NULL

A2 Get Customers who are having middle name as NULL

A3 Get customers whose phone number starts with digit 9 and having 555 as continuous digits in the number and ends wi

A4 Get customers having first name as ‘Samantha’

A5 Get the Customers whose Firstname starts with “Y” and last name ends with “Y”

A6 Get the Customers whose Firstname starts with “J”, "K", "L" or “M”
Cust_Phone_No

the number and ends with 9


SQL SECTION B

Table: Employees
Employee_ID First_Name Last_Name Joining_Date

Table: Departments
Department_ID Department_Name Manager_ID Location_ID

Sample Data is given in 'Table Data' sheet

Write SQL queries for below questions (Time: 40 minutes)

B1 Get the employee ID, names of the employees in 'first_name last_name' format who work in the state of Karnataka

Get employee ID, employee name (first name + last name), employee_joining_month, employee_salary, manager_
B2

B3 Get the names and locations for all departments, average salary and number of employees working in each departm
Sample Output:
Department_ID Department_Name Location_Country Location_State

B4 Display as shown in output below - list of all employees in the department that has highest department average sal
Sample Output
Employee_ID Employee_Name Department_Name Employee_Salary
Sort in descending
B5 Display list of all employees (employee ID and employee name) whose joining date is higher than the manager's joi

B6 Display list of all employees whose salary is higher than location_state's average salary and employee tenure is less
Sample Output
Employee_ID Employee_Name Location_Country Location_State

B7 Rank all employees based on salary by country and department


Sample Output
Employee_ID Employee_Name Location_Country Department_Name
SQL SECTION B

Salary Manager_ID Department_ID

Table: Locations
Location_ID Location_City Location_State

who work in the state of Karnataka

onth, employee_salary, manager_ID, manager name (first name + last name), manager_joining_month, manager_salary

employees working in each department

Location_City Dept_salary_avg # of Employees

as highest department average salary. Also sort data in descending order of their salaries
te is higher than the manager's joining date

salary and employee tenure is less than 3 years

Employee_Salary Employee_Tenure
Show Tenure in months

Employee_Salary Employee_Rank
Location_Country

ing_month, manager_salary
Table: Employees

Employee_ID First_Name Last_Name Joining_Date


100 Samantha Queen 2011/06/17
101 Neena Kochhar 2011/06/18
102 Lex De Haan 2011/06/19
103 Alexander Hunold 2011/06/20
104 Bruce Ernst 2011/06/21
105 David Austin 2011/06/22
106 Valli Pataballa 2011/06/23
107 Diana Lorentz 2011/06/24
108 Nancy Greenberg 2011/06/25
109 Daniel Faviet 2012/06/26
110 John Chen 2012/06/27
111 Ismael Sciarra 2012/06/28
112 Jose Manuel Urman 2012/06/29
113 Luis Popp 2012/06/30
114 Den Raphaely 2012/07/01
115 Alexander Khoo 2012/07/02
116 Shelli Baida 2012/07/03
117 Sigal Tobias 2013/07/04
118 Guy Himuro 2013/07/05
119 Karen Colmenares 2013/07/06
120 Matthew Weiss 2013/07/07
121 Adam Fripp 2013/07/08
122 Payam Kaufling 2013/07/09
123 Shanta Vollman 2013/07/10
124 Kevin Mourgos 2013/07/11
125 Julia Nayer 2013/07/12
126 Irene Mikkilineni 2013/07/13
127 James Landry 2013/07/14
128 Steven Markle 2013/07/15
129 Laura Bissot 2014/07/16
130 Mozhe Atkinson 2014/07/17
131 James Marlow 2014/07/18
132 TJ Olson 2014/07/19
133 Jason Mallin 2014/07/20
134 Michael Rogers 2014/07/21
135 Ki Gee 2014/07/22
136 Hazel Philtanker 2014/07/23
137 Renske Ladwig 2014/07/24
138 Stephen Stiles 2015/07/25
139 John Seo 2015/07/26
140 Joshua Patel 2015/07/27
141 Trenna Rajs 2015/07/28
142 Curtis Davies 2015/07/29
143 Randall Matos 2015/07/30
144 Peter Vargas 2015/07/31
145 John Russell 2016/08/01
146 Karen Partners 2016/08/02
147 Alberto Errazuriz 2016/08/03
148 Gerald Cambrault 2016/08/04
149 Eleni Zlotkey 2016/08/05
150 Peter Tucker 2016/08/06
151 David Bernstein 2016/08/07
152 Peter Hall 2017/08/08
153 Christopher Olsen 2017/08/09
154 Nanette Cambrault 2017/08/10
155 Oliver Tuvault 2017/08/11
156 Janette King 2017/08/12
157 Patrick Sully 2017/08/13
158 Allan McEwen 2017/08/14
159 Lindsey Smith 2017/08/15
160 Louise Doran 2018/08/16
161 Sarath Sewall 2018/08/17
162 Clara Vishney 2018/08/18
163 Danielle Greene 2018/08/19
164 Mattea Marvins 2018/08/20
165 David Lee 2018/08/21
166 Sundar Ande 2018/08/22
167 Amit Banda 2019/08/23
168 Lisa Ozer 2019/08/24
169 Harrison Bloom 2019/08/25
170 Tayler Fox 2019/08/26
171 William Smith 2019/08/27
172 Elizabeth Bates 2019/08/28
173 Sundita Kumar 2019/08/29
174 Ellen Abel 2019/08/30
175 Alyssa Hutton 2019/08/31
176 Jonathon Taylor 2019/09/01
177 Jack Livingston 2019/09/02
178 Kimberely Grant 2019/09/03
179 Charles Johnson 2019/09/04
180 Winston Taylor 2019/09/05
181 Jean Fleaur 2020/09/06
182 Martha Sullivan 2020/09/07
183 Girard Geoni 2020/09/08
184 Nandita Sarchand 2020/09/09
185 Alexis Bull 2020/09/10
186 Julia Dellinger 2020/09/11
187 Anthony Cabrio 2020/09/12
188 Kelly Chung 2020/09/13
189 Jennifer Dilly 2020/09/14
190 Timothy Gates 2020/09/15
191 Randall Perkins 2020/09/16
192 Sarah Bell 2020/09/17
193 Britney Everett 2020/09/18
194 Samuel McCain 2020/09/19
195 Vance Jones 2020/09/20
196 Alana Walsh 2020/09/21
197 Kevin Feeney 2020/09/22
198 Donald OConnell 2020/09/23
199 Douglas Grant 2020/09/24
200 Jennifer Whalen 2020/09/25
201 Michael Hartstein 2020/09/26
202 Pat Fay 2020/09/27
203 Susan Mavris 2020/09/28
204 Hermann Baer 2020/09/29
205 Shelley Higgins 2020/09/30
206 William Gietz 2020/10/01
Salary Manager_ID Department_ID
2,400,000 0 90
1,700,000 100 90
1,700,000 100 90
900,000 102 60
600,000 103 60
480,000 103 60
480,000 103 60
420,000 103 60
1,200,000 101 100
900,000 108 100
820,000 108 100
770,000 108 100
780,000 108 100
690,000 108 100
1,100,000 100 30
310,000 114 30
290,000 114 30
280,000 114 30
260,000 114 30
250,000 114 30
800,000 100 50
820,000 100 50
790,000 100 50
650,000 100 50
580,000 100 50
320,000 120 50
270,000 120 50
240,000 120 50
220,000 120 50
330,000 121 50
280,000 121 50
250,000 121 50
210,000 121 50
330,000 122 50
290,000 122 50
240,000 122 50
220,000 122 50
360,000 123 50
320,000 123 50
270,000 123 50
250,000 123 50
350,000 124 50
310,000 124 50
260,000 124 50
250,000 124 50
1,400,000 100 80
1,350,000 100 80
1,200,000 100 80
1,100,000 100 80
1,050,000 100 80
1,000,000 145 80
950,000 145 80
900,000 145 80
800,000 145 80
750,000 145 80
700,000 145 80
1,000,000 146 80
950,000 146 80
900,000 146 80
800,000 146 80
750,000 146 80
700,000 146 80
1,050,000 147 80
950,000 147 80
720,000 147 80
680,000 147 80
640,000 147 80
620,000 147 80
1,150,000 148 80
1,000,000 148 80
960,000 148 80
740,000 148 80
730,000 148 80
610,000 148 80
1,100,000 149 80
880,000 149 80
860,000 149 80
840,000 149 80
700,000 149 80
620,000 149 80
320,000 120 50
310,000 120 50
250,000 120 50
280,000 120 50
420,000 121 50
410,000 121 50
340,000 121 50
300,000 121 50
380,000 122 50
360,000 122 50
290,000 122 50
250,000 122 50
400,000 123 50
390,000 123 50
320,000 123 50
280,000 123 50
310,000 124 50
300,000 124 50
260,000 124 50
260,000 124 50
440,000 101 10
1,300,000 100 20
600,000 201 20
650,000 101 40
1,000,000 101 70
1,200,000 101 110
830,000 205 110
Table: Departments

Department_ID Department_Name Manager_ID Location_ID


10 Administration 200 1700
20 Marketing 201 1800
30 Purchasing 114 1700
40 Human Resources 203 2400
50 Shipping 121 1500
60 IT 103 1400
70 Public Relations 204 2700
80 Sales 145 2500
90 Executive 100 1700
100 Finance 108 1700
110 Accounting 205 1700
120 Treasury 0 1700
130 Corporate Tax 0 1700
140 Control and Credit 0 1700
150 Shareholder Services 0 1700
160 Benefits 0 1700
170 Manufacturing 0 1700
180 Construction 0 1700
190 Contracting 0 1700
200 Operations 0 1700
210 IT Support 0 1700
220 NOC 0 1700
230 IT Helpdesk 0 1700
240 Government Sales 0 1700
250 Retail Sales 0 1700
260 Recruiting 0 1700
270 Payroll 0 1700
Table: Locations

Location_ID Location_City Location_State


1000 Seattle Washington
1100 Toronto Ontario
1200 Tokyo Tokyo
1300 Southlake Texas
1400 Hyderabad Telangana
1500 New Delhi New Delhi
1700 Bangalore Karnataka
1800 Mumbai Maharashtra
2000 Beijing Beijing
2100 San Fancisco California
2200 Sydney New South Wales
2400 Singapore Singapore
2500 London London
2700 Manchester Manchester
Location_Country
USA
CA
Japan
USA
India
India
India
India
China
USA
Australia
Singapore
UK
UK
EXCEL SECTI

Answer the below questions (Time: 10 minutes)

Q.1) Extract the Country, Region/State and City from the given key string

Key String Country


India-Delhi-Delhi
India-Karnataka-Bengaluru
India-Maharashtra-Mumbai
India-Telangana-Hyderabad
India-Tamil Nadu-Chennai
India-West Bengal-Kolkata
India-Andhra Pradesh-Visakhapatnam
USA-District of Columbia-Washington
USA-New York-New York
USA-California-Los Angeles
USA-Illinois-Chicago
USA-Texas-Houston
USA-Massachusetts-Boston

Q.2)

Q.3) Paul entered the following formula into a cell but it keeps popping up with an error. The formula he entered is: =IF(B
a) =IF(B9>500,IF(F9="Yes",B9*B20,B9*B21),"Empty") – the comma before the last argument was missing.
b) =IF(B9>500,IF(F9,="Yes",B9*B20,B9*B21)"Empty") – the comma after F9 in the nested IF was missing.
c) =IF(B9>500,=IF(F9="Yes",B9*B20,B9*B21)"Empty") – the equal sign before the nested IF was missing.
d) None of the options listed above are correct.
Ans

Q.4)

Q.5) Product MRP


ZI123 294
ZI124 366
ZI125 288
ZI126 326
ZI127 466
ZI128 250
ZI129 301
ZI130 445
ZI131 487
ZI132 477
ZI133 385
ZI134 285
ZI135 202
ZI136 466
ZI137 435
ZI138 439
ZI139 305
ZI140 390
ZI141 215
ZI142 466
ZI143 282
ZI144 474
ZI145 229
ZI146 415
ZI147 248
ZI148 340
ZI149 354
ZI150 350
ZI151 297
ZI152 373
ZI153 487

Q.6) Laura has a list of the SAT scores of over a thousand students. She needs to write to the top 10 students but exclude
a) Laura can add two levels to Sort by, first sorting by score and then sorting by school.
b) Laura can use the Find function to find all the students who attended each school and their score.
c) Laura can Sort the scores, cut and paste it into a new sheet and then use the Sort function again to organize them
d) Laura can apply a Filter for the top 10 students and a Filter for which schools to exclude from the results.
Ans
EXCEL SECTION A

Region/State City

Study the screenshot above. Which of the formulas in the options listed below, when entered
to the student’s Owing amount, if they still owe $5,000 or more on their yearly fees? This fo
a) =SUMIF(D2>=5000,D2+500)
b) =IF(>=5000,D2=500)
c) I=SUMIF(D2>=5000,500)
d) =IF(D2>=5000,D2+500)

Ans

p with an error. The formula he entered is: =IF(B9>500,IF(F9="Yes",B9*B20,B9*B21)"Empty"). Which of the following is the corrected ve
before the last argument was missing.
after F9 in the nested IF was missing.
gn before the nested IF was missing.

Study the screenshot in left. Which function in Excel can you use to separate the names and s
a) Use the Concatenate function to separate the names and surnames.
b) Use the Trim function to separate the names and surnames.
c) Use the Split Column function to separate the names and surnames.
d) Use the Text to Columns function to separate the names and surnames.
Ans

Selling Price Discount In the table given in left, perform following opera
218 26% 5.1 Highlight all MRPs greater than
170 54% 5.2 Highlight all Selling Prices betwe
221 23% 5.3 Apply Green White Color Scale i
229 30% 5.4 Highlight all products (not MRP
169 64%
180 28%
183 39%
176 60%
221 55%
248 48%
204 47%
231 19%
157 22%
164 65%
168 61%
151 66%
227 26%
189 52%
165 23%
223 52%
172 39%
222 53%
200 13%
172 59%
194 22%
151 56%
222 37%
221 37%
150 49%
201 46%
167 66%

needs to write to the top 10 students but exclude students that come from specific schools. How can she quickly get this list together?
n sorting by school.
nded each school and their score.
hen use the Sort function again to organize them by school.
hich schools to exclude from the results.
sted below, when entered into the cell highlighted (E2) in yellow in this screenshot, will add a Late Penalty of $500
their yearly fees? This formula can then be copied down to the cells below the highlighted cell.

lowing is the corrected version?


separate the names and surnames contained in column A (Name) so that each surname appears in the adjoining cell in column B (Surnam

, perform following operations using conditional formatting


ght all MRPs greater than 300
ght all Selling Prices between 180 and 200
Green White Color Scale in Discount column
ght all products (not MRP and Selling Price) which have MRP > 300 and Selling Prices between 180 and 200
y get this list together?
oining cell in column B (Surname)?
EXCEL SECTION B

Answer the below questions (Time: 30 minutes)

B1 Go to Excel Section B - Question 1

B2 Using the Excel B1 as Source Data, create Pivot Table as shown below in 'Excel B2 Pivot' sheet
Location_Country Location_State Location_City Department_Name

India Karnataka Bangalore Accounting


India Karnataka Bangalore Administration
India Karnataka Bangalore Executive
India Karnataka Bangalore Finance
India Karnataka Bangalore Purchasing
India Maharashtra Mumbai Marketing
India New Delhi New Delhi Shipping
India Telangana Hyderabad IT
Singapore Singapore Singapore Human Resources
UK London London Sales
UK Manchester Manchester Public Relations
Grand Total

B3 Go to Excel Section B - Question 3


EXCEL SECTION B

2 Pivot' sheet
Count of Average of Salary
Employee_ID
2 1,015,000
1 440,000
3 1,933,333
6 860,000
6 415,000
2 950,000
45 347,556
5 576,000
1 650,000
35 890,000
1 1,000,000
107 646,168
EXCEL SECTION B - Question 1

Please use Lookup, Index, Match and other Excel functions and fill the below table completely
First 5 entries are filled completely for your reference
Reference Source Data is given in 'Table Data' sheet

Employee_ID First_Name Last_Name Employee Name

100 Samantha Queen Samantha Queen


101 Neena Kochhar Neena Kochhar
102 Lex De Haan Lex De Haan
103 Alexander Hunold Alexander Hunold
104 Bruce Ernst Bruce Ernst
105 David Austin David Austin
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
le completely

Joining_Date Joining Year Month Salary Manager_ID

2011/06/17 201106 2,400,000 0


2011/06/18 201106 1,700,000 100
2011/06/19 201106 1,700,000 100
2011/06/20 201106 900,000 102
2011/06/21 201106 600,000 103
2011/06/22 201106 480,000 103
Manager Joining Year
Manager Name Manager Salary Department_ID
Month
NA NA NA 90
Samantha Queen 201106 2,400,000 90
Samantha Queen 201106 2,400,000 90
Lex De Haan 201106 1,700,000 60
Alexander Hunold 201106 900,000 60
Alexander Hunold 201106 900,000 60
Department_Name Location_ID Location_City Location_State

Executive 1700 Bangalore Karnataka


Executive 1700 Bangalore Karnataka
Executive 1700 Bangalore Karnataka
IT 1400 Hyderabad Telangana
IT 1400 Hyderabad Telangana
IT 1400 Hyderabad Telangana
Location_Country

India
India
India
India
India
India
EXCEL SECTION B - Question 2 Answer Pivot

Please put the Pivot starting in cell A6

Pivot Table
EXCEL SECTION B - Question 3

Write a formula to get the Discount rate (column D) for a particular Order ID (column A) according to Order Amount (column B
The logic for Discounts is in Columns H to J.
Then calculate the Order Amount with Discount (column E).

Order ID Order Amount Date Discount Rate Order Amount with


Discount
1 77,520.00 10/14/2020
2 24,915.00 10/15/2020
3 3,895.00 10/16/2020
4 9,836.00 10/17/2020
5 99,346.00 10/18/2020
6 30,803.00 10/19/2020
7 20,429.00 10/20/2020
8 47,784.00 10/21/2020
9 79,307.00 10/22/2020
10 63,241.00 10/23/2020
11 33,398.00 10/24/2020
12 33,246.00 10/25/2020
13 39,227.00 10/26/2020
14 92,672.00 10/27/2020
15 86,214.00 10/28/2020
16 99,791.00 10/29/2020
17 19,994.00 10/30/2020
18 45,433.00 10/31/2020
19 103,594.00 11/1/2020
20 6,622.00 11/2/2020
21 48,940.00 11/3/2020
22 86,615.00 11/4/2020
23 28,203.00 11/5/2020
24 105,791.00 11/6/2020
25 74,013.00 11/7/2020
26 13,007.00 11/8/2020
27 88,907.00 11/9/2020
28 16,664.00 11/10/2020
29 87,123.00 11/11/2020
30 10,692.00 11/12/2020
ding to Order Amount (column B).

Order Amount Discount Tiers

$0.00 0.00% 0.00-999.99


$1,000.00 2.00% 1,000.00-4,999.99
$5,000.00 5.00% 5,000.00-9,999.99
$10,000.00 7.00% 10,000.00-19,999.99
$20,000.00 8.00% 20,000.00-49,999.99
$50,000.00 10.00% 50,000.00-99,999.99
$100,000.00 15.00% 100,000.00+

You might also like