Here are the 2 questions asked in HackerRank SQL Intermediate Certification Exam, these 2 will be available in one attempt. The questions asked are Invoices Per Country and Product Sales Per City.

Hakerrank SQL Intermediate Certification Solutions

Invoices Per Country

SELECT co.country_name, count(*), AVG(i.total_price)
FROM country co, city ci, customer cu, invoice i
WHERE = ci.country_id AND = cu.city_id AND = i.customer_id
HAVING AVG(i.total_price) > (SELECT AVG(total price))

Product Sales Per City

SELECT ci.city_name, pr.product_name, ROUND(SUM(ii.line_total_price), 2) AS tot
FROM city ci, customer cu, invoice i, invoice_item ii, product pr 
WHERE = cu.city_id AND = i.customer_id AND = ii.invoice_id AND ii.product_id = 
GROUP BY ci.city_name, pr.product_name 
ORDER BY tot DESC, ci.city_name, pr.product_name 

I have taken HackerRank test on 3rd June 2022. Certificate can be viewed here.

You can also get HackerRank SQL Basic Certification Solutions – FREE SQL Certification

Categorized in: