
Kingsley retweeted
one of my favorite data analysis quotes: “if you torture the data enough, it will tell you what you want to hear”.
Kingsley retweeted
Data Analytics Interview Questions & Answers – SQL (Part 1) 📊
*1. What is SQL?*
*Answer:*
SQL (Structured Query Language) is used to communicate with relational databases. It helps retrieve, insert, update, and delete data.
SELECT * FROM Employees;
*2. What is the difference between SQL and MySQL?*
*SQL* : A language
*MySQL* : A database system
*SQL* : Used to write queries
*MySQL* : Executes SQL queries
*SQL* : Standard language
*MySQL* : Software product
*3. What are Primary Keys and Foreign Keys?*
*Primary Key:* Uniquely identifies each row in a table.
*Foreign Key:* Creates a relationship between two tables.
*Example:*
- EmployeeID → Primary Key
- DepartmentID → Foreign Key
*4. What is Normalization?*
*Answer:*
Normalization organizes data into multiple related tables to reduce redundancy and improve data integrity.
*Benefits:*
Reduces duplicate data
Improves consistency
Saves storage
*5. What is Denormalization?*
*Answer:*
Denormalization combines tables to improve query performance.
*Benefits:*
Faster reporting
Faster data retrieval
*Drawback:*
❌ More redundancy
*6. Difference Between WHERE and HAVING?*
*WHERE:* Filters rows before aggregation.
*HAVING:* Filters groups after aggregation.
SELECT Department, COUNT(*)
FROM Employees
GROUP BY Department
HAVING COUNT(*) > 10;
*7. Difference Between DELETE, DROP, and TRUNCATE?*
*DELETE:* Removes selected rows.
DELETE FROM Employees
WHERE EmployeeID = 101;
*TRUNCATE:* Removes all rows.
TRUNCATE TABLE Employees;
*DROP:* Deletes entire table structure.
DROP TABLE Employees;
*8. Difference Between INNER JOIN and LEFT JOIN?*
*INNER JOIN:* Returns matching records only.
*LEFT JOIN:* Returns all records from left table and matching records from right table.
SELECT *
FROM Employees E
LEFT JOIN Departments D
ON E.DepartmentID = D.DepartmentID;
*9. What is RIGHT JOIN?*
Returns all rows from the right table and matching rows from the left table.
*10. What is FULL OUTER JOIN?*
Returns all matching and non-matching rows from both tables.
*11. What is SELF JOIN?*
A table joined with itself.
*Example:* Employee and Manager stored in same table.
*12. What is CROSS JOIN?*
Returns every possible combination of rows.
*If:*
- Table A = 5 rows
- Table B = 4 rows
*Result = 20 rows*
*13. What are Aggregate Functions?*
Used to perform calculations.
*Examples:* COUNT(), SUM(), AVG(), MIN(), MAX()
*14. Difference Between COUNT and COUNT DISTINCT?*
*COUNT(EmployeeID):* Counts all values.
*COUNT(DISTINCT DepartmentID):* Counts unique values only.
*15. What is GROUP BY?*
Groups rows with similar values.
SELECT Department, COUNT(*)
FROM Employees
GROUP BY Department;
*16. Difference Between GROUP BY and ORDER BY?*
*GROUP BY:* Groups data.
*ORDER BY:* Sorts data.
*17. What is a Subquery?*
A query inside another query.
SELECT *
FROM Employees
WHERE Salary >
(
SELECT AVG(Salary)
FROM Employees
);
*18. What are CTEs?*
Common Table Expressions create temporary result sets.
WITH SalesCTE AS
(
SELECT *
FROM Sales
)
SELECT *
FROM SalesCTE;
*Benefits:*
Readability
Reusability
*19. What are Window Functions?*
Perform calculations without collapsing rows.
*Examples:* ROW_NUMBER(), RANK(), DENSE_RANK()
*20. Explain ROW_NUMBER()*
Assigns unique numbers.
SELECT EmployeeName,
ROW_NUMBER() OVER (ORDER BY Salary DESC) AS RankNo
FROM Employees;
21. Explain RANK() and DENSE_RANK()
RANK(): Ranks with gaps. Example: 1, 2, 2, 4
DENSE_RANK(): Ranks without gaps. Example: 1, 2, 2, 3
22. What are Indexes?
Indexes improve query speed.
Benefits:
Faster searches,
Faster filtering
Drawback:
❌ Extra storage
23. What Causes Slow SQL Queries?
Common reasons:
Missing indexes
Too many joins
Large datasets
SELECT _ usage
Unoptimized subqueries
I didn't even know this was a thing, and Power BI was like "I can't just pick 1 of these 4 twins to let through and ghost the other 3, that's not ranking, that's favoritism." So it let all 4 in just like that.
😅😅
1
18
Kingsley retweeted
Every Monday morning, Aisha, the VP of Sales at a fast-growing B2B hardware company, joins the executive leadership meeting with the same question:
*"How healthy is our pipeline?"*
It sounds simple.
But getting the answer wasn't.
Sales data lived in different CSV files.
Account information sat in one report.
Product details lived in another.
Sales team records were maintained separately.
And the pipeline itself existed in a transactional export filled with typos, missing values, and incomplete deals still in progress.
The team wasn't struggling because they lacked data.
They were struggling because they lacked a single source of truth.
Without it, critical questions took hours to answer:
* Are discounts helping us win more deals?
* Which products generate the most revenue?
* How long does it take to close a deal?
* Which sales managers are outperforming their targets?
* Where are opportunities getting stuck in the pipeline?
To solve this, I built an end-to-end sales analytics solution in Excel using Power Query and Power Pivot.
The project started with four raw CSV files:
• Accounts
• Products
• Sales Teams
• Sales Pipeline
Using Power Query, I designed an ETL process to clean, standardize, and prepare the data for analysis.
This included:
* Correcting data inconsistencies and typos
* Preserving blank values that represented active opportunities
* Standardizing text fields and data types
* Replacing missing account values
* Creating a dedicated calendar table for time intelligence
Once transformed, the data was modeled into a Star Schema using Power Pivot.
Instead of working with one large spreadsheet, the solution separated transactional data from descriptive data using Fact and Dimension tables connected through relationships.
The model was then enriched with DAX calculations to answer key business questions, including:
* Total Revenue
* Win Rate
* Average Days to Close
* Average Discount Percentage
* Quarter-over-Quarter Growth
One of the most interesting insights came from the Agent Efficiency Matrix.
By comparing average discount percentages against win rates, we discovered that higher discounts had little impact on deal success.
The assumption that "bigger discounts close more deals" simply wasn't supported by the data.
The final dashboard provides executives with a single, interactive view of sales performance through:
• Revenue and pipeline KPIs
• Funnel analysis of deal stages
• Product performance rankings
• Agent efficiency analysis
• Dynamic quarter and manager filters
• Automated narrative insights that update based on user selections
What used to take multiple files and hours of manual reporting can now be answered in seconds.
Because effective analytics isn't about building more charts.
It's about connecting data, asking better questions, and creating systems that help people make decisions faster.
**Tools Used:** Excel, Power Query, Power Pivot, DAX, PivotTables, PivotCharts, Slicers
#DataAnalytics #Excel #Powerquery
The Results? Two massive takeaways for stakeholders:
Q4 Congestion: November grossed over 2.5x the volume of baseline spring months (Lock in logistics early!).
Peak Traffic: 38% of daily transactions happened between 11:00 AM and 1:00 PM.
1
8
Understanding data mechanics isn't just about writing code—it's about turning raw logs into operational strategy (optimizing server scaling and midday workforce staffing).
Full code is live on my GitHub! Check it out here: github.com/Mekahkingsley/ECo…
#DataAnalytics #Python #SQL
12
Kingsley retweeted
Starting your Data Analytics journey?
I’ve put together a beginner-friendly starter kit to help you get started faster.
Inside:
• 3 intro videos on Data Analytics
• 2 helpful PDFs
• 4 templates, including a learning tracker
Get access here: da-starter-kit.lovable.app
Kingsley retweeted
I’m in love with this sentence:
“One of the most underrated skills you can learn is the ability to ignore your mood and stick with the plan.”












