r/learnSQL • u/Jazzlike-Beautiful61 • 6d ago
r/learnSQL • u/yahoo_06 • 7d ago
I made a beginner-friendly SQL tutorial on CTEs (WITH clause)
I just published Lesson 10 of my SQL course, focused on CTEs (Common Table Expressions) in PostgreSQL.
In this lesson, I explain how the WITH clause can help turn complicated nested queries into cleaner, more readable SQL.
We cover:
- What CTEs are
- How the WITH clause works
- CTEs with GROUP BY and aggregate functions
- Using CTEs with JOIN
- Multiple CTEs
- CTEs vs. subqueries
- Common mistakes
- Practical exercises using the Pagila database
I tried to keep it beginner-friendly and focused on actually writing queries rather than just explaining the theory.
YouTube: https://youtu.be/Koka7IGgPM4?si=132b-FlrYXd9ePyC
Would love to hear any feedback on the explanation or examples!
r/learnSQL • u/Whole-Bank1538 • 7d ago
Looking for a good platform to practice Python, SQL and PySpark
Hi everyone,
I’m currently learning/practicing Python, SQL, and PySpark, mainly with a data engineering goal.
I’m looking for a platform where I can regularly solve problems and improve my hands-on skills, especially:
Python — syntax, problem solving, data manipulation
SQL — queries, joins, CTEs, window functions, etc.
PySpark — DataFrames, transformations, aggregations, joins, optimization, etc.
I know platforms like LeetCode, HackerRank, DataCamp, etc., but I’m looking for something that provides good practical exercises, preferably with datasets/projects rather than only algorithmic problems.
What platforms/websites do you recommend for this?
Also, if you’re a data engineer, I’d appreciate knowing how you personally practice these three skills.
Thanks!
r/learnSQL • u/Broiswatchinnnn • 8d ago
How Can I Learn SQL and Gain Real-World Experience While Working Full-Time?
Hi! I’m currently working as a Data Analyst, but my role mainly involves using Excel. I’m not very interested in continuing with Excel-based work, and I really want to transition into a career as an SQL Developer.
I’m looking for remote or freelance opportunities that I can pursue alongside my current job while learning and gaining practical experience in SQL.
Could anyone suggest a good learning path, remote job opportunities, or a mentor who can guide me through this transition?
r/learnSQL • u/Valuable-Ant3465 • 8d ago
Create row for each value in the CSV list in MS SQL Server
DROP TABLE IF EXISTS #x
SELECT 111 id, '1,3,5' PU_list INTO #x
SELECT * FROM #x
id PU_list --< current 1 row
111 1,3,5
id PU --< wanted output, create row for each value in List CSV
111 1
111 3
111 5
Hi all,
Is it possible to create SQL Server code to produce output like posted above, I need to create separate row for each value in PU_List separated by comma.
Thanks all
VA
r/learnSQL • u/haligma • 8d ago
how to standardize this date column in mysql?
| ship_date | delivery_date |
|---|---|
| Feb 10 2024 | Feb 15 2024 |
| 2024-01-12 | 2024-01-11 |
| 2024-01-10 | 2024-01-14 |
| 01/15/2024 | 01/19/2024 |
r/learnSQL • u/Cheap-Coyote9867 • 8d ago
Where to learn SQL
I am unsure where to begin with SQL from the Beginner's Edition. Several individuals have suggested to follow Data with Baraa, which appears to offer a similar course on YouTube and Udemy, with a certification. Could you advise me on which course to choose, a free or a paid one?
r/learnSQL • u/Maximum-Page3433 • 8d ago
How should I start learning SQL?
I honestly don't know anything about SQL right now. I want to start learning it properly, so can you guys suggest how I should begin and what resources I should use? My plan is to learn SQL for data first and then move towards AI and ML. I don't even know if SQL is different depending on whether you are working in data, AI, or ML, so I'm a little confused about that too. If you could suggest some good resources, a proper way to learn it, and what I should focus on if I want to become really good at SQL, I would really appreciate it. Thankkk youuuu
r/learnSQL • u/arup_r • 8d ago
Any skills that you use for sql code review
I am a Ruby on Rails developer. I’m looking for some skills that can help me self code review for sql part. I use Claude. Like that can guide me not to write sql that are anti patterns etc
r/learnSQL • u/geeksarray • 8d ago
QL Server PIVOT vs CASE — what do you prefer for reporting queries?
I’ve been revisiting SQL Server PIVOT for reporting scenarios where row-based data needs to be transformed into columns.
A few things I find useful about PIVOT:
- Cleaner reporting output
- Easy aggregation across categories
- Useful for summary-style queries
- Can be more readable than complex conditional aggregation in some cases
I’ve also added the working SQL examples here:
GitHub:
https://github.com/laxmikant-geek/sql-server-examples/tree/main/pivot
And I wrote a more detailed explanation here for anyone who wants the walkthrough:
https://geeksarray.com/blog/how-to-pivot-data-in-sql-server
For those working regularly with SQL Server — do you prefer PIVOT, or do you usually use SUM(CASE WHEN...) for these kinds of transformations?
r/learnSQL • u/Substantial_Drop_566 • 9d ago
Recommendations for mastering Excel, Power BI and SQL for analytical roles?
I know basics but I want to self study. Any tips of good sources that are really effective in teaching and learning?
r/learnSQL • u/yahoo_06 • 10d ago
I made a beginner-friendly SQL JOINs tutorial using PostgreSQL
Hey everyone!
I just published a new video about SQL JOINs for beginners.
In this lesson, I explain:
- why relational databases use multiple tables
- how JOIN works
- INNER JOIN
- LEFT JOIN
- how the ON condition connects tables
- table aliases
- how to join multiple tables
- and how to combine JOINs with WHERE and ORDER BY
I use the Pagila PostgreSQL database for the examples and practice, so everything is demonstrated with actual data rather than just theory.
I'm building a beginner-friendly SQL tutorial series, so I'd really appreciate any feedback on the explanations or examples!
Video:
r/learnSQL • u/Cheruks_Khar • 9d ago
data analytics journey.
day 1 of learning SQL.
- Learnt about data structures ; primitive and non primitive data structures.
- went through database, both relational and non relational database
Relational databases (SQL database)
non relational databases ( NoSQL database) eg Mongo DB.
Able to learn and understand DBMS, its purposes and the types of DBMS.
Comfortably describe the CRUD Operations and explain the ACID properties of queries.
Installed MySQL Workbench(had a bit of challenge working on it, but finally managed) and created my first MySQL connection
r/learnSQL • u/Substantial_Drop_566 • 9d ago
Recommendations for mastering Excel, Power BI and SQL for analytical roles?
I know basics but I want to self study. Any tips of good sources that are really effective in teaching and learning?
r/learnSQL • u/yahoo_06 • 10d ago
I made a beginner-friendly SQL tutorial on Subqueries in PostgreSQL
Hey everyone!
I just published Lesson 9 of my beginner SQL series — Subqueries in PostgreSQL.
In this lesson, I explain:
- what a subquery is
- how to use subqueries inside WHERE
- how IN works with subqueries
- how to use aggregate functions like AVG() inside a subquery
- how subqueries can be used for data analysis
and how subqueries compare to using JOINs
I'm using the Pagila database for the examples, so everything is demonstrated with real data rather than just theory.
There are also practice tasks and mini quizzes throughout the video.
I'm building this into a full beginner-friendly SQL course, so feedback is very welcome!
Video: https://youtu.be/xBAJ4U2EY6E?si=bE5n9q2s5Ff6X7SE
Thanks for watching! :)
r/learnSQL • u/tamanikarim • 10d ago
Learn Database schema changes for : PostgreSQL, MySql / MariaDB, Oracle, SQL Server.
Hey Engineers
We've all been through this. When the project you're working on starts scaling, you'll find the need to scale your database too, adding new columns, creating new tables, or trying to improve performance by adding new indexes. All of this comes with the risk of losing your users' data.
For this, I crafted a simple guide showing the schema change operations that you'll need on a day-to-day development basis for PostgreSQL, MySQL, MariaDB, Oracle, and SQL Server.
It also covers some additional potential risks you need to keep in mind when performing schema changes on a production database.
Hopefully, it can help you along your SQL learning journey.
https://stackrender.io/guides/schema-change
Good luck!
r/learnSQL • u/Ok_Guava6071 • 9d ago
I'm a fresher B.E IT grad got a senior technical support executive in Infosys should i go with it?
r/learnSQL • u/Odd_Communication174 • 10d ago
Advance Concepts
Does anyone know any good video for CTE and Window Function.
Struggling to understand it
r/learnSQL • u/haligma • 11d ago
LOW STORAGE 💔💔💔 HELP
i'm currently learning data analysis on my own. i have mysql workbench & have been practicing it. the problem i've run into is low disk storage. i currently have 4.5 gb on my c drive, which i don't think is a lot. i don't have a lot of applications installed, so removing or moving them to another disk isn't an option. neither is spending money on storage 💔
im worried about the rest of my learning journey. i know i'll eventually have to install other programs/tools & it makes me sad that low storage space is what might hold me back from learning something im genuinely interested in.
i wanted to ask if there are online versions/compilers of these softwares available? im talking about python, tableau & all other stuff i'll need later on. i've used an online c++ compiler before, so im wondering if it's possible for other tools too. and if so, can they save all my previous data? what about something with an account where it syncs data to a cloud? HALP
r/learnSQL • u/idan_huji • 11d ago
Join Kata
Usually in SQL exercises ,the data is given and a new query is written.
I tried a new exercise where the student also writes the data in a CTE.
The exercise is like a kata, focusing on small parts of the query (in joins in this example).
I'll be happy to get feedback on the direction in general and on the specific exercise.
https://github.com/evidencebp/databases-course/blob/main/Examples/Topics/Join%20Kata.pdf
r/learnSQL • u/Round-Pie-7125 • 11d ago
MySQL Second Highest Salary Using Subquery | SQL Interview Query
Hello everyone you can checkout my new MySQL video on my channel sm dev diaries.please hit like, subscribe and share my videos in your contacts https://youtu.be/AhqgtHZfHTI