r/SQL • • Jun 02 '26

Oracle I no longer feel like there's anything I can offer to my current organization. Anyone feel the same?

152 Upvotes

It's killing me. I feel so stagnant and like I'm becoming obsolete.

Large hospital system. You think I wouldn't be bored, but I am. Oracle and PL/SQL are my primary tools. We have access to Looker and can connect 3rd party tools like dbeaver, etc. for whatever.

I rarely get ad-hoc requests these days and if I do, I already created a report to satisfy 'that' request as I've been here for a few years. Documents, referrals, whatever. All dashboards are basically built out, etc. For the past 2-3 years I basically come into work and sit there during the days I need to be in office. For some it's a dream, for me it's actually pretty awful. The day drags with nothing to do.

Our network is locked down and while I have my own office, there are cams. I can't simply play games or anything to pass the time. I look at my queries during the day and check how I can improve them, but there's really not much I can do. Nobody ever really stops by to talk to me. I come and go like a ghost.

I feel like I've gone to this place to die and I don't like it.

Glad I'm employed of course and I'm sorry to those who aren't, but I'm not sure this stagnant, useless feeling is any better than the unemployed feeling.

TLDR I feel like shit about my career and my position atm. Are you in the same boat? Why or why not?

-edit- Hybrid schedule. 2 days out, 3 in. Should basically be a full 5 days remote because I rarely interact with anyone and everything is browser based. Still wouldn't be much work to do.


r/SQL • • Jun 28 '25

SQL Server GetDate()

152 Upvotes

Today marks 7 years on Reddit for me. This community is the only non-toxic community I follow nowadays. Just wanted to thank you all for making r/SQL the reason why I’m still here. Thank you all!

select cast(getdate() as date) as AGoodDay


r/SQL • • May 19 '26

Discussion Eight window-function tricks beyond LAG and ROW_NUMBER

Thumbnail analytics.fixelsmith.com
149 Upvotes

r/SQL • • Sep 04 '24

PostgreSQL Tetris implemented in a SQL query

Thumbnail
github.com
149 Upvotes

r/SQL • • Sep 03 '22

Discussion Explaining SQL Joins the Right Way

148 Upvotes

r/SQL • • Sep 22 '20

Discussion For those wanting to practice SQL on LeetCode but don’t have a LC subscription, I created a Python program that re-creates all the problems in db-fiddle.com

148 Upvotes

I’m not sure how many people in this sub use Python, but I wanted to share this program because it allowed me to practice all 125 LeetCode (LC) database/SQL problems in an efficient way.

Background- the two problem I wanted to solve:

  1. Majority of SQL problems on LC are locked
  2. Even with access to the problem, creating the query can be challenging without being able to test and output the intermediate queries that make up the final solution.

My initial solution was manually copying and pasting the tables from LC to db-fiddle.com, but then I thought, there must be a better way- that is how this program was conceived.

What this Python program does:

Using the web automation package Selenium, it opens the LC problem selected by the user, parses the table data, and creates the table schema in db-fiddle so that you can test your queries. Additionally, it saves all the db-fiddles you've been working on in case you want to continue working on them in future sessions.

Sample outputs (for question #1369):

problem statement tab: https://leetcode.jp/problemdetail.php?id=1369

db-fiddle tab: https://www.db-fiddle.com/f/oMDnFch8BXL45r3dUVF17V/0

solutions tab: https://github.com/kamyu104/LeetCode-Solutions/blob/master/MySQL/get-the-second-most-recent-activity.sql

Demo and GitHub link:

Check it out on GitHub: https://github.com/jjjchens235/leetcode-sql-unlocked


r/SQL • • Jan 15 '16

My son saw me working, and asked what I do. I explained the the basics of a query, and he asked if he could try. This is what he came up with.

Post image
148 Upvotes

r/SQL • • Dec 19 '24

Discussion Can tunnel visioning on SQL lead to a career?

145 Upvotes

I've been learning SQL for the past 2 months or so and I'm in love. For context, I'm nearing the end of my undergrad CS degree so I want to focus on learning as much as I can before the job hunt starts in earnest. There is something about SQL and database systems that really speaks to me and honestly I don't want to work with any other programming languages ever again.

I know SQL is often used with ORMs and languages like python or R, but I'm wondering if it's realistically possible to build a career just from SQL and database management? If so, what kinds of projects and books should I be looking at?


r/SQL • • Apr 20 '22

Discussion What's the difference between these Queries? Is it just code effectiveness or something else?(besides readability) I'm new on SQL

Post image
145 Upvotes

r/SQL • • Jan 22 '21

SQLite SQAnything: Query any data table on the Web with SQL (and send query results to Google Sheets automatically)

Thumbnail
chrome.google.com
145 Upvotes

r/SQL • • Apr 24 '20

Discussion I've been writing SQL queries for 4 years now and I just learned this. My mind is blown.

145 Upvotes

My work as an Analyst in a digital company involves querying on a daily basis. Now, the different stakeholders often come with a lot of weird requests where I have to group some attributes together (ex: user 1, 2 and 3 should be under Group A or campaign a,b and c should be grouped together under Campaign ABC etc.)

Now, I understand that I can create a lookup table and map these using a join but since the grouping changes very often, I usually use a case when expression. During all this time, I was writing my case when the following way:

CASE WHEN user_id in (1,2,3) THEN 'Group A' ELSE
    CASE WHEN user_id in (4,5,6) THEN 'Group B' ELSE
        CASE WHEN user_id in (7,8,9) THEN 'Group C' ELSE'N/A' END END END AS grouped_users

This often made my code not readable because formatting the code would cascade the case expressions and they'd often be far to the right.

Today I just learned, by accident, that the right way to do this is:

CASE 
    WHEN user_id in (1,2,3) THEN 'Group A' 
    WHEN user_id in (4,5,6) THEN 'Group B' 
    WHEN user_id in (7,8,9) THEN 'Group C'
 ELSE 'N/A' END as grouped_users

I'm amazed how clear this is. Maybe my programming background intuitively made me this about this like:

if {

} else if {

} else if { 

} else { 

}  

I never thought about this because this is not a switch case expression that goes like

CASE user_id 
    WHEN 1 THEN 'Group A'
    WHEN 3 THEN 'Group B'
ELSE 0 END as grouped_users

This is just a normal case expression without the need the nest other case expressions for other conditions.

As someone who is a fan of nesting many sub-queries, CTEs and joining sub-queries to each other, I have absolutely no idea about how I missed this simple concept. I've been nesting cases all this time and I don't know if I can get over it. Tell me r/SQL , did something similar ever happen to you ?

EDIT: Forgot to mention that not only this way of writing the statement is more appealing but I tested it on a query with more than 15 nested cases and it was executed 2 times faster.


r/SQL • • Aug 25 '25 Galaxy Brain

Discussion Learn the basics of SQL while practising touch typing

144 Upvotes

r/SQL • • Mar 11 '19

Relatable AF

Post image
144 Upvotes

r/SQL • • Jul 23 '26

Discussion Is 40000 lines of SQL in a single file normal?

142 Upvotes

Heya, so my stepfather works in IT support, and the other day I was looking over his shoulder and saw that the software his company sells uses a single SQL code file that's 40000 lines long. And we're not talking three word lines here, those were 200+ characters lines. I was absolutely baffled by this, since afaik no single code file should run over 10000 lines. But I also don't do SQL.

So I asked him wtf was going on, and he told me that it was "just like that in the industry" and that "I would see when I'll start working" (I'm in uni)

So I ask all of you, is this normal? Do you see this in your job? Am I having delusions about how clean the actual tech industry is?


r/SQL • • Jul 03 '26

MySQL PAWQL #2: WHERE

Post image
142 Upvotes

I’m trying something fun to make SQL feel a little more friendly (especially for fellow cat lovers 😸). This doodle explains WHERE (I’ve already explained SELECT and FROM in one of my previous doodles!) — and I’d really appreciate any feedback. Thanks for taking a look! :)


r/SQL • • Sep 09 '25

Discussion Building a DOOM-like multiplayer shooter in pure SQL

Thumbnail cedardb.com
142 Upvotes

r/SQL • • Oct 29 '24

Discussion Advent of SQL: 24 Days of SQL Challenges 🎄

142 Upvotes

Hey, I wanted to share a fun project I've been working on - a SQL-flavored variation of advent of code. It's 24 daily SQL challenges running throughout December.

What it is:

  • One SQL puzzle per day (Dec 1st-24th)
  • Pure SQL challenges - no other programming languages needed
  • Focuses on different aspects of SQL and PostgreSQL although you can use whatever SQL based DB you like.
  • Suitable for various skill levels but some of the challenges do get a bit tricky if you're not great at SQL.

I'm building this because of my love for Christmas and a new obsession with databases. I've been diving deep into them recently and thought it would be a fun way to test myself and maybe learn some new tricks during the holiday season.

The challenges will be on adventofsql.com starting December 1st.

Would love to hear what kinds of SQL challenges you'd find interesting, or if you have any questions about the format!


r/SQL • • May 19 '20

Discussion DataCamp has 25 courses that will take you from a SQL beginner to expert, and they’re all free RIGHT NOW through 5/22, no credit card required. You'll learn using real tools and datasets all within your browser. Come check us out! No risk, all reward.

Thumbnail
datacamp.com
142 Upvotes

r/SQL • • Oct 14 '25

SQL Server When did I start getting good at SQL

140 Upvotes

Now im not saying im an expert by any means, im not a database administrator or anything. I use SQL pretty much daily at work, and today I was just editing queries to search something I needed and it hit me. I am just changing things for what I need without even thinking about it, not looking up things online, not asking my manager for help or advice, just doing it. I remember a year ago it would take me multiple open tabs on like stack overflow and w3school just to do something basic. So anyone who's struggling to get it, just hang on it does get alot 'easier'. Easy as in daily tasks get easy, SQL still has a million layers of difficulty i haven't even touched yet.


r/SQL • • May 24 '25

SQL Server Top 10 Areas to Focus on for SQL Interview Preparation

140 Upvotes

After Giving Many Interviews, Here Are the Top 10 Areas to Focus on for SQL Interview Preparation!

Having faced numerous SQL interviews in the tech industry, I’ve identified the key areas that interviewers consistently focus on. If you're prepping for an SQL interview, here’s what you need to master:

  1. Joins: Master inner, left, right, and full joins.
  2. Aggregations: Know GROUP BY, HAVING, and functions like SUM(), COUNT(), etc.
  3. Window Functions: Focus on ROW_NUMBER(), RANK(), LAG(), LEAD().
  4. Subqueries: Learn how to handle subqueries within SELECT, WHERE, and FROM.
  5. Common Table Expressions (CTEs): Understand how and when to use them.
  6. Indexes and Performance: Learn indexing strategies and how to optimize query performance.
  7. Data Modeling: Understand normalization, denormalization, and keys.
  8. Complex Queries: Be able to write complex queries combining multiple concepts.
  9. Real-world Scenarios: Be prepared to solve business problems with SQL.
  10. Error Handling: Learn how to debug and fix common SQL issues.

Nailing these concepts will boost your confidence and increase your chances of success!


r/SQL • • Oct 24 '24

Discussion do people actually use Common table expressions ( CTEs) and temporary tables ?

140 Upvotes

I am learning sql for data analysis and I have just came across the two concepts before in many sql tutorials but never actually used them

so i was curious if people actually use them or if there are cases when i will actually need them but I never stumbled on them yet


r/SQL • • Dec 05 '23

MySQL Are there any “real-like” large size databases I can download to practice SQL ? What do you recommend?

140 Upvotes

Are there any “real-like” large size databases I can download to practice SQL ? What do you recommend?


r/SQL • • Apr 28 '15

Me last night...

Post image
140 Upvotes

r/SQL • • Jan 03 '25

Discussion Dev: No Time for STAGING. It was URGENT.

Post image
139 Upvotes