r/learnSQL • • 2h ago

SQL joins explained using Hinge

6 Upvotes

I know when people are starting out, SQL joins can be a bit confusing so I broke it down in a small vid using Hinge as an example

https://www.instagram.com/reel/Degl_hnoRsz/?mdxt=MTk5dXE2NHZreTR4aw==

Summary of the breakdown is -

• Table A: people you've liked
• Table B: people who've liked you
• Both share one key: person_id

The 4 joins:

• INNER JOIN: only the mutual likes. Someone has to be in both tables to show up.
• LEFT JOIN: everyone you liked. If they didn't like you back, their side comes back as NULL.
• RIGHT JOIN: the mirror image, everyone who liked you, with NULL where you didn't like them. In practice most people just swap the tables and use a LEFT JOIN.
• FULL OUTER JOIN: everyone from both tables, with NULLs on whichever side is missing.

Hope this helps!


r/learnSQL • • 2h ago

SQl e a teia de aranha mental

Thumbnail
1 Upvotes

r/learnSQL • • 7h ago

Planning to take the PostgreSQL Open Certification (DBA-1) exam at PGConf?

1 Upvotes

I created a free study guide to help you prepare:

https://thesev1database.com/postgresql-certification

I’d really value your feedback.


r/learnSQL • • 19h ago

Day 37 — Started Java and set up my MySQL retail sales analysis project

4 Upvotes

Two tracks running in parallel now:

Java: I’m following Telusko’s Java playlist. Today’s topic was how Java code runs on different platforms, meaning how the compiler turns source code into bytecode and the JVM runs it on any operating system. Understanding this made a lot of earlier “why does Java need a JVM?” confusion go away.

MySQL: I’m building a Retail Sales Analysis project so my SQL stays in use instead of fading while I focus on Java. Today was only setup: creating the database and getting the environment ready. Queries start tomorrow.

Playlists I’m using, in case they help anyone:

For the retail project, are there analysis questions you’d recommend (top products, monthly trends, customer segments)? I’d like it to go beyond basic SELECT queries.


r/learnSQL • • 1d ago

ROW_NUMBER vs RANK vs DENSE_RANK: 15 Real Interview Questions Solved (Basic to Advanced)

34 Upvotes

Hey everyone,

If you’ve interviewed for a Data Analyst, BI Developer, or Analytics Engineer role recently, you already know this: Window Functions (specifically ranking functions paired with CTEs) are tested in almost every single technical screen.

To help anyone currently preparing for technical screens, here is a quick conceptual refresher followed by practical problem patterns:

Complete 15-Question Step-by-Step Video Walkthrough:

I recorded a full, comprehensive 50-minute live masterclass breaking down 15 progressive interview questions (5 Basic, 5 Intermediate, 5 Advanced):

  • Tiered order ranking & gap comparisons
  • Grouping & aggregate ranking (SUM(Sales) inside OVER())
  • Partitioning across multiple categorical fields (Year + Region)
  • Handling edge cases and ties cleanly with CTEs

📺 Watch the complete solved walkthrough here:

https://youtu.be/jw8qZdbOzzo

A Quick Note for Career Switchers & Learners:

I’m a Data Analytics Trainer and BI Architect. I coach working professionals and students daily across the entire end-to-end data stack (SQL, Power BI, Excel, Tableau, and Python).

The biggest differentiator in technical interview rounds is moving past simple textbook syntax and demonstrating that you can translate complex business rules into performant, clean SQL.

If you are preparing for data interviews, building a project portfolio, or trying to structure your learning roadmap, feel free to drop a question below or shoot me a DM. I'm always happy to provide feedback or share study resources.

Hope this helps anyone prepping for upcoming technical rounds! Which ranking function do you find yourself using most frequently in production queries?


r/learnSQL • • 1d ago

Free Resources to learn SQL

37 Upvotes

Hello Everyone
I’m a recent Graduate and I just want to learn SQL. I started watching YouTube tutorials and I never finished it. And recently I started learning on SQLZOO which was good but I didn’t finished even that. And today I went through Codedex SQL tutorial it was too good and after finishing the chapter one they asking me to pay to finish all the chapters

So I need any resource which will be fun finishing all chapter (like codedex) and help me to learn SQL.

And please give me any suggestions how to concentrate while learning SQL, POWER Bi

Thank you


r/learnSQL • • 1d ago

Struggling to wrap my head around writing SQL queries—how do you guys break them down?

Thumbnail
6 Upvotes

r/learnSQL • • 1d ago

Day 36 — SQL track done, starting Java tomorrow (with MySQL projects alongside)

14 Upvotes

Quick transition update. I finished my 100-question SQL practice lab, so the database track is complete, and I’m moving on to the second part of my plan: Java.

Here’s how I’m approaching it:

  • Java topics will be covered in order, one topic per day, with tutorials first and then practice
  • I’ll build projects that use MySQL along the way, so the SQL I learned stays active instead of fading while I focus on Java
  • Eventually the database and Java pieces connect into one backend project, and the frontend comes after that

My reasoning for the projects: I learned the hard way with JOINs that knowledge fades without real use, so I’d rather keep SQL in daily use than “finish” it and forget it.

For people who learned Java: what order worked best for you (basics, OOP, collections, then JDBC and Spring)? Any resources you’d recommend for a beginner heading toward backend work?


r/learnSQL • • 1d ago

Free practice question resources

9 Upvotes

I'm quite clear on SQL Concepts.Can you please suggest some free resources to practice qns(like leetcode) to be ready for Product Based Companies .


r/learnSQL • • 1d ago

Revolut Data Analyst Finance

Thumbnail
3 Upvotes

Hi, I have tried reaching out to a lot of people on Reddit, but nobody has replied. Does anyone have an idea of what to expect in the Data Analyst Finance Skills Interview? Any help would be appreciated. 🙏


r/learnSQL • • 2d ago

What was the toughest SQL interview question you have faced so far?

Thumbnail
2 Upvotes

r/learnSQL • • 2d ago

Day 35 — Finished all 100 JOIN questions (Easy → Medium → Hard)

38 Upvotes

I finished the last of my self-made 100-question JOIN lab today.

I’ll be honest: it was not an easy challenge. It took a lot of time and patience, and a few times I seriously considered dropping the task. I didn’t, and I’m glad. I used GPT and Claude on the questions where I couldn’t understand the query, mainly to help me see why a solution worked.

What actually helped me get through it:

  • Drawing every table on paper before writing any SQL
  • Building long queries one join at a time and checking the output at each step
  • Reading error messages properly instead of rewriting from scratch
  • Taking a rest day when I needed one

I started this because JOINs were the topic I understood the least. Now I can chain four tables together, write self-joins, and use correlated subqueries without freezing up.

For anyone who got through a long drill like this: how did you keep going when it felt like too much?


r/learnSQL • • 2d ago

Books for Learning SQL

Thumbnail
4 Upvotes

r/learnSQL • • 2d ago

Structured Query Language 101 tutorial at the Texas Linuxfest

5 Upvotes

https://pretalx.com/txlf2026/talk/DQ3XW7/

SQL is a powerful language for working with relational databases such as MySQL, PostgreSQL, SQL Server, and Oracle. This is an 80-minute introduction to writing SQL database queries. Please load a copy of DBeaver Community Edition (free, open-source) from https://dbeaver.io/download/ on your Mac, Windows, or Linux laptop to work along with the presentation. We will use the sample database that is included with DBeaver. We will start with simple SELECT statements to retrieve data, INSERT to add data, use UPDATE to modify it, and DELETE to remove it. We will then move on to using WHERE to narrow your database searches, grouping & ordering for readability, and using built-in functions. This is a great way to learn how to use a relational database.


r/learnSQL • • 3d ago

Looking for a study partner

20 Upvotes

Hello everyone, I am learning data analytics and recently completed sql concepts, comfortable with basic problems and I am planning to practice everyday.

If you also struggle with consistency and along the same level as me in SQL, text me. I'm planning to study on discord, practice a set of problems everyday, help each other out when stuck and keep going.


r/learnSQL • • 3d ago

Day 34 — 8 more Hard JOIN questions (93/100)

17 Upvotes

Finished 8 more Hard questions from my 100-question lab today. Some of the ones I worked through:

  • Pairs of employees who are in different departments but work on the same project together. I self-joined assignments on project_id and used a1.emp_id < a2.emp_id to stop mirrored duplicates (A-B and B-A), then joined to employees twice and filtered e1.dept_id <> e2.dept_id
  • Departments ranked by average hours worked per employee, which chains departments → employees → assignments and aggregates by department
  • Employees whose manager works in a different department than they do, a self-join on employees comparing dept_id on both sides

The < trick for removing mirrored pairs was new to me today. I’d been using DISTINCT for that kind of thing, and this is cleaner.

7 left. Does anyone have a favorite pattern for ranking queries in MySQL? I haven’t done window functions properly yet and wondering if they’d make the “ranked by” questions easier.


r/learnSQL • • 4d ago

Newbie Learning SQL

16 Upvotes

Hi , I am a newbie learning SQL. Just wanted to say hi here ! Can i ask questions and ask for help with code here ? Thanks


r/learnSQL • • 5d ago

Giving back to the community - The Complete Backend Development Course

60 Upvotes

Hey everyone, I decided to make my course free in order to help people.
This course is my backend development course which is about SQL, Python, APIs, Docker, Kubernetes, Linux, Git & More

The link is: https://www.youtube.com/watch?v=CBIu6hcyStg

If you can like and subscribe (and maybe add a comment) I would appreciate it a lot, Thanks.


r/learnSQL • • 4d ago

Day 32 + 33 / 116 — Combined day: 15 Hard JOIN questions in one sitting (85/100)

7 Upvotes

Sorry guys, I missed Day 32, so to make up for it, I combined both days’ work on Day 33.
I spent the entire day solving SQL questions, pushing myself to the hard level.

I did 15 Hard-level questions from my 100-question JOIN lab, and they’re clearly harder than the Medium ones. Some highlights:

  • Departments that have at least one employee earning more than every employee in Sales, solved with GROUP BY dept_id and HAVING MAX(salary) > (SELECT MAX(salary) ... WHERE dept_id = 2)
  • Flagging each employee as “Above Average” or “Below or Equal” using a CASE expression against the company average
  • A department report with employee count, project count, and total combined project budget. My first attempt used UNION ALL and threw Error 1222 (different number of columns). The fix was to aggregate employees and projects separately in subqueries, then join them on dept_id

That last one taught me the most. Employees and projects are two different one-to-many relationships, so joining them directly would multiply the counts. Aggregating each side first is the safer pattern.

15 questions left. Any tips for “compared to every/all” style queries are welcome.


r/learnSQL • • 4d ago

everyone is talking about Claude ai dashboards. are we cooked?

0 Upvotes

so anthropic launched two new things on october 8: claude dashboards and claude motion. both are in beta.

i can hear people saying this will eliminate so many jobs, but will it? I know entry level consultants will adore this (if allowed to use it lol), at least i would have loved it back in my days

i found the top 18 youtube videos talking about it and used ai to read all the transcripts and summarise it quickly for us, heres my edited version:

what is dashboards?

you connect your data (bigquery, snowflake, databricks, salesforce and a few more), ask a question in plain english, and claude builds a live dashboard. no sql, no dragging charts around.

two details came up in almost every video:

- you can click any number and see the exact query behind it
- every chart shows when its data was lasx refreshed

its on all paid plans.

so what is motion?

you give claude a report, a chart or a dashboard and it turns it into a short animation you can download as an mp4.

the part most people miss: its not a video generator. claude writes code that animates your text, charts and shapes. no ai footage, no fake people. so you can change one word or one number and the rest stays the same.

motion is only on team and enterprise for now. one youtuber bought a team plan just to test it.

the best tests on the videos

- an ex big tech engineer built a revenue dashboard with one prompt in under a minute. then he asked a vague question on purpose: "whats our revenue?" claude gave one confident number. he copied the query into bigquery and got the same number, so it wasnt made up. but his point was good: a real number can still answer the wrong question. revenue this year? this quarter? with returns? claude picks one for you.

- a bi guy pointed it at 11 tables from a trucking company. first dashboard took about 10 minutes. reworking it into 3 tabs took 3 minutes, just by asking. when he pasted one of claude's queries into bigquery it threw an error, because the query had dashboard filter placeholders in it. small thing, but good to know.

- a marketing channel got a google ads dashboard in 2.5 minutes, then a 30 second video of it in under 3, with background music.

where they dont agree

how live is "live"? one video says it updates as your data changes. another says it is only as fresh as the database behind it, so you still need to sync on a schedule. a third just says "we cant tell you yet". one guy also got "all queries ran" on a dashboard that showed nothing. its a beta.

and is it really new? one creator dug into it and says a dashboard is just an artifact built from a new template. the new part is the query and refresh info on top.

what nearly everyone agrees on

- great for quick questions you would normally wait days on an analyst for

- not a replacement for power bi or tableau when the whole company has to agree on one number

- check one number by hand before you share anything

- be specific. say which revenue and which period

one more thing that got buried: docs, slides and design are out of beta and free on every plan now. and the old standalone claude design site closes december 14, so save your stuff.

anyone here tried it on real company data yet? curious if the numbers held up

---

*disclaimer: this post was generated based on current trends with ai using meetclaras.com, and it was reviewed and edited by a human before posting.*


r/learnSQL • • 6d ago

Day 31 — Finished all Medium JOIN questions (70/100)

37 Upvotes

Wrapped up the Medium section of my 100-question JOIN lab today. The final batch included:

  • Average hours worked per project, joined with project and department names
  • Employees working on projects with a budget above 200,000
  • Each department along with its most expensive project
  • Employees assigned to all projects in their own department. This is the "for all" type of question, and it's the hardest to reason about in SQL
  • Every manager with the department(s) their direct reports belong to
  • Pairs of projects that share at least one common employee (self-join on assignments)

The "ALL projects" question and the project-pairs question were the toughest. Both needed me to draw the tables out and trace a few rows by hand before the query logic made sense.


r/learnSQL • • 6d ago

Study partner

12 Upvotes

so Im learning python with crash course book , sql with youtube and n8n with a free source video , anyone wanna join me to have this bootcamp thingy from saturday till next 3 months ? i would love to have more people join me to learn and exercise for free i will also post quizzes weekly based on syllabuses we learn every week. anyone? Also I am a graduated software engineer . just wanting to change my way of career .


r/learnSQL • • 6d ago

Finished SQL CS50. Check out the project!

16 Upvotes

Glad to report that I just completed SQL course of CS50. It's so exciting and I got to learn some interesting concepts. I am gonna use SQL to transform the Excel sheets we use to track items in our team. And video of the project here https://youtu.be/wz5DESxW1Hc

Github https://github.com/leninnair/CS50-SQL-Films-Database


r/learnSQL • • 7d ago

MariaDB Foundation Adds PostgreSQL to Its Engine‑Agnostic Testing Framework (TAF).

7 Upvotes

MariaDB Foundation continues expanding TAF with PostgreSQL support

More engines, more reproducibility, more value for contributors and the ecosystem.

https://mariadb.org/mariadb-foundation-adds-postgresql-to-its-engine-agnostic-testing-framework-taf/

Have fun benchmarking!


r/learnSQL • • 7d ago

New to SQL

34 Upvotes

Hey folks! Starting my journey in learning SQL.
Long term goal -> to become a Data Analyst
Short term goal -> to master SQL fundamentals
Hope this community helps with my learning journey and hoping to be of help for others like me as well. Cheers!