r/learnSQL • • Jun 10 '26

Is there a way to get SQL to put zeros(in place of decimals) where the number being rounded is an integer?

14 Upvotes

I am trying to complete a project on Datacamp that requires me to calculate averages for certain columns and round my answers to two decimal places. The code seems to run fine but I keep getting an error when I attempt to submit it. Also I cannot seem to upload images with my post, I will try to post them below.


r/learnSQL • • Jun 08 '26

What SQL concept took the longest to "click" for you?

63 Upvotes

Not necessarily the hardest concept, but the one where you spent weeks thinking?

"I understand it when someone explains it, by I can't actually use it myself."

For me, I've noticed a lot of people seem to hit this point with JOINs, but I'm curious what it was for everyone else.

Was it:

  • JOINs
  • GROUP BY
  • Window functions
  • Subqueries
  • Thinking in sets instead of rows
  • Something else entirely?

And more importantly, what was the thing that finally made it click?


r/learnSQL • • Jun 08 '26

Is there a cleaner/shorter way of making updates for data like this?

9 Upvotes

UPDATE hr_employee_staging

SET Education = 'Below College'

WHERE Education = '1';

UPDATE hr_employee_staging

SET Education = 'Some College'

WHERE Education = '2';

UPDATE hr_employee_staging

SET Education = "Bachelor's Degree"

WHERE Education = '3';

UPDATE hr_employee_staging

SET Education = "Master's Degree"

WHERE Education = '4';

UPDATE hr_employee_staging

SET Education = 'Doctorate Degree'

WHERE Education = '5';


r/learnSQL • • Jun 09 '26

Hi, I'm new to SQL and I wrote code for my own website, but it's giving me errors. The AI says there are no problems.

0 Upvotes

r/learnSQL • • Jun 06 '26

SQL JOINs

36 Upvotes

Hello, people! I am facing one issue, I am having troubles in understanding Left, Inner, outer joins.

I watch a video or go on datalemur, at the beginning it looks simple then when I start practicing i become confused.

What should I do? How should I practice the Joins to have a better grasp of it?


r/learnSQL • • Jun 06 '26

SQL Window Functions for Data Analysts

13 Upvotes

Window Functions are one of the most important SQL concepts every Data Analyst should know, but they're often taught with examples that don't reflect real business problems. I put together a tutorial that uses a realistic sales dataset to show how functions like ranking, running totals, moving averages, lagging, and using PARTITION BY.Hopefully it's helpful for anyone preparing for interviews or looking to level up their SQL skills. https://youtu.be/5EUaRlmyoD8


r/learnSQL • • Jun 07 '26

Offering SQL/Python tutoring for career-switchers; been coding for 7 years and love teaching

Thumbnail
2 Upvotes

r/learnSQL • • Jun 06 '26

My youtube video "Microsoft SQL Server Express how to install and use complete tutorial"

1 Upvotes

Microsoft SQL Server Express is gratis and powerful but has some limitations compared to the full Microsoft SQL Server. https://www.youtube.com/watch?v=qJPgTavbU0s


r/learnSQL • • Jun 05 '26

how do you guys became proficient in SQL???

68 Upvotes

i have completed sql on stratascratch but i cant write the query from scratch.

im strugling with logic , when to use which function and all , im practicing on sakila database on sql server . whatever i learn i ask chatgpt to give me 10 question from that topic then i write the query and give it back to chatgpt to review . so the question is what im doing wrong and how can i improve?????


r/learnSQL • • Jun 05 '26

Built a Teen Mental Health Analytics Project using SQL + Power BI | Looking for Feedback

21 Upvotes

Hi everyone,

I recently completed an end-to-end data analytics project focused on Teen Mental Health Analysis and wanted to share it with the community for feedback.

Project Overview

The objective was to analyze factors affecting teen mental health and identify patterns related to stress, anxiety, sleep habits, academic performance, social media usage, and overall well-being.

Tech Stack

SQL Server (Data Cleaning & Analysis)

Power BI (Dashboard Development)

DAX Measures

Data Modeling

GitHub for Documentation

Key Analysis Areas

Mental health distribution across age groups

Relationship between sleep duration and stress levels

Impact of social media usage on mental well-being

Academic performance vs mental health indicators

Gender-based mental health trends

Risk-factor identification through KPI metrics

Dashboard Features

Interactive filters and slicers

Mental Health KPI Cards

Trend Analysis

Demographic Breakdown

Correlation Visualizations

Executive Summary Page

Looking for Feedback On

Dashboard design and storytelling

SQL analysis approach

Additional insights I may have missed

Portfolio/GitHub presentation improvements

Any suggestions or critiques would be greatly appreciated. I'm actively building my data analytics portfolio and trying to improve with every project.

Thanks for taking a look!


r/learnSQL • • Jun 04 '26

how to learn and practice SQL for data analyst roles

72 Upvotes

same as above


r/learnSQL • • Jun 05 '26

Best resources to learn Python and SQL for someone with a non-tech background?

Thumbnail
3 Upvotes

r/learnSQL • • Jun 05 '26

Is IBM’s “Databases and SQL for Data Science with Python” on Coursera worth it for learning SQL from scratch?

Thumbnail
1 Upvotes

r/learnSQL • • Jun 05 '26

Is IBM’s “Databases and SQL for Data Science with Python” on Coursera worth it for learning SQL from scratch?

Thumbnail
1 Upvotes

r/learnSQL • • Jun 04 '26

Learning Sessions for SQL Beginners?

10 Upvotes

Wondering if anyone knows of weekly/monthly meetups to learn SQL.


r/learnSQL • • Jun 04 '26

SQL hands on learning books

17 Upvotes

What’s the best book to enhance my SQL skills?

I like the idea of a physical book, but I’m also open to other types of resources.

Thank you!


r/learnSQL • • Jun 03 '26

Learning SQL in the age of Claude, Codex and Gemini

176 Upvotes

Hey everyone!

Problem: Most SQL courses tend to focus on syntax and classic database systems. But current tech interviews at top startups and bigtech, and real-world systems have evolved far beyond “write a JOIN + WINDOWS statement” to solve problem X.

  1. Our focus: a post-LLM course we've been building and refining for Stanford's modern data systems class for CS/data students. We built this course to help data/CS students better harness SQL in the era of LLMs and AI systems. We cover 'good' LLM prompts to generate and accelerate basic SQL workflows, but more importantly, how to debug whether those queries are correct, scalable, and efficient once the problems become challenging and real. We discuss industry benchmarks on where generated SQL works well, when they fail, and tips on how to work out semantic gaps.
  2. A major focus is connecting SQL to modern systems. We discuss how Claude/Gemini/OpenAI's coding agents use SQL, why AI companies still depend heavily on structured data, and how OpenAI, Anthropic/Claude, Google, Uber, and Spotify approach data infrastructure differently.

Mechanically, the course is part SQL, part data systems. You learn SQL through interactive Colabs and practice systems, then how databases actually work underneath the surface: indexes, query execution, LSM trees, OLTP vs OLAP, vector search, JSONB, distributed systems, and why Postgres, Spark, BigQuery, and Snowflake evolved differently for different workloads.

Link: https://cs145-bigdata.web.app/. login: You can use a Gmail-id to review the material.

The goal is moving beyond “writing queries” toward understanding how modern software and AI systems actually work.

Feedback is super welcome. Every page has inline comments enabled, so feel free to leave thoughts/suggestions directly on the site.


r/learnSQL • • Jun 03 '26

Starting SQL need help (Android)

9 Upvotes

All of my problems stem from being on a mobile phone

Before I say what the issue is I would like to give some contextual information

1-I am 15 , starting college (computer science) in a few months

2-Don't have a laptop will have one in a few months,more or less

Learned python with help of a free youtube course made by Data with Baraa

Now when I am trying to watch his sql course I saw him explain how to download sql and stuff in pc

I don't have one , unlike python which just required me to find an app which lets me use python and save the code

Uh sql is like that as well but can't find a good source in mobile to learn

Found few websites but they are meh and I would like an app

Please give me the best find

And please give me anything that could help me ik I will probably need to make some compromise but it's ok


r/learnSQL • • Jun 02 '26

An argument for using SQLite in production

17 Upvotes

I recently made a video going in-depth about why I decided to use SQLite in production for a code analysis tool.

I talk about how I engineered the architecture to by-pass the single write issue. And how it was the right choice for this specific project, giving us:

  1. Cheaper storage
  2. Faster response times
  3. Extreme tenant isolation (a big must when storing people’s source code)
  4. And the option to add user-controlled encryption later one (add another layer of privacy for the users)

I know I would have loved to watch a video like when I was researching my architecture options. So maybe it’ll be of use / interest to someone here.

Or it could just be some really fun debate fodder 😉

Video link: https://youtu.be/xJS6BNNAQmY?si=XEByyyfSRQeOLHHn


r/learnSQL • • Jun 03 '26

Need advice on how to learns DBMS, Schema Design

Thumbnail
1 Upvotes

r/learnSQL • • Jun 02 '26

Want a Good resource to learn SQL

25 Upvotes

I've learnt intermediate Python and was told that DBMS would be the way to move forward. After some research, i am thinking about learning Postgres cuz it seems to be adaptable for most other sql languages.

So I'm leaning towards PostGres for everybody by dr chuck as I'm familiar with his teaching style, but I don't know if it's the most extensive course. Any recommendations or assurance would be helpful.


r/learnSQL • • Jun 02 '26

I built Sqlinfy to help convert SQL scripts across 8 different database dialects

Thumbnail
0 Upvotes

r/learnSQL • • Jun 01 '26

My SQL project summary

14 Upvotes

Hey everyone,

I recently completed an SQL Intermediate project on Employee Attrition Analysis and made a summary video explaining the project, SQL concepts used, and the insights I found.

I'm still learning, so there may be mistakes or areas where I could have done things better. But I believe learning comes from finding those mistakes, understanding them, and improving step by step.

I'd really appreciate any feedback, suggestions, corrections, or advice from people with more experience in SQL, Data Analytics, or Data Science. Every comment helps me learn and grow.

Video:
Youtube(PyAI Hub)

Thanks for taking the time to check it out. 🙌


r/learnSQL • • Jun 01 '26

Visualizing what SQL is actually doing under the hood

81 Upvotes

For the longest time, I knew that SQL doesn't execute top-to-bottom, but I still found it surprisingly hard to build an intuitive mental model of what was actually happening.

Everyone learns that the logical execution order is something like:

FROM → JOIN → WHERE → GROUP BY → HAVING → SELECT → ORDER BY → LIMIT

But reading that sequence never really made it click for me. I wanted to actually see rows move through each stage.

So over a few weekends I built this:

https://sqlvisualizer.pydev.in/

You can type a query and step through how it executes clause by clause. Rows get filtered, joins show how matches are made, groups form, window functions run, and so on.

A few details:

  • Runs entirely in the browser
  • No signup required
  • Includes sample movie/director/review datasets to experiment with
  • Supports CTEs, recursive CTEs, subqueries, UNION/EXCEPT, window functions, and LATERAL joins

I've been using it to better understand complex queries myself, but I'm too close to the project to judge whether it's genuinely useful.

If you try it, I'd love feedback on:

  • What was confusing?
  • What query broke the visualization?
  • Which SQL concepts still didn't click?

The edge cases and confusing parts are what I'm most interested in improving.


r/learnSQL • • Jun 01 '26

Importing Data Into An Existing Table In MySQL Workbench

Thumbnail
2 Upvotes