The SQL Tribe (@thesql_tribe) header
The SQL Tribe (@thesql_tribe) profile picture

A community to connect and learn from other SQL professionals.

Lagos, Nigeria
Joined April 2021
Photo by The SQL Tribe (@thesql_tribe)Photo by The SQL Tribe (@thesql_tribe)Photo by The SQL Tribe (@thesql_tribe)Photo by The SQL Tribe (@thesql_tribe)Photo by The SQL Tribe (@thesql_tribe)Photo by The SQL Tribe (@thesql_tribe)Photo by The SQL Tribe (@thesql_tribe)Photo by The SQL Tribe (@thesql_tribe)Photo by The SQL Tribe (@thesql_tribe)Photo by The SQL Tribe (@thesql_tribe)
Happy Valentines 💌
2
263
This 2026, we’re choosing consistency over perfection TOGETHER💪🏾!
2
2
1
14
875
Happy new year 🥳
2
6
42
2,454
Do you really know SQL? 😊 Day 24/30 Which query correctly retrieves 3 highest distinct salaries? A. SELECT DISTINCT Salary FROM Employees ORDER BY Salary DESC LIMIT 3; B. SELECT Salary FROM Employees ORDER BY Salary DESC LIMIT 3; C. SELECT TOP 3 DISTINCT Salary FROM Employees
26
13
148
10,301
Do you really know SQL? 😊 Day 23/30 Using the table ‘Devices’ below, write a query that would return the latest date Ada used any device?
7
2
2
40
2,977
Do you really know SQL? 😊 Day 22/30 Using the table Sessions below, how do you get the previous login time per user? A. LAG(login_time) B. LAG(login_time) OVER () C. LAG(login_time) OVER (PARTITION BY user_id ORDER BY login_time) D. PREVIOUS(login_time)
7
1
44
2,342
Do you really know SQL? 😊 Day 21/30 Which query returns rows where amount is missing? A. WHERE amount = NULL B. WHERE amount IS NULL C. WHERE amount == NULL D. WHERE amount = 'NULL'
23
1
2
90
7,047
Do you really know SQL? 😊 Day 20/30 Which query returns the running total of sales by date? A. SELECT Date, SUM(Amount) FROM Sales GROUP BY Date; B. SELECT Date, SUM(Amount) OVER (ORDER BY Date) FROM Sales; C. SELECT Date, RUNNING(Amount) FROM Sales;
20
7
5
121
7,916
Do you really know SQL? 😊 Day 19/30 What does this query return: SELECT COALESCE(Email, 'no-email') FROM Users; A. Replaces empty strings with NULL B. Converts NULL emails to 'no-email' C. Converts all values to strings D. Removes NULL rows
34
15
124
7,127
Do you really know SQL? 😊 Day 18/30 Using the case study question from yesterday and the tables below, write a query that will identify users who are matching with multiple people in a short period (let’s say 4days).
4
1
50
2,235
Do you really know SQL? 😊 Day 17/30 Using the information in the image below, write out as many investigative questions as possible if you were the lead Data Analyst.
1
21
135
5,897
Do you really know SQL? 😊 Day 16/30 What does this RETURN? SELECT SUM(Salary) OVER () FROM Employees; A. Total salary for each row B. One row showing total salary C. Total salary only for first row D. Total salary partitioned by default
7
8
1
98
4,936
Do you really know SQL? 😊 Day 15/30 What would this query return? SELECT COUNT(*) - COUNT(Email) FROM Users; A. Number of NULL Email rows B. Number of non-null Email rows C. Total row count D. Number of duplicate Emails
18
7
87
5,231
Do you really know SQL? 😊 Day 14/30 Which of these causes a FULL TABLE SCAN most likely? A. Filtering on an indexed column with equality B. Using LIKE 'A%' on an indexed VARCHAR C. Using a function on an indexed column (e.g., WHERE LOWER(Name) = 'John')
7
6
82
4,683
Do you really know SQL? 😊 Day 13/30 What does this window function return? SELECT Name, Salary, RANK() OVER (ORDER BY Salary DESC) AS r FROM Employees; A. Unique ranking with no gaps B. Ranking with gaps if salaries tie C. Continuous ranking without ties
10
6
79
4,602
Do you really know SQL? 😊 Day 12/30 Using the tables below, write a query that will return teachers who teach at least one course
9
10
1
85
4,227
December is here🎄!
4
28
3
239
6,967
Do you really know SQL? 😊 Day 10/30 Using the table “Trips” below, can you write a query that will return drivers whose total fare exceeds 4000?
16
4
4
99
5,056
Do you really know SQL? 😊 Day 10/30 You want employees whose name contains “ann”. A. WHERE Name LIKE '%Ann%' B. WHERE Name LIKE '%ann%' C. WHERE Name LIKE '%Ann%' OR '%ann%' D. A or B (depending on case sensitivity)
35
1
4
86
7,441
Do you really know SQL? 😊 Day 9/30 What will this return? SELECT * FROM Sales LIMIT 1; A. Only the first row B. The last row C. A random row D. The first column
46
8
5
91
6,467