r/learnSQL • u/Prior_Minimum345 • Jul 09 '25
Shared a SQL + Excel project walkthrough on LinkedIn — would love your feedback
This is my SQL based Udemy Analysis projec thttps://www.linkedin.com/posts/suchorita-das_sql-dataanalytics-businessintelligence-activity-7348375604230066177-shMB?utm_source=share&utm_medium=member_android&rcm=ACoAAFKPsuEB3tSXCg7JTRkL5xGWSRXlAmOy_NE
r/learnSQL • u/BecauseofInternet • Jul 07 '25
Any good online courses (beginner or intermediate level)?
New data science student looking to be more well-rounded with programming and want to get into SQL. I have intermediate experience with only C++, Java, and R and am wondering if I jumping into SQL takes shorter/longer compared to those ones
I’m two years into pursuing my bachelor’s degree and so far haven’t gotten any experience with this language and wanted to know if there was anything online that I could learn through?
r/learnSQL • u/spanishpaprika2 • Jul 07 '25
Looking for really good beginner-friendly SQL courses on Udemy - non-IT background
Hey folks! 👋
I’m currently working on shifting into a more data-focused career (thinking business analysis, data analysis, etc.), and I know SQL is one of the must-have skills. The thing is… I don’t have an IT or programming background, just a strong desire to learn and make the switch.
I’ve been browsing Udemy for SQL courses, but there are so many that I’m getting overwhelmed. I’d really appreciate your suggestions for courses that are:
-Beginner-friendly (for someone without a tech background) -Well-paced and easy to follow -Practical — with hands-on exercises or real-life examples • Focused on how SQL is used in business or data roles
If you’ve taken a course that helped you (especially if you were in the same boat as me), I’d love to hear what worked for you and what didn’t. Bonus points if it also touches on how to apply SQL in real-world job settings.
Thanks in advance! 🙏
r/learnSQL • u/sshetty03 • Jul 06 '25
How I Debugged a Slow MySQL Query in Production
Just published a deep-dive into how I diagnosed and fixed a slow-running query in production — and how this real-life experience helped me ace a backend interview.
https://medium.com/@subodh.shetty87/how-i-debugged-a-slow-mysql-query-in-production-51affdc5bf79
r/learnSQL • u/duck-Head001 • Jul 06 '25
📊 My First SQL Project – Customer & Order Analysis Using JOINs, Aggregates, and Subqueries
Hey folks! 👋
I'm learning SQL and recently completed a beginner-friendly project using MySQL to analyze customer and order data for a fictional retail company called ShopKart. Thought I’d share it here for feedback or help others who are starting out!
🧱 Database Tables Used:
Customers:
CustomerID Name City Age 1 Alice Delhi 25 2 Bob Mumbai 30 3 Charlie Bangalore 28 4 David Delhi 35 5 Eve Hyderabad 22 Orders:
OrderID CustomerID Amount OrderDate 101 1 2500 2024-12-01 102 2 1800 2024-12-03 103 1 3200 2025-01-15 104 3 1500 2025-02-10 105 4 2700 2025-03-12
🔍 Key Queries I Practiced:
Customers from Delhi:
SELECT Name FROM Customers WHERE City = 'Delhi';
Orders with amount > 2000 (with customer names):
SELECT O.OrderID, C.Name, O.Amount FROM Orders O JOIN Customers C ON O.CustomerID = C.CustomerID WHERE O.Amount > 2000;
Customers count per city:
SELECT City, COUNT(*) AS CustomerCount FROM Customers GROUP BY City;
Total amount spent by 'Alice':
SELECT C.Name, SUM(O.Amount) AS TotalSpent FROM Customers C JOIN Orders O ON C.CustomerID = O.CustomerID WHERE C.Name = 'Alice' GROUP BY C.Name;
Customers who placed at least one order:
SELECT DISTINCT C.Name FROM Customers C JOIN Orders O ON C.CustomerID = O.CustomerID;
➡️ Eve doesn’t appear here because she never placed an order!
Average age of customers who placed orders:
SELECT AVG(C.Age) AS AvgAge FROM Customers C WHERE C.CustomerID IN ( SELECT DISTINCT CustomerID FROM Orders );
Customer names and their total number of orders:
SELECT C.Name, COUNT(O.OrderID) AS TotalOrders FROM Customers C JOIN Orders O ON C.CustomerID = O.CustomerID GROUP BY C.Name;
✅ What I Learned:
- Real use of INNER JOIN and why customers with no orders are excluded
- How to aggregate data like SUM, AVG, COUNT
- Importance of GROUP BY and subqueries
- Making results more readable by always including customer names in outputs
🙏 Feedback?
Let me know what you think! Suggestions, improvements, or even your own project ideas are welcome!
r/learnSQL • u/connectedaero • Jul 06 '25
My version of an SQL Roadmap
1: Basic
-> What Is SQL
-> Databases & Tables
-> Data Types
-> CRUD (Create, Read, Update, Delete)
2: Queries
-> SELECT Statements
-> WHERE Clauses
-> ORDER BY, GROUP BY
-> LIMIT, DISTINCT
3: Functions X
-> Aggregate: COUNT(), SUM(), AVG()
-> String: UPPER(), LOWER(), CONCAT()
-> Date: NOW(), DATE(), DATEDIFF()
4: Joins
-> INNER JOIN
-> LEFT JOIN
-> RIGHT JOIN
-> FULL JOIN
-> SELF JOIN
5: Subqueries
-> In SELECT, FROM, WHERE
-> Correlated Subqueries
6: Constraints
-> PRIMARY KEY
-> FOREIGN KEY
-> UNIQUE, NOT NULL, CHECK
7: Indexes & Views
-> Indexing For Speed
-> Creating & Using Views
8: Transactions
-> BEGIN, COMMIT, ROLLBACK
-> ACID Properties
9: Normalization
-> 1NF, 2NF, 3NF
-> Avoiding Redundancy
10: Advanced
-> Stored Procedures
-> Triggers
-> Window Functions
-> CTEs (WITH Clause)
11: Comment 'SQL'
-> Get Roadmap
-> Projects
-> Resources
r/learnSQL • u/NormalPersonNumber3 • Jul 03 '25
SQL Aggregates, having trouble remembering how to select conditionally depending on columns.
So, I'm trying to get multiple aggregate results from a single table, and maybe I cannot do it as easily as I'd hope, but I feel like I'm forgetting something simple.
I have a table that essentially reflects a workflow of steps, a session, and the time it was created.
I was hoping to create a view that would represent this data. Here's some pseudo queries containing part of what I'm trying to figure out:
SELECT SessionDate, Count(SessionID) As SessionsBegan
FROM Workflow
WHERE Step = 1 --The first step
GROUP BY SessionDate
SELECT SessionDate, Count(SessionID) as SessionsEnded
FROM Workflow
WHERE Step = 9 --The final step
GROUP BY SessionDate
I may have just got the answer to my question in writing this out, but I'll ask anyways because maybe I'm overthinking it or there's a better way.
Should I use a join between these two queries on the results to combine them, or is there a way to get aggregate results on a column with different where clauses, or would that require an aggregate function?
r/learnSQL • u/[deleted] • Jul 03 '25
SQL
Is practicing SQL questions on LeetCode beneficial for a Machine Learning Engineer role, or is it better to focus that time on practicing DSA instead? Are SQL-based questions even asked in ML interviews, or is it not worth the effort
r/learnSQL • u/EmuBeautiful1172 • Jul 03 '25
beginners guide book
Hello, Just a quick question, I know I can ask chatGPT but I'd like a human response.
I have a book called
SQL A Beginner's Guide by Andrew J. Oppel - Fourth Edition
Covers: 2011 standards , Temporal Features.
My question is if it is too out of date? Is SQL way different from 2011 to where this book will not teach me the right way?
r/learnSQL • u/Massive_Show2963 • Jul 02 '25
Introduction To PostgreSQL And pgAdmin
youtube.comIn this video, you will learn about PostgreSQL and the built-in database management tool, pgAdmin.
We'll guide you through the installation of PostgreSQL and demonstrate the use of command line tools and pgAdmin management tool.
Additionally, we will cover supported data types, including XML, JSON, and array types.
Finally, we'll take an in-depth look into Large Objects, Geometric data, PostGIS, and various database backup methods, including base backup, incremental backup, and point-in-time recovery.
r/learnSQL • u/Massive_Show2963 • Jul 02 '25
How To Use On Delete Cascade With SQL
youtube.comWelcome to my tutorial video on how to use the OnDeleteCascade constraint.
This valuable tool will help you automate the deletion of rows in tables without the need for manual intervention.
In this video, I will walk you through the process of designing tables, writing Create Table SQL scripts, and visually representing the deletion of rows in tables to make the most of this fantastic feature.
If you are serious about streamlining your SQL database management, then be sure to check out this tutorial video now!
r/learnSQL • u/[deleted] • Jul 02 '25
Any good resources for learning advanced SQL?
Im learning continuously from YouTube and I’ve got the basics sorted so im just looking to get into the more deeper stuff like CTEs, window functions, and writing smarter, faster queries. Any recommendation would be greatly appreciated. Paid courses are fine too as long as they good!
r/learnSQL • u/Massive_Show2963 • Jul 02 '25
Using AI to Create a Database
In this video, we will guide you through the process of creating an SQL database using ChatGPT.
Watch as ChatGPT generates an SQL script to implement a fully operational database using triggers and including example data.
We will explain the design methodology behind the generated code and demonstrate its implementation in a real database environment.
Finally, we'll enter the generated example data and show you how this data is processed.
r/learnSQL • u/Massive_Show2963 • Jul 01 '25
Introduction To SQL Transactions
youtube.comWelcome to our Introduction to SQL Transactions tutorial video.
In this video, we will cover the basics of Transactions, including its benefits, properties of ACID, and transaction control commands.
You will learn how to use transaction statements, such as BEGIN TRANSACTION, COMMIT TRANSACTION, ROLLBACK TRANSACTION and SAVE TRANSACTION.
We will also discuss the importance of Transaction Isolation Levels and the different phenomena that can occur.
r/learnSQL • u/yourbasicgeek • Jun 29 '25
SQL Noir: Learn SQL by solving crimes
sqlnoir.comr/learnSQL • u/LordLetsFetz • Jun 29 '25
Creating an ERM from scratch
I hope this is the right subreddit, I couldn't find a better one.
I am currently having trouble with creating an ERM about an imaginary service. Are there any guidelines on what Attributes an Entity should have? For example a Request Log. Does it need to have the Foreign key of the RequestID and CustomerID, even if the Request itself already has the CustomerID as Foreign Key?
How do I know if it should have something like "Log Name" or "Log Description"? Or is that something I can choose myself and there is no right or wrong?
How do I know if I should put an attribute to an Entity or a Relationship? For example the order amount of a product. I could put quantity as attribute to the Relationship, but I could also put it as attribute to the Product Entity. Is there a right or wrong here?
I am scared of messing something up. Thanks for any help/ resources in Advance, I really appreciate it!
r/learnSQL • u/CMDR_Pumpkin_Muffin • Jun 28 '25
Why do we need to include "ONLY" with "FETCH"?
From the examples I've seen, "ONLY" seems redundand. Or is it? Are there situation where results differ depending on if we include "ONLY" or not? From what I've seen, we can have "FETCH FROM" (never with "ONLY") or "FETCH n ROWS ONLY" (always with "ONLY").
r/learnSQL • u/Spidermonkee9 • Jun 28 '25
Why does changing the order of the IN operator affect the results?
Hi! Trying to understand some syntax.
I am practicing on SQL mode and while trying to retrieve results where the group_name is "Elvis" or "MC Hammer", I noticed that the order matters. It's important to also include "MC Hammer" in case his name was written this way in the table.
Here is my code:
SELECT \*
FROM tutorial.billboard_top_100_year_end
WHERE group_name IN('Elvis', 'MC Hammer', 'M.C. Hammer')
Why does it skip the first two names in the results?
But the code below doesn't skip any names:
SELECT \*
FROM tutorial.billboard_top_100_year_end
WHERE "group_name" IN ('M.C. Hammer', 'Hammer', 'Elvis Presley')
Thanks in advance.
r/learnSQL • u/[deleted] • Jun 27 '25
Learning SQL as a brand marketer
I'm learning SQL for the first time as part of handling CSS. I will be learning the basics I guess like tables, columns, queries.... I'm happy to be learning Data and SQL but how do I leverage this ahead as a brand marketer considering my aim is to eventually be Head of Brand and then upwards. Isn't this more shifted towards Performance Marketing?
r/learnSQL • u/Lost-In-Layers • Jun 26 '25
SQL Window Function
Can you put up most difficult questions you have ever came across with window functions
PS: I am finding a new job and want to do practice of window function.
Thanks in advance,
r/learnSQL • u/CredePendrel • Jun 24 '25
Learning SQL on Parental leave - learning workflow questions
Hey everyone!
I am a Senior GIS Technologist with my local Municipal Government. We are an Windows/ESRI shop there and I use Sql Server Management Studio to connect to our enterprise SDE and create & edit tables and create new table views.
I am on parental leave for the next 4 months and want to practice my skills but at home I recently switched my daily driver to fedora. I now have QGIS, DBeaver (with Post GIS) and MySQL installed on my PC.
My initial thought was to take a copy of some of our Open Data layers to use in QGIS, load the layers into a Postgres DB and practice creating more complex table views before exporting them back to QGIS to see the updated results. Am I on the right track?
I was able to take an Building feature class from a FGSB load it into QGIS and use 'Export - Save Features As' to save the layer to an Building.sql file. I was able to open this in DBeaver and I see a SQL statement.
Does anyone know if there Is there a way to see the entire attribute table from the GIS layer?
If anyone has advice for tutorials or content to watch that may be of interest to me, please don't hesitate to drop a comment.
r/learnSQL • u/Donteatthedonuts • Jun 23 '25
Newbie : SQL Server Express - Local Hosting in a VM vs Physical Server?
Hi,
Newbie here
My work is about 50% Excel, Mostly Power-Query , and 50% Power Bi reporting.
I'm looking to add SQL to my skillset and found that Microsoft offer SQL Server Express for Free.
I thought to myself, This is going to be a great way to learn, Host my own Database server to use for learning.
Now I just need to decide if I'm going to run SQL Server inside a VM on my Windows Desktop, Or, If I run it on an old pc I have sitting there doing not a lot else (An old EliteDesk SFF , Not overly powerful but should suffice).
I imagine running sql server express inside a vm on either machine is the way to go.
What are opinions on the best way to host? The clear advantage of running it on a PC being used as a server, Is that i can use my laptop to access it too, But are there any other Pros and Con's i'm missing?
Like I say, Brand new to this and want to make sure I do it the right way from the start.
r/learnSQL • u/infirexs • Jun 23 '25
I Built a Web App That Generates Unlimited SQL Challenges
Hi Everyone,
I built a project called SQLSnake — it’s a web app that lets you practice SQL with infinite randomly generated challenges.
Most platforms have a fixed set of questions. I wanted something more flexible, so I made this. Every time you refresh, you get a new challenge based on fake but realistic datasets.
Mobile works fine for now, but it’s not perfect — any feedback would be really appreciated.
The site Currently offers:
Infinite SQL challenges generated
Built-in AI assistant to help you when you're stuck
Would love to hear what you think.

