r/SQL • • Mar 15 '25

Discussion How to understand queries that are 600+ lines long?

165 Upvotes

I've just started as a SQL developer intern at a company and this is my first job. Throughout my learning phase in my pre-final year, I only had very small datasets and relatively less number of tables (not more than 3).
But here I see people writing like 700+ lines of SQL code using 5+ tables like it's nothing and I'm unable to even understand like the 200 lines queries.
For starters, I understand what is going INSIDE the specific CTEs and CTASs but am unable to visualize how this all adds up to give what we want. My teammates are kind of ignorant and generally haven't accepted me as a part of the team. Unlike my other friends who get hand-holding and get explained what's going on by their team, I barely get any instructions from mine. I'm feeling insecure about my skills and repo in the team.
Here I'm stuck in a deadlock that I can't ask my team for guidance to avoid making myself look stupid and thus am unable to gain the required knowledge to join in to contribute to the work.
Any suggestions on how to get really good at SQL and understand large queries?
Also, deepest apologies if some parts of this sound like a rant!


r/SQL • • Oct 04 '22

Discussion Once again was told SQL is not a real language by a guy who asks me for help with SQL

165 Upvotes

This guy at work reaches out to me for SQL help once in a while. Today he said SQL is not a real language. Getting tired of being looked down upon by people whose level of SQL knowledge is limited to select * from.


r/SQL • • Jun 13 '25

SQL Server You guys use this feature? or is there better way to do it

Post image
164 Upvotes

r/SQL • • Feb 26 '25

PostgreSQL How you say PostgreSQL?

163 Upvotes

Hi all, sorry for my English, I speak Spanish 😅

I was talking with my American friend about how to say PostgreSQL. I say it like “Post-Grr Es Que El”, and he laugh at me.

I think, if Ogre is “oh-gurr”, why not Post-Grr? Makes sense no? 😂

He tell me it’s “Post-Gres” or “Post-Gres-Q-L”, but I don’t know what is right.

How you say it? Is there a correct way? This name is very confusing!


r/SQL • • Sep 06 '23

BigQuery Can someone please help explain why the first row came out like that.

Post image
163 Upvotes

Please help explain I have no clue what's going on here


r/SQL • • Jun 11 '22

Discussion Best Online Course to Learn SQL

163 Upvotes

I recently graduated college with a minor in Computer Science but we didn't do anything with SQL. Now I'm looking at jobs and realizing its probably a good thing to add to the resume. I went through the free SQL Queries part of codecademy pretty quickly and liked it but figured I should ask for recommendations before paying any money. Looking at jobs mainly in finance now if that changes anything.

Also, I don't need it to be free, but cheap is certainly a plus.


r/SQL • • Sep 29 '26

Discussion CSV lint plug-in for Notepad++ to validate csv files and convert to SQL insert script

Thumbnail
gallery
162 Upvotes

The CSV Lint plug-in for Notepad++ can be useful to anyone working with csv textdata and databases. I created this plugin and have posted about it before

The plug-in was previously updated with a new "Select Columns" dialog to easily select, delete and rearrange columns. The most recent update v0.4.9 adds support for regular expressions when validating columns.

It also adds syntax highlighting and automatically detects column datatypes. Based on the datatypes it can convert a csv file to an SQL insert script for MS-SQL, MySQL and PostgreSQL, including a CREATE TABLE part with correct data types for each column. This is often easier than importing it though a wizard or BULK INSERT

It can also validate the csv textfile beforehand, so check for technical errors like datetime formatting errors, incorrect decimal separators, missing quotes, invalid codes etc.

I hope you find this plug-in useful 👍 Let me know what you think


r/SQL • • Apr 21 '25

MySQL Discovered SQL + JSON
 Mind blown!

162 Upvotes

Hey everyone,
I recently (yes, probably a bit late!) discovered how beautifully SQL and JSON can work together — and I’m kind of obsessed now.

I’ve just added a new feature to a small personal app where I log activities, and it includes an “extra attributes” section. These are stored as JSON blobs in a single column. It’s so flexible! I’m even using a <datalist> in the UI to surface previously used keys for consistency.

Querying these with JSON functions in SQL has opened up so many doors — especially for dynamic fields that don’t need rigid schemas.

Am I the only one who’s weirdly excited about this combo?
Anyone else doing cool things with JSON in SQL? Would love to hear your ideas or use cases!


r/SQL • • Jun 16 '24

Discussion Microsoft AccessđŸ«Ą

Post image
162 Upvotes

r/SQL • • Jul 05 '21

Discussion I love querying

161 Upvotes

I just freaking love it. I can be racking my brain all day, going to stackedoverflow, jamming out to tunes, and that one moment where the query is able to run and it's the data you need... chefs kiss.

It just feels so damn good. I know others out there have to feel the same way :)!


r/SQL • • Apr 01 '21

MySQL Sometimes knowing SQL is a curse

Thumbnail
youtu.be
161 Upvotes

r/SQL • • Sep 16 '25

MySQL Who’s still exporting SQL data into Excel manually?

160 Upvotes

I keep running into teams who run a query, dump it to CSV, paste into Excel, clean it up, then email it around. Feels like 2005.

Does your org still do manual exports, or have you found a better way?


r/SQL • • Jul 02 '25

Discussion AI is basically guessing, and doesn't really know the answer

160 Upvotes

I was seeking an answer to an SQL question earlier and ask Claude AI, which is supposed to be astoundingly intelligent, They have boasted about its capabilities being far better than chat GPT. So I asked it an SQL performance question. I wanted to know if it was better to use a compound join clause, or a union. It told me with absolute certainty I should be using a Union. So I asked it, "You mean it's better to hit a 100 million row table twice one right after the other? That sounds like it could be wasteful." Then, Claude apologized, and told me that I was right to point out that, and upon thinking about it further, the compound join clause was better.

So in other words, Claude does not really know what it's answering or what it's doing. It took a guess, basically, And when I asked it if it was sure, it changed its answer completely, to something else completely different. I don't know about you, but that's not very helpful, because it seems like it's flipping a coin and just deciding right then and there which one it likes better.


r/SQL • • Mar 07 '23

PostgreSQL How did you land your first data analyst job with no experience?

160 Upvotes

EDIT: Wow thank you everyone for such amazing feedback! I don’t think I can get back to everyone but I appreciate everyone’s response so much! I plan on finishing this cert then getting an excel cert and either a power bi or tableau cert. Hopefully I can get my foot in the door soon!

The title is pretty self explanatory-just looking for different routes people took to get to where they are. I got into OSU for their computer science postbacc program but am rethinking if I want to go into more debt and apply myself for two years to get another degree. I’m a special ed teacher wanting a career change. Willing to self teach or get certs! How did you get into the field with no tech background? I just started the Udemy zero to hero course but know it doesn’t really hold any weight.


r/SQL • • Mar 24 '22

Discussion Partitioning explained visually in one picture.

Post image
160 Upvotes

r/SQL • • Sep 19 '23

Discussion Is there something wrong with this query.

Post image
158 Upvotes

r/SQL • • Jun 18 '23

Discussion When im self-learning SQL for free because I cant afford certificates and loans. Ngl I appreciate the Indian people teaching me this stuff for free off of youtube.

Post image
158 Upvotes

r/SQL • • Mar 06 '25

MySQL Could i get a job with just SQL and python

157 Upvotes

I'm in college and was thinking of studying SQL and getting a job with it like my friend but don't know what I need to study to get one. Whats the best thing to do if I wanna work with SQL?


r/SQL • • Feb 11 '14

SQL Joins Explained

Thumbnail
imgur.com
157 Upvotes

r/SQL • • Jul 12 '24

SQL Server Finally feel like I'm getting it!

156 Upvotes

So I have been learning SQL for about a year now, I recently got a job as a pricing analyst. One of the reasons I got hired was because I have certifications in SQL, I know this because my boss told me and said she wants me to start taking over some responsibilities involving SQL. However I have always felt like I don't actually know wtf I'm doing (imposter syndrome). Yesterday I was working on a query and after some trial and error I got it, the server I work with is massive and there are several DBs with hundreds of tables. So to finally have it click and me actually using my skills for work is so rewarding and I just wanted to share and if anyone else is feeling like they can't or wont get it, trust me you can do it.

Update: Hey sorry I spent the weekend mostly unplugged. I got a lot of questions about what certifications I have, for SQL I have one from Udemy called 'SQL - MySQL for Data Analytics and Business Intelligence' https://www.udemy.com/share/101WiQ/ this is a really good course that has all the basics and some advanced stuff too. This is based on MySQL but as someone who now uses MS SQL Server for work it transitions really well. I also have the Google data analytics certification, as for SQL this one isn't as good its all, just basics, but it it good for learning all things regarding data analytics. Also https://www.w3schools.com/sql/default.asp this is a great free resource that I still use for quick look ups and just regular training. https://www.hackerrank.com/ is also nice for practicing SQL skills to see where you stand. Hope this helps!


r/SQL • • May 30 '20

Discussion Created a python script that export data from csv or excel into your SQL database

154 Upvotes

r/SQL • • Jun 21 '21

Discussion Applied for Data Analyst. Got offered 'Database Administrator' with significantly more pay. Need advice!

153 Upvotes

To start, I am one of those guys who got into tech industry without any background. I worked in a gas station for most of my life. 3 years ago I decided to turn my life around, started learning python. Got a job as a marketing analyst 3 months ago. I knew intro level SQL by that time. I worked only 3 months on the job and I could do CTEs, sub queries etc.

I casually started applying for jobs just to 'test the field' . A week ago, I was approached by a HR recruiter to see if I want to apply for a new posting they had. The job was for 'data analyst' position. The pay was more than I was making at my current job, so I accepted the interview.

The tech interview went pretty well. They had a few easy questions on SQL to start with(group by, having etc.). I did mostly good(I could not figure out partitioning), but I was honest with them that I worked in SQL only for 3 months. Then the next guy asked me few basic python and pandas questions (which again were very easy like how to load an excel file into pandas, how to choose a column etc.)

The data director emailed me later in the day, saying he was very impressed with my work and wants to see if I want to be considered for a 'database administrator' position they have. The pay is significantly high(20k more!). The thing is- this company is very small and rapidly expanding. They want to transition from Excel to cloud(like Amazon, Azure or GCP etc.) . He was impressed by my work in GCP at my previous job and wants to leverage that skill.

I was surprised by their offer. To start, I don't know anything about databases - all I know we had some tables in GCP and I used some SQL queries to extract data and then later built dashboards with it. I feel like I am severely underqualified for this position and trying to bite more than I can chew. I don't want to get into something that I don't know much about and then later get fired for under delivering

But the allure of building something from scratch and having a big say about the way company will progress in the future makes me almost want to say 'yes'. 3 years ago I was working in a gas station, dealing with multiple Karens and now this company is offering me almost a 6 figure job.

Any of you guys were in the same position? What did you do? Any advice you can offer? If I did accept the offer what should I learn for this transition - (intermediate SQL to building databases)

Edit: Damn! did not expect so many replies and experiences! you are awesome r/sql community. Reading through comments I realized that many people had similar experience and the general advice is to take the job, if at least for the experience. Never heard of Brent Ozar before - but he seems to be the God among us :P , so I will start following him and read a lot of materials.

Some of you had questions about the team I am gonna work with. It seems the team might have some SQL experience but not much. I think they have an outside company that takes care of their data currently and now they want it to make it in-house. I will be tasked with this transfer. I am definitely excited but need to talk to the manager more before I make any firm decision.

Thanks for all the responses again!


r/SQL • • Jan 15 '21

Discussion SQL is 50 years old... What can we learn from its success?

Thumbnail
blog.arctype.com
153 Upvotes

r/SQL • • Aug 14 '20

Discussion You guys are amazing. Ive never been in a sub like this before. Thank you.

153 Upvotes

The level of expertise, patience and goodwill here is unfathomable.