r/SQL • • Dec 10 '24 Polished Silver Turd Take My Silver

Discussion Left Join vs Right Join

Post image
3.9k Upvotes

The discrimination right join has to face.


r/SQL • • Dec 12 '24 Heart of Silver Polished Silver Turd

PostgreSQL Made a SQL Interview Cheat Sheet - what key SQL commands am I missing?

Post image
3.6k Upvotes

r/SQL • • Feb 23 '25

Discussion Relax

Post image
3.4k Upvotes

r/SQL • • Feb 13 '25

SQLite SQL Noir - Learn SQL by solving crimes

Post image
2.4k Upvotes

r/SQL • • Feb 11 '25

Discussion Someone tell him what a PK is...

Post image
2.3k Upvotes

r/SQL • • May 16 '25

Discussion The best way to explain SQL joins ever

Post image
2.0k Upvotes

r/SQL • • Dec 12 '24 Popcorn Heart of Silver

MySQL 😭

Post image
2.0k Upvotes

I mean why that question 😭😭😭


r/SQL • • Feb 17 '25

Resolved When you learned GROUP BY and chilled

Post image
1.7k Upvotes

r/SQL • • Feb 12 '25

Resolved Elon meets relational algebra

Post image
1.5k Upvotes

r/SQL • • Jul 25 '25

MySQL Forgot 'where'

Post image
1.4k Upvotes

r/SQL • • Jul 22 '26

MySQL sqlWorkout

Post image
1.4k Upvotes

😌 SELECT 😌


r/SQL • • Jul 03 '25

PostgreSQL I wrote one SQL query. It ran for 4 hours. I added a single index. It ran in 0.002 seconds.

1.4k Upvotes

I don't know who needs to hear this, but:

It's not your logic.
It's not your code.
It's the missing index.

After 4 hours of watching my query chew through 20 million rows, I went back to my note from school and I totally forgot about EXPLAIN ANALYZE. Which is used to diagnose and optimize slow queries.

The query was slow because, it's doing a sequential scan on a table the size of the Pacific Ocean.

I add an index on the join column. Rerun.

Boom. 0.002 seconds.

So, if your query is slow, use EXPLAIN ANALYZE to understand how your query is executed and how long each step takes.

EXAMPLE:

EXPLAIN ANALYZE

SELECT * FROM tableName WHERE condition;

Anyway, I now accept offerings in the form of pizza, energy drinks, and additional query optimization problems. AMA.


r/SQL • • Dec 25 '21

MS SQL Happy Holidays!

Post image
1.4k Upvotes

r/SQL • • Apr 03 '24

Discussion Please use these instead of those abominable Venn diagrams

Post image
1.3k Upvotes

r/SQL • • May 17 '25

Discussion It's been fascinating watching my students use AI, and not in a good way.

1.3k Upvotes

I am teaching an "Intro to Data Analysis" course that focuses heavy on SQL and database structure. Most of my students do a wonderful job, but (like most semesters), I have a handful of students who obviously use AI. I just wanted to share some of my funniest highlights.

  • Student forgets to delete the obvious AI ending prompt that says "Would you like to know more about inserting data into a table?"

  • I was given an INNER LEFT INNER JOIN

  • Student has the most atrocious grammar when using our discussion board. Then when a paper is submitted they suddenly have perfect grammar, sentence structure, and profound thoughts.

  • I have papers turned in with random words bolded that AI often will do.

  • One question was asked to return the max(profit) within a table. I was given an AI prompt that gave me two random strings, none of which were on the table.

  • Student said he used Chat GPT to help him complete the assignment. I asked him "You know that during an interview process you can't always use chat gpt right?" He said "You can use an AI bot now to do an interview for you."

I used to worry about job security, but now... less so.

EDIT: To the AI defenders joining the thread - welcome! It's obvious that you have no idea how a LLM works, or how it's used in the workforce. I think AI is a great learning tool. I allow my students to use it, but not to do the paper for them (and give me the incorrect answers as a result).

My students aren't using it to learn, and no, it's not the same as a calculator (what a dumb argument).


r/SQL • • Feb 18 '25

Discussion Our sub got credited for highlighting DOGE jumping to conclusions regarding Social Security

Thumbnail
youtu.be
1.2k Upvotes

r/SQL • • Oct 31 '25

Discussion Any day now ...

Post image
1.2k Upvotes

r/SQL • • Jun 18 '24 Helpful

Discussion I love her like I love SQL - please give me SQL/Data Analytics puns for the wedding speech!

Post image
1.2k Upvotes

r/SQL • • Jun 20 '21

Snowflake Busted Developer

Post image
1.2k Upvotes

r/SQL • • Feb 21 '25

Discussion Being really good at SQL doesn't get you very far anymore

1.1k Upvotes

I'm currently a lead analyst of business intelligence and analytics. Basically, a BI engineer. Half data analytics, half data engineering. And unfortunately I was laid off yesterday in a major hub, Charlotte North Carolina. I have been job searching for several weeks because I know that this restructure has been coming and there's just nothing... Literally nothing for me anywhere. And when I do see a business intelligence job posted, it already has a lot of other people that have applied for it and thrown their hat into the ring....

We are on the verge of seeing BI, analytics, data engineering roles either be offshored into other countries for cheaper labor, or outright eliminated by artificial intelligence augmented with a data analytics person behind the scenes...

I will be honest with you. I have no idea what to do anymore. I feel like I am being forced out of the market entirely, and despite being repeatedly told for the last 5 years of my career how capable I am and successful I am at developing BI solutions and analytics, now it's like it doesn't matter. How good I am or how capable I am, what I've achieved. No employer really cares because they have several thousand other people who are in the exact same boat.... Which leaves me without any career prospects and I have simply no idea or understanding what I can even do next. Do I go for a trade? HVAC, plumbing? Am I even capable of that? Do I go for nursing? That would cost me at least 50k in student loans to go back to school for. Housing is also absurdly expensive, so I don't even think I would be able to go back to school for anything without working, it just doesn't seem possible....

Curious to know your thoughts and if you have any insight.


r/SQL • • Apr 18 '25

Oracle Whoops

Post image
1.0k Upvotes

We had a


r/SQL • • Mar 07 '25 I’ll Drink to That

Discussion Passed a Job Interview! Here is what I did...

980 Upvotes

UPDATE - I GOT THE JOB!!!!!!!!!!!!!!!

I've been learning SQL for a while, and I finally decided to start applying for jobs!

I wanted to share a few pointers for anyone out there on the same journey.

Once you can confidently apply complex joins and subqueries, you're basically ready. However, learning CTEs, Window Functions, and Regex will give you an extra edge!

Take Notes! I can't stress this enough.

During my interview, I was asked a time-related question that required converting a string to a datetime format and filtering it. Since I’ve been diligently taking notes from my courses and books, I immediately remembered the function I needed.

Make sure to take notes and know where to find them when needed—it makes a huge difference! The interviewer even asked how I managed to write the query so fast because, even for him, it would take a while. (He was awesome, by the way!) I told him I keep a collection of notes with references to useful queries and subqueries, which helps me solve problems quickly.

Next interview is coming up to seal the deal! Just wanted to share my excitement and hopefully motivate you all to keep pushing forward. Wishing you all the best in landing your dream jobs!

edit: Thank you for the comments and feedback! I didn't expect to get this much encouragement, and has been a bit of a lonely road, no longer being the case.


r/SQL • • Oct 18 '22

Discussion What's your idea of a perfect date?

Post image
950 Upvotes

r/SQL • • Dec 09 '22

MySQL SQL Cheat Sheet

Post image
938 Upvotes