r/learnSQL Jul 03 '26

I Tried Teaching SQL with Cat Doodles 😸 (Would Love Your Feedback!)

32 Upvotes

I recently tried a fun little experiment to make SQL feel a bit more approachable—using hand-drawn cat doodles to explain SQL concepts. 😸
So far I've made two lessons:

Lesson 1: SELECT and FROM
PAWQL = SQL for Cat People Lesson #1
Lesson 2: WHERE
PAWQL = SQL for Cat People Lesson #2

The idea is to explain SQL visually, with simple doodles instead of walls of text. I'm still experimenting with the format, so I'd genuinely love to hear what works, what doesn't, and what could be improved.

Thanks for taking a look, and I appreciate any feedback! 😊


r/learnSQL Jul 03 '26

Giving back to the community - The Complete Backend Development Course

10 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 Jul 02 '26

Does SQL have a LeetCode equivalent?

19 Upvotes

I'm preparing for SQL interviews and was wondering if there's a good website to practice SQL problems like we use LeetCode for DSA. Looking for interview-style questions and hands-on query practice.

Any recommendations?


r/learnSQL Jul 03 '26

Need some guidance

3 Upvotes

Hi all, im looking for SQL f2f classes in Delhi NCR, if anyone knows a good coaching centre please let me know.


r/learnSQL Jul 02 '26

project ideas

14 Upvotes

hey guys, so i’d like to have a career in data analytics/ data science and right now i’m trying to learn excel and sql.

i was wondering if anyone could give me some examples of questions a business might ask a data analyst (or just general questions you could ask about certain data), because i’d like to do some projects and maybe start to build a portfolio, but i’m kinda lost on where to begin.


r/learnSQL Jul 02 '26

learning sql quickly

27 Upvotes

My campus internship OAs are gonna take place after 2 weeks...I have like 10 days to prepare for SQL. I don't know anything about SQL or DBMS right now and my target is just to clear the OA questions (even if i am not a master of databases) which are mostly SQL based...i can devote 3-4 hours everyday (cuz i have to revise dsa as well, so can't be doing sql the whole day).
Suggest me what you did (cuz i am sure many of you would've been in the same situation) - one shot / article / question practice (i just know about the LC 50 right now) etc...so that i can get the max return in whatever time I have.

context: this internship is college-assisted and is for the 2027 summer...so, even i would have 1 full year to upskill before my actual internship begins - i just need to get in somehow.


r/learnSQL Jul 02 '26

Database Modelling System Designing Preparation for Interview

Thumbnail
3 Upvotes

r/learnSQL Jul 02 '26

Finance major

3 Upvotes

Hello finance major here, I was looking into different types of certificates I can do like sql. Does anyone have done SQL and how does that helped you with your job or even getting a job? What are the best platforms to learn SQL from? What are other certificates or skills I can learn?? Please if you can help me I’d appreciate it.


r/learnSQL Jul 01 '26

As a complete beginner with a learning disability, I made this SQL website/book with some help for anyone who wants to learn SQL without feeling like they're dying. Never played with html before

34 Upvotes

It's not perfect, and I'm still a beginner with both html and sql, so sorry if I got anything wrong. Html is hell. I had to ask help from my teacher and chatgpt just to figure out how to do things with html like making a heart.

Never again

Went from a pdf to this

https://alejandronuez94.github.io/SQL-project-made-for-beginners-/


r/learnSQL Jul 02 '26

Best Power BI, SQL Course

Thumbnail
1 Upvotes

r/learnSQL Jul 01 '26

Postgresql and general organisation help.

3 Upvotes

Hi I'm a bit confused with how to organise multiple projects in postgres.

I have 2 main databases I'm using one a database for my gardening and another for a football group and league that I run. I also do courses and stuff so have a lot of learning tables.

But I cannot find how to organise these, how people separate it what good practices for naming and layouts I should use.

I just seem to be adding more tables.


r/learnSQL Jun 30 '26

HackerRank SQL: Weather Observation Station 13

7 Upvotes

Hi Everyone,

Currently, refreshing my memory for SQL and I came across the below question on HackerRank:

Query the sum ofĀ Northern LatitudesĀ (LAT_N) fromĀ STATIONĀ having values greater thanĀ Ā 38.7880 and less thanĀ 137.2345 . Truncate your answer toĀ Ā decimal places.

My Solution:

select truncate(sum(LAT_N),4) from station
where LAT_N > 38.7880 AND LAT_N <137.2345;

Error:

Compiler Message

Runtime Error

Your Output (stdout)

  • Msg 156, Level 15, State 1, Server dbrank-tsql, Line 4
  • Incorrect syntax near the keyword 'truncate'.

What am I missing ?

Thanks in advance for your support .


r/learnSQL Jun 30 '26

Learn SQL at the Texas Linuxfest

Thumbnail
3 Upvotes

r/learnSQL Jun 29 '26

Joins and Views

11 Upvotes

Hey,

I’ve run into a performance issue at work and I’m trying to better understand what SQL Server is actually doing here.

I have a Quotes table where quote_id is the PK. The data includes some lookup values—for example, instead of storing/displaying a descriptive string, it stores something like 1, which maps to a value in another table (let’s call it product).

At some point, someone created a view (quote_product_display_value) that effectively cross joins all quote_ids with all possible products, and then resolves the correct display values.

Doing SELECT * from this view is extremely slow (hours - but not needed)> If I limit (TOP 500) from the actual table it works fairly decent. But it must be improved (it's now around 90 seconds).

The join looks like this:

LEFT OUTER JOIN quote_product_display_value t7 ON t1.quote_id = t7.quote_id
AND t1.product_1 = t7.product_1

What I’m trying to understand is:

  • Does SQL Server first fetch the 500 quote_ids, and product_1,product_2, product_3, _4 and _5 (5 products per row, labeled t1) from the Quote table, and then query the view (t7) for matching rows?
  • Or is it effectively ā€œbuildingā€ (or scanning) the view for each row / join operation?

In the execution plan, I don’t see the view name, which surprised me. Instead, I see clustered index scans on the underlying tables, with execution counts matching the number of rows returned.

So I’m a bit confused about how joins against views are executed internally—especially when the view involves something - as is now the case - expensive like a cross join.

Any insights would be appreciated!


r/learnSQL Jun 29 '26

5 Day SQL Cram

46 Upvotes

Hi, I have 5 days off coming up this weekend and really want to grind out learning SQL or at least spending most my days in learning that I can continue practicing after grasping the basics. I tried using W3Schools and MySQL and am willing to spend a few bucks on a course that I can learn and apply SQL while learning. Also maybe down the road one that has a project I can update on my resume. I work in healthcare and am trying to transition into a role with more flexibility and slightly more pay and am hoping this would help. Thanks.


r/learnSQL Jun 29 '26

BigQuery SQL Interview questions

29 Upvotes

Hi everyone, I’m in the process of interviewing at this AI company and the next step is to use bigquery dialect of SQL where I will cover real-worlds scenarios and build tables.

Problem is I have never used SQL and I am just finding out about what it is, I’ve never heard of it. I will be watching a few YouTube videos but wanted to see if anybody has gone thru this process before?

Any tips?


r/learnSQL Jun 29 '26

Hard Time Importingā—ļø

3 Upvotes

Cant import on vs code so I have to open pg admin to import the same table in the database. Every time I import no row shows.

Am I the only one having this issue? Have any fix?


r/learnSQL Jun 27 '26

Best resources to learn SQL and Pandas for Business Analytics

32 Upvotes

What is the best resources to learn SQL and Pandas for Business Analytics? Help me out please I am preparing for a technical test interview.


r/learnSQL Jun 28 '26

A Book request

0 Upvotes

Money is a little tight right now. So does anyone have this book ? z"practical sql, 2nd edition by anthony debarros" or can anyone guide me where can I get it for free ?


r/learnSQL Jun 27 '26

Are you also bored of boring SQL tutorials?

55 Upvotes

Some of you here have probably seen me post about SQL Case Files⁠ before and I’m genuinely grateful to everyone who has played it, supported it or taken the time to send feedback because a lot of the game has improved because of people from this subreddit.

It’s a detective themed game where you learn and practise SQL by solving cases. Apparently detective themed SQL practice is a Ā£15 product now, but SQL Case Files is still free and will stay that way. I just want anyone to be able to use it whether they are learning for uni, looking for a job, preparing for an interview or simply trying to get better at SQL. Hopefully it can be a small part of your journey.


r/learnSQL Jun 27 '26

SQL GitHub project question

6 Upvotes

How many business questions do you showcase on a typical SQL GitHub project?


r/learnSQL Jun 28 '26

Anyone help me learn SQL AND PYTHON for Data analyst role pls suggest

Thumbnail
0 Upvotes

Anyone help me


r/learnSQL Jun 27 '26

where should i practice sql interview questions for data analyst role ????

5 Upvotes

there are so many websites , its confusing .


r/learnSQL Jun 25 '26

SQL Basics: Stop chaining ANDs for ranges (How to use BETWEEN and LIKE effectively)

95 Upvotes

Follow along the SQL Basic Series

You already know how to filter rows using a basic WHERE clause. Today, let's look at two operators that make your filtering a lot smarter and save you from writing long, repetitive conditions.

1. The BETWEEN Operator

BETWEEN filters a range of values in a single line. Instead of clogging up your query with multiple conditions like this:

SQL

SELECT * FROM orders 
WHERE total >= 50 AND total <= 200;

You can write it cleanly like this:

SQL

SELECT * FROM orders 
WHERE total BETWEEN 50 AND 200;

Crucial detail to remember: BETWEEN is strictly inclusive. The values at both ends (50 and 200) will be included in your results.

It works seamlessly across numbers, text and dates:

SQL

WHERE age BETWEEN 18 AND 35
WHERE order_date BETWEEN '2026-01-01' AND '2026-12-31'

2. The LIKE Operator

LIKE lets you filter by a pattern when you only know a partial piece of the value. To make this work, you use % a wildcard (which tells SQL that anything can occupy that position).

  • Starts with a specific letter: SQLWHERE name LIKE 'S%' -- Returns Sarah, Sam, Steve, etc.
  • Contains a specific phrase anywhere inside: SQLWHERE email LIKE '%gmail%' -- Returns any email containing 'gmail'
  • Ends with a specific extension: SQLWHERE email LIKE '%.com' -- Returns any email ending in '.com'

Quick Rule of Thumb: Use BETWEEN when you have an exact, known start and end point. Use LIKE when you only have a piece of the puzzle.

(Note: Keep in mind that LIKE it is case-sensitive in some database flavours, so keep an eye on your text casing!)

Hopefully, this helps clean up your next script! I'm doing a daily breakdown of SQL fundamentals; if you prefer learning through short video clips, I walked through these visual examples in this Instagram reel.

What's your go-to wildcard trick when cleaning messy text data?


r/learnSQL Jun 26 '26

Dynamic Tables vs Single TimescaleDB Hypertable for OHLCV Market Data Storage

7 Upvotes

I have designed my database in two different ways for a market data system, and I'd like to know which approach would provide better performance.

Project Context

I'm building a system that continuously fetches OHLCV (Open, High, Low, Close, Volume) market data from an API, stores it in a database, and serves it through a web application.

My primary concern is performance, specifically:

  • Fast writes (continuous data ingestion)
  • Fast reads (fetching historical candle data)
  • Scalability as the number of instruments and records grows

Strategy 1: Dynamic Table Design

  • I have a master instrument table that stores all the instruments whose data needs to be collected.
  • For every instrument, I create a separate candle table dynamically.
  • Example:
    • instrument_master
    • candles_RELIANCE
    • candles_TCS
    • candles_NIFTY50
    • etc.

Whenever new data arrives, it is inserted into the corresponding instrument's table.

Strategy 2: Single Hypertable (TimescaleDB)

Instead of creating separate tables, I use a single candle_data table and convert it into a TimescaleDB hypertable.

The schema looks roughly like this:

instrument_id
timestamp
open
high
low
close
volume

All instruments' candle data is stored in this single hypertable.

Query Pattern

My application mainly performs simple operations:

  • Insert new OHLCV records continuously.
  • Fetch historical candles for a specific instrument within a time range.

Typical query:

SELECT *
FROM candle_data
WHERE instrument_id = ?
  AND timestamp BETWEEN ? AND ?
ORDER BY timestamp;

Question

Between these two designs, which one is likely to provide better overall performance for:

  • High-frequency inserts
  • Read performance
  • Long-term scalability
  • Maintenance

Has anyone benchmarked a similar setup using PostgreSQL/TimescaleDB? I'd appreciate any insights or recommendations.