__STYLES__
Tools used in this project
SQL Solution Samples

About this project

This is a series of queries I put together to practice and hone my SQL skills. See the tasks below:

BLUE

Assume you are given the tables below about Facebook pages and page likes. Write a query to return the page IDs of all the Facebook pages that don't have any likes. The output should be in ascending order.

Source: DataLemur

GREEN

Write a query identifying the type of each record in the TRIANGLES table using its three side lengths. Output one of the following statements for each record in the table: • Equilateral: It's a triangle with sides of equal length. • Isosceles: It's a triangle with sides of equal length. • Scalene: It's a triangle with sides of differing lengths. • Not A Triangle: The given values of A, B, and C don't form a triangle.

Source: HackerRank

RED/ORANGE

Generate the following two result sets:

  1. Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For example: AnActorName(A), ADoctorName(D), AProfessorName(P), and ASingerName(S).

  2. Query the number of occurrences of each occupation in OCCUPATIONS. Sort the occurrences in ascending order, and output them in the following format:

"There are a total of [occupation_count] [occupation]s."

where [occupation_count] is the number of occurrences of an occupation in OCCUPATIONS and [occupation] is the lowercase occupation name. If more than one Occupation has the same [occupation_count], they should be ordered alphabetically.

Additional project images

Discussion and feedback(0 comments)
2000 characters remaining
Cookie SettingsWe use cookies to enhance your experience, analyze site traffic and deliver personalized content. Read our Privacy Policy.