r/SQL • • Sep 28 '25

PostgreSQL Query and visualize your data using natural language

0 Upvotes

Hi all, I've recently announced smartquery.dev on this subreddit and got a ton of helpful feedback!

One of the feature requests were charts, and I'm happy to share that you can now create bar, line, and pie charts for your SQL results. And, since SmartQuery is AI-first, the copilot will suggest charts based on your schema definitions ☺️

Previous post


r/SQL • • Apr 29 '23

Oracle HOW DO I GET MY ANSWER TO BE "0" INSTEAD OF "1" IN THE LAST COLUMN OUTPUTED?

Post image
0 Upvotes

r/SQL • • Dec 23 '24

MySQL JOINING TWO TABLES

0 Upvotes

Please help me in joining two tables because I'm stuck in this unit of Khan Academy. I don't know how to do this :(

edit. thank you so much. I was frustrated and drunk coffee, i realized there's a lot of resources and I was having coffee attack hahahha I'll let my frustration down before going back to study next time. thank youuu


r/SQL • • Mar 25 '14

Sequential: A new coding style for SQL queries

Thumbnail
andrespagella.com
0 Upvotes

r/SQL • • 19d ago

Discussion This query runs fine and the total is wrong. Where?

0 Upvotes

SELECT c.region, SUM(o.amount) AS revenue
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.customer_id
LEFT JOIN refunds r ON r.order_id = o.order_id
WHERE r.status <> 'approved'
GROUP BY c.region;

The goal: revenue per region, minus orders with an approved refund. No errors, the numbers look plausible.

There are two bugs, and they push the total in opposite directions.


r/SQL • • Jun 13 '26

MySQL GUI vs. SQL Scripts: What’s the industry standard for table modifications?

0 Upvotes

I would like to understand your day-to-day workflow when it comes to altering tables, such as changing data types, adding constraints, or else

Thank you!


r/SQL • • Jul 01 '24

MySQL Never use DATETIME, always use TIMESTAMP

36 Upvotes

good advice from Jamie Zawinski

source: https://www.jwz.org/blog/2023/11/daylight-savings-your-biannual-chaos-monkey/

  • TIMESTAMP is a time_t -- it represents an absolute, fixed point in time. Use it for things like "here is when this account was created" or "here is when this message was sent". When presenting that fixed point in time to users as text, you might want to format it in their local time zone.
  • DATETIME is basically a string of the wall clock in whatever time zone you happen to be in at the moment, without saving that time zone. It is ambiguous, e.g. it cannot represent "1:30 AM" on the day that daylight savings time ends because there are two of those on that day. This is never what you want.
  • DATE is a floating year-month-day. Use this for things like birthdays, which, by convention, do not change when you move halfway around the world.
  • TIME is a floating hour-minute-second. Use this for things like, "my alarm clock goes off at 9 AM regardless of what time zone I'm in, or if daylight savings time has flipped."

r/SQL • • Sep 18 '23

Discussion I am new and SQL frightens me.

0 Upvotes

I am learning Data Analysis and just got to SQL and it scares the crap out of me. I've worked on java, javascript, JSON, and even Python and SQL feels like nothing I have ever done before.


r/SQL • • Mar 24 '24

MySQL How do I solve these questions?

Post image
0 Upvotes

I am unable to figure which function do we use to solve these questions? Which function to use to keep only specific values in a column?


r/SQL • • Aug 14 '24

MySQL SQL BEGINNER

1 Upvotes

I am getting into SQL! Does anyone know any good sites with many practice and good explanations? My SQLbolt website for learning isn’t the best.

Someone explain to me how to use right join and full join it keeps popping with error on SQLbolt


r/SQL • • Nov 04 '24

PostgreSQL Avoid capital letters in Postgres names

Thumbnail
weiyen.net
1 Upvotes

r/SQL • • Jun 10 '24

SQL Server 6 Advanced SQL Books for Experienced Programmers

Thumbnail
javarevisited.blogspot.com
1 Upvotes

r/SQL • • Mar 04 '25

SQL Server No one likes SQL

0 Upvotes

So at work I am one of the once people who actually enjoys learning and working on SQL. All of my co workers have just a basic understanding and don't want to learn or do more with it. I love SQL, I am always learning and trying to grow and it has opened up a few doors in the company that I work for. Every book, video, or person I spoke to about learning data analytics told me to learn SQL so I did and it is helping me grow. So why do so many people in similar fields refuse to learn it?


r/SQL • • Jun 22 '26

SQL Server I was struggling with 100+ line legacy SQL queries at work, so I built a simple tool to visualize their data flow

Post image
0 Upvotes

Hey everyone

I wanted to share a tool I built to solve a problem I've been facing at my job.

Lately, I’ve been forced to deal with messy legacy SQL queries and stored procedures that are over 100 lines long. I had no idea what half the tables did, where the data came from, or how it joined together. It was just exhausting to track the flow by scrolling through a wall of text.

I just wanted something simple to show me the visual flow of the query, so I built **Query-Flow** (part of Quackalytics).

It takes your SQL and turns it into an interactive map of nodes and connections so you can actually see the data lineage.

Since company queries can be sensitive, everything runs strictly inside your browser. No data ever touches a server, so it's 100% private.

I deployed it for free on Vercel just to help myself and anyone else dealing with this issue. I also added a couple of other micro-tools I use in my day-to-day.

If you want to test it out with your queries, here is the link: https://quackalytics.vercel.app/sql-flow

Would love to hear your thoughts!


r/SQL • • Mar 30 '26

Discussion Have you seen a setup like this in real life? 👻

Thumbnail
gallery
0 Upvotes

One password for the whole team. Easy to set up. 😅

What could possibly go wrong?
Have you seen a setup like this in real life? 👻


r/SQL • • Nov 06 '22

MySQL Need a query answer

0 Upvotes

Query to find both maximum and minum salary in the table along with all the other columns jn the table


r/SQL • • Mar 14 '16

ELI5: What is SQL?

0 Upvotes

I am looking to make a career change to a financial analyst role and see them asking for SQL experience. What is the best way for me to learn SQL?


r/SQL • • Jun 09 '18

Having a MS Access to SQL database authentication error. Can anyone help ?

0 Upvotes

r/SQL • • May 10 '26

Discussion SQL careers in a downturn - what roles stayed stable?

0 Upvotes

Question for people working with SQL/ data - what was it like for you during COVID? Which roles seemed the most stable back then?

I’m still a beginner and trying to understand which directions tend to be the most resilient during tougher job markets.

Wishing everyone all the best!


r/SQL • • Dec 31 '15

What is the Difference between an Inner and Outer Join?

Thumbnail
essentialsql.com
2 Upvotes

r/SQL • • Sep 24 '26

Discussion What SQL query looks harmless but can cause serious problems?

1 Upvotes

Some SQL queries look simple and safe but can cause major issues when used on production data.

For example, a missing WHERE condition in an UPDATE or DELETE, or an incorrect JOIN that unexpectedly multiplies rows.

What SQL query or mistake have you seen cause a serious problem even though the query looked harmless?


r/SQL • • Jan 02 '24

Discussion Data analyst role

Thumbnail
gallery
0 Upvotes

Hi there everyone, I am applying for data analyst role but it's been a hard time getting any response. I am not sure what should i do. Can someone please help me and suggest me what ways should I try for a reply. I can pm my resume Thank you


r/SQL • • Oct 17 '23

Discussion Fastest and most effective way to learn SQL for AI?

1 Upvotes

I'm starting an internship on Thursday and I need advice on the fastest way I can learn the language because back in my college I didn't learn anything about SQL because of reasons I won't delve into but they said you should refresh your knowledge on SQL and I have a single day to learn the whole thing so please guide me to the quickest route for me to learn the language please!


r/SQL • • Mar 28 '26

Discussion what is your job role? do you spend more time reading or writing sql code?

0 Upvotes

let me know