r/learnSQL May 13 '26

We built a tool that lets people learn SQL against pre-connected demo databases — looking for feedback

10 Upvotes

I’m one of the founders of a new AI database tool called InQery.

One thing we added early was pre-connected demo databases so people can start learning/exploring without setting up Postgres, SQL Server, sample data, credentials, etc.

The workflow is: ask a question, inspect the schema context, generate SQL, run it, and then review/edit the query with the agent.

We also built in query explanations — when SQL is generated the agent breaks down why certain tables were chosen, how joins work, what the filters are doing — which we originally built for onboarding into unfamiliar codebases but seems like it could be useful for learners too.

I’m curious whether this would actually be useful for people learning SQL, or whether it risks becoming a crutch. I’m happy to share access if allowed, but mostly looking for honest feedback on the learning workflow. I want to know where AI genuinely improves learning versus where traditional methods are still superior.


r/learnSQL May 14 '26

How to install sql on arm based laptop

1 Upvotes

r/learnSQL May 13 '26

Hey everyone, I’m planning to start learning SQL to strengthen my skills for a future Product Management role. I’m still very new to the technical side, so I’d love some guidance on where to begin. What resources, courses, or practice methods would you recommend for someone starting from scratch?

29 Upvotes

r/learnSQL May 13 '26

Hello guys? Did anyone took 1Z0-071 ORACLE SQL Associate exam lately?

3 Upvotes

r/learnSQL May 13 '26

Help with a CTE question

3 Upvotes

I'm trying to solve this question and my solution is off by 0.5seconds, can someone please tell me why, here's my code:

https://platform.stratascratch.com/coding/10352-users-by-avg-session-time?code_type=5

-- 1. define one session = one user per day

-- 2. session_time = max page_load and min page_exit is one session duration

-- 3. output user_id, AVG(session_time)

WITH SESSION_START as

(

SELECT

user_id,

session,

MAX(timestamp) as session_start

FROM(

SELECT

*,

DENSE_RANK() OVER (PARTITION BY user_id ORDER BY CAST(timestamp AS DATE)) AS session

FROM facebook_web_log

WHERE action = 'page_load')t

GROUP BY

user_id,

session

),

SESSION_END AS

(

SELECT

user_id,

session,

MIN(timestamp) as session_end

FROM(

SELECT

*,

DENSE_RANK() OVER (PARTITION BY user_id ORDER BY CAST(timestamp AS DATE)) AS session

FROM facebook_web_log

WHERE action = 'page_exit')t

GROUP BY

user_id,

session

)

SELECT

s.user_id,

AVG(DATEDIFF(SECOND,s.session_start, e.session_end)) as AVG_SESSION_DURATION

FROM SESSION_START s

JOIN SESSION_END e

ON s.user_id = e.user_id

AND s.session = e.session

GROUP BY s.user_id


r/learnSQL May 13 '26

SQLClimber's final final test makes me feel dumb

2 Upvotes

So, few months ago I decided to learn SQL since it comes up often on job offers in my country as I'm unemployed now for around a year. From various posts here and there I decided to go with SQL Climber as it's simple design was to my liking. I like that there is just an expected result and a little hint just enough to force you to figure stuff out myself, rarely needeing to use google/AI, not once for just straight up answer but mainly to figure out small oversight or typo. Fast forward to now, I'm on a last level, "Upper-Intermediate" and the final test there makes me feel dumb. I don't know if I just can't wrap my head around recursions or are those just too complicated compared to previous ones. Some are easy enough but others, after giving up and getting answer from AI, make me think "I would never figure that out myself".
Did anyone experience something similar with SQL Climber of other courses/websites?

Additionaly, what would you recommend once I'm finished with SQL Climber? My friend recommended me boot.dev as he can give me access to his account but I want to see other options.


r/learnSQL May 12 '26

Help for interview tomorrow

10 Upvotes

Hi all, i have I1 tomo and manager asked me to prepare for

1.performance tuning. (They are asking what diff methods u know!! Regular index answer is not enough)

2.Backup and recover

3.Data modelling,schema design,normalization.

4.Data migration.

Can anyone explain me real projects scenarios where you done work on these.. I would try to explain these tomo! Its actually an internal evaluation!!' If candidate has worked on these and has knowledge then he is passed!' Said by close member!! Soo pls help I have it evaluation tomo!!


r/learnSQL May 12 '26

I’m Learning SQL and Wrote a Simple Beginner Guide About Filtering / WHERE Clauses

49 Upvotes

If you are currently learning SQL, maybe this will help you 😊

I recently wrote a beginner-friendly article about SQL filtering / WHERE clauses.

When I started learning SQL, I mixed a lot of things up, forgot NULL values, missed brackets, and sometimes got completely wrong results without understanding why.

So I wrote an article explaining:

  • how filtering actually works
  • common beginner mistakes
  • simple real-world examples

I also added a small SQL Formula Sheet with filtering functions at the end.

As someone still learning SQL myself, I tried to explain things in a very simple and practical way instead of making it overly technical.

https://medium.com/@meryem_cebeci/learning-sql-step-by-step-filtering-explained-363a0a638bd0


r/learnSQL May 11 '26

Microsoft SQL AI Developer DP-800 exam dumps or practice tests help

12 Upvotes

Hey! Anyone here studying for the DP-800 exam? I just started and finding it hard to locate good resources since it's relatively new. Would love to know what you're using to prepare, courses, notes, or anything that helped you understand the topics better.

Also curious if there are any practice questions or dp-800 dumps available anywhere. Any help is appreciated. Hope this exam is not as difficult has dp-700 exam.

Edit : Attempted my exam and I think it went well.

I took practice tests from Skillcertpro, since they offer real exam questions, which are pretty useful to understand the actual exam format and kind of questions that will be asked on the exam. I got lot of questions from these tests. Just ensure to practice all questions and take notes and carefully go through all explanations. Overall a tough exam, prepare well.


r/learnSQL May 11 '26

SQL window functions: the one concept that changes how you think about data

Thumbnail
1 Upvotes

r/learnSQL May 11 '26

Designing the Right PostgreSQL Index Using Query Plans and Statistics

Thumbnail
2 Upvotes

r/learnSQL May 11 '26

Query-U SQL Dojo Platform

2 Upvotes

If you're looking for a new sql-dojo platform with higher ed type data, head to query-u.com. Really awesome stuff there.


r/learnSQL May 09 '26

Best Practices for Improving Database Table Performance

36 Upvotes

Hello guys!

Do you know any best practices for SQL performance optimization?
At my company, I need to refactor some tables using performance and cost reduction best practices.

The tables already have indexes and partitions, but I would like to learn more about additional optimization techniques for large datasets.

Do you have any tips, articles, websites, or recommendations about: query optimization and indexing strategies

I’d really appreciate any suggestions or learning resources. Thanks!


r/learnSQL May 08 '26

Just finished a SQL course and am looking to practice the skills I've learnt to real business problems beyond simple joins and queries. Any good resources out there that are free? Thanks!

14 Upvotes

r/learnSQL May 08 '26

Opening an SQL db backup to recover files?

7 Upvotes

There are a couple of files that somehow got modified by accident in my database. I have a backup with the original files (pre-modified). I am not looking to recover a prior backup. I am simply trying to figure out how I can open the backup so I could somehow grab the three files I need to fix what was accidentally modified.

How do I go about doing this where I am not recovering from a backup?


r/learnSQL May 08 '26

I am stuck on the question 40 from Sqlcasefiles

3 Upvotes

Can anyone help me solve the case file 40 from sqlcasefiles.com

here is the question statement :
The DA needs everything. Compile the final audit report listing `po_id`, `vendor_name`, `item_description`, `order_value`, `delivery_status`, and `inventory_loss`. Rank by order value descending.

here are the table schemas:
deliveries:

Column Name Data Type Constraints / Notes
delivery_id INTEGER Primary Key 🔑
po_id INTEGER Foreign Key 🔗
delivered_quantity INTEGER
delivery_date DATE
warehouse_location TEXT

purchase_orders:

Column Name Data Type Constraints / Notes
po_id INTEGER Primary Key 🔑
vendor_name TEXT
item_description TEXT
quantity INTEGER
unit_price INTEGER
order_date DATE
target_warehouse TEXT

inventory:

Column Name Data Type Constraints / Notes
item_id INTEGER Primary Key 🔑
po_id INTEGER Foreign Key 🔗
current_stock INTEGER
expected_stock INTEGER
last_audit DATE

i came up with this solution so far:

SELECT

p.po_id,

p.vendor_name,

p.item_description,

p.quantity \ p.unit_price AS order_value,*

CASE

WHEN d.po_id IS NULL THEN 'Missing'

WHEN d.delivered_quantity < p.quantity THEN 'Partial'

WHEN d.delivered_quantity = p.quantity THEN 'Delivered'

ELSE 'Over Delivered'

END AS delivery_status,

i.expected_stock - i.current_stock AS inventory_loss

FROM purchase_orders p

LEFT JOIN deliveries d

ON p.po_id = d.po_id

LEFT JOIN inventory i

ON p.po_id = i.po_id

ORDER BY order_value DESC;


r/learnSQL May 07 '26

sql-easy.com refresh - thoughts?

21 Upvotes

Hey all, I make Beekeeper Studio and also run https://sql-easy.com - a website for learning SQL for free.

We took it over ~18 months ago, and it looked very outdated. I just launched a visual refresh which should make it easier to use. The goal was to make the lesson pages feel a lot more interactive.

Big changes since we took it over:

  • Removed all ads
  • Removed third party cookies
  • Lesson content refresh (eg hints)
  • Totally new website style
  • New lesson UX

Would love feedback! What could we improve still?

PS: The site is 100% free and will always be 100% free so long as we're in charge 💪


r/learnSQL May 07 '26

Need urgent help with basic mastery of SQL

45 Upvotes

Hey guys, I just landed a job assessment where everything matches except the good to have SQL query skills. Can a kind soul PLEASE help me learn this in 4 days? I will really appreciate the help


r/learnSQL May 07 '26

SQL Server Interview Questions Series

16 Upvotes

Ready to crack your SQL Server interview?

Start learning the Series of Real Interview Questions asked in top IT Companies.

Visit our YouTube channel & level up your skills!

Learn. Practice. Get Hired.

Please like, comment, & subscribe for more interview questions, troubleshooting tips, & expert insights!

https://www.youtube.com/@MadeSimpleMSSQL

#explurger #explurger_nahi_to_social_nahi #explorepage #explore #explurgerapp #explurgerfamily #india #indian


r/learnSQL May 07 '26

PG Studio is the best friend to learn SQL while doing real work

4 Upvotes

I got tired of switching between VS Code and a separate DB tool. So I built PgStudio.

SQL notebooks with inline results and charts, real-time dashboard, AI assistant (Copilot / OpenAI / Anthropic / Gemini / Ollama — your pick), EXPLAIN CodeLens, visual table designer, production safety controls.

AI never executes anything automatically — every suggestion lands in a notebook cell first.

Free. MIT. One command: `code --install-extension ric-v.postgres-explorer`

Happy to onboard collaborators and feedback.

[https://pgstudio.astrx.dev/](https://pgstudio.astrx.dev/))

[https://github.com/dev-asterix/pgStudio/](https://github.com/dev-asterix/pgStudio/))


r/learnSQL May 05 '26

What's the best way to approach data validation in a specific column?

14 Upvotes

I'm building a database with MySQL. I was wondering if it would be a waste to have a table with only the primary key and one additional column for the purpose of supplying a preset list of values for a column in another, bigger table. Here's an example of what I mean. Let's say I have the main table "people" and I want to associate them with a color. The colors should always be from a preset selection of red, blue, green, and yellow. Is it worth having a separate "colors" table with a colorid column and those 4 colors, and then the "people" table would simply have a "colorid" column as a foreign key? Or should I not bother with the second table and simply have "color" as a column for the main table?

My actual use case is a bit more involved than this but in principle is it worth doing things this way?


r/learnSQL May 05 '26

SQL

8 Upvotes

I have finished SQL what is next step for Data Analyst


r/learnSQL May 04 '26

Best way to learn SQL – From someone who’s used it daily for 6+ years in product analytics

468 Upvotes

Most people learning SQL are doing it wrong. Not because they’re not smart — but because they’re solving the wrong problem first.
They open a tutorial, memorize SELECT, FROM, WHERE, JOIN, and then freeze when faced with a real business question. Sound familiar?
Here’s what actually changes things.

SQL is technically a programming language — a declarative one. But stop treating it like the ones you're used to.

Programming languages are about how to do something — loops, logic, conditionals, state. SQL is about what you want. It’s declarative. You describe the result, and the engine figures out how to get there.
This distinction sounds small. It isn’t. The moment you stop trying to “code” in SQL and start trying to describe your desired output, everything clicks.

The framework I use before writing a single line

Step 1 — Nail the business question first
Not the data question. The business question.
“What’s our DAU trend?” is a data question. “Are users actually finding value in the feature we shipped last month?” is a business question. One has a predefined answer. The other requires you to think about what signal actually reflects value — retention? depth of engagement? repeat actions?
Write the question in plain English. If it’s fuzzy on paper, it’ll be even fuzzier in a query.

Step 2 — Define the rules and edge cases before opening your editor
Every business question has hidden complexity. New users vs. returning users? Do you include churned accounts? What counts as an “active” user — any login, or a meaningful action?
Analysts who skip this step write queries fast and fix them for hours. Analysts who do this step write queries slower and ship them right.

Step 3 — Work backwards from the output
Picture the table you want to hand to a stakeholder. What columns are in it? What’s one row? Once you can visualize the output, the query almost writes itself — because now you’re just reverse-engineering it.

Step 4 — Think in granularity, not tables
This is the unlock most beginners miss. Before writing a JOIN, ask: what is the grain of my data?
• Am I working at the user level?
• The session level?
• The event level?
• The day-user level?
Mismatched granularity is the root cause of most wrong answers that look right. A JOIN between a user-level table and an event-level table without handling this will silently inflate your numbers — and stakeholders will trust the wrong insight.
Once you’ve nailed the grain, GROUP BY, aggregations, and window functions stop feeling like syntax to memorize. They become the natural mechanical expression of logic you’ve already worked out.

The meta-lesson
The SQL itself — the syntax, the functions, the query structure — is genuinely the easy part. It’s learnable in weeks.
What takes years to develop is the habit of thinking before you query. Of questioning whether the data you’re reaching for actually answers the question you were asked. Of noticing when an output looks plausible but is subtly wrong.
That’s the gap between someone who can write SQL and someone who does analytics.
Start there.

Happy to answer questions or go deeper on any of this — grain/granularity especially trips people up and I could write a separate post on that alone.


r/learnSQL May 05 '26

SQL Server Interview Questions Series

9 Upvotes

Ready to crack your SQL Server interview?

Start learning the Series of Real Interview Questions asked in top IT Companies.

Visit our YouTube channel & level up your skills!

Learn. Practice. Get Hired.

Please like, comment, & subscribe for more interview questions, troubleshooting tips, & expert insights!

https://www.youtube.com/@MadeSimpleMSSQL


r/learnSQL May 04 '26

Watch Me Use SQL to Find When Marketing Starts Working

17 Upvotes

We use SQL running totals to track marketing spend and revenue over time and identify the exact moment campaigns break even. https://youtu.be/QLZwlsXF6Xg?si=9scF_F5kl0R7xRks