Integrated Project Access To Drinking Water
Integrated Project Access To Drinking Water
TEST
Correct Answer
Answered in 62.97 Minutes
Question 1/10
Explanation:
SELECT address
FROM employee
WHERE employee_name = 'Bello Azibo';
Question 2/10
Explanation:
Question 3/10
What is the source_id of the water source shared by the most number of people? Hint: Use a comparison
operator.
AmAs10911224
AkHa00036224
AkRu04862224
AkRu05603224
Explanation:
SELECT *
FROM water_source
WHERE number_of_people_served > 3997;
SELECT *
FROM water_source
ORDER BY number_of_people_served DESC;
Question 4/10
What is the population of Maji Ndogo?
Hint: Start by searching the data_dictionary table for the word 'population'.
27,628.1 people
Explanation:
SELECT *
FROM data_dictionary WHERE description LIKE
'%population%' ;
Gives:
column
table_name description
_name
The national
population size
global_water_access pop_n
estimate in
thousands
The urban
population share
global_water_access pop_u estimate in
percentage points
(%)
SELECT *
FROM global_water_access
WHERE name = 'Maji Ndogo';
Question 5/10
Which SQL query returns records of employees who areCivil Engineers residing in Dahabu or living on an
avenue?
SELECT *
FROM employee
WHERE position = 'Civil Engineer' AND
(province_name = 'Dahabu' OR address
LIKE '%Avenue%');
SELECT *
FROM employee
WHERE (position = 'Civil Engineer' AND
province_name = 'Dahabu') OR address
LIKE '%Avenue%';
SELECT *
FROM employee
WHERE position = 'Civil Engineer' AND
(province_name = 'Dahabu' OR address =
'Avenue');
SELECT *
FROM employee
WHERE position = 'Civil Engineer' AND
province_name = 'Dahabu' OR address
LIKE '%Avenue%';
Explanation:
Question 6/10
Create a query to identify potentially suspicious field workers based on an anonymous tip. This is the description
we are given:
The employee’s phone number contained the digits 86 or 11.
The employee’s last name started with either an A or an M.
The employee was a Field Surveyor.
Explanation:
SELECT employee_name
FROM employee
WHERE
(phone_number LIKE '%86%'
OR phone_number LIKE '%11%')
AND (employee_name LIKE '% A%'
OR employee_name LIKE '% M%')
AND position = 'Field Surveyor';
Question 7/10
What is the result of the following query? Choose the most appropriate description of the results set.
SELECT *
FROM well_pollution
WHERE description LIKE 'Clean_%' OR results = 'Clean' AND biological < 0.01;
Explanation:
Question 8/10
Which query will identify the records with a quality score of 10, visited more than once?
Explanation:
Question 9/10
You have been given a task to correct the phone number for the employee named 'Bello Azibo'. The correct
number is +99643864786. Write the SQL query to accomplish this. Note: Running these queries on the
employee table may create issues later, so use the knowledge you have learned to avoid that.
UPDATE employee
SET phone_number = '+99643864786'
WHERE employee_name = 'Bello Azibo';
UPDATE employee
SET phone_number = '+99643864786'
WHERE name = 'Bello Azibo';
UPDATE employee
SET phone_number = '+99643864786';
UPDATE employee
SET phone_number = +99643864786
WHERE employee_name = 'Bello Azibo';
Explanation:
Question 10/10
How many rows of data are returned for the following query?
SELECT *
FROM well_pollution
WHERE description
IN ('Parasite: Cryptosporidium', 'biologically contaminated')
OR (results = 'Clean' AND biological > 0.01);
634 rows
750 rows
5486 rows
570 rows
Explanation: