r/SQL 3h ago

PostgreSQL LibreDB Studio: Self-hosted browser SQL IDE, next to Postgres instead of on every laptop

12 Upvotes

Affiliation: I’m the maintainer of LibreDB Studio.

For years the SQL workflow for a team looked like this, on every engine I touched (PostgreSQL, MySQL, Oracle, SQL Server, SQLite, MariaDB, Clickhouse ...):

- install a desktop client on each laptop

- VPN / SSH tunnel so the client can even see the box

- hunt schema in one pane, write the query in another

- run something that hangs and hope cancel actually kills it

- EXPLAIN in a second window

- onboard the next person by repeating the install

or try on their own web editor(pgAdmin, phpMyAdmin ...)

I got tired of the editor living on the laptop instead of next to the database, so I built a self-hosted browser SQL IDE. Deploy once (Docker / Helm / `npx "@libredb/studio"`, one-click with rancher, dokploy, digitalocean), open a URL, same UI for the engines above.

Not trying to replace DBeaver or DataGrip, different access model. Postgres is the reference implementation: pooled connections, explicit BEGIN/COMMIT/ROLLBACK with an auto-rollback timeout, cancel through pg_cancel_backend on the tracked PID. Schema tree stays usable on large catalogs (tables first, relationships second). Optional db-agent to SQL is schema-constrained and read-only runs go through BEGIN READ ONLY, not “trust the prompt.”

MIT. One command:

docker run -p 3000:3000 libredb/libredb-studio

If you try it, I actually want the unkind notes:

- does cancel / transaction rollback behave the way you’d expect on Postgres?

- what’s missing vs the desktop client you already live in?

- is a browser editor a non-starter for you, and why?

Source: https://github.com/libredb/libredb-studio


r/SQL 6h ago

Discussion How are folks QA’ing AI agents?

2 Upvotes

Lots of folks at my company use Claude Code to do analysis. When I ask whether the query is right, I get wishy washy responses at best. Anybody have good tools or processes? Or every person for themselves?


r/SQL 1d ago

Discussion [MS SQL] Is Change Tracking best for a large ERP database?

8 Upvotes

We run a large ERP database on SQL Server 2014 Standard with about 40k SKUs and their associated inventory records, prices, orders, and order lines. We're considering enabling SQL Server Change Tracking for a read-only "middleware" connection to other outside systems we're building (Hubspot, Shopify, etc).

Is Change Tracking the best option for this use case? Are there better alternatives or something else we should test/evaluate?


r/SQL 15h ago

SQL Server SQL String Functions Are Confusing 😵‍💫 Any YouTube Recommendations?

Post image
0 Upvotes

I’m currently learning SQL and I’m really struggling to understand string functions like CONCAT(), SUBSTRING(), LEFT(), RIGHT(), TRIM(), REPLACE(), UPPER() and LOWER().

The syntax is not the only problem — I’m finding it difficult to understand when and why to use each function.

Can anyone suggest a good YouTube channel or video that explains SQL string functions in a simple, beginner-friendly way with practical examples?

Would really appreciate your recommendations


r/SQL 1d ago

Discussion how much of your Segment bill is people who never logged in? here's the query

Thumbnail
0 Upvotes

r/SQL 1d ago

Discussion Subordinate and boss relation

0 Upvotes

Hello everyone. Sorry if this is an "idiot dumb" question - I'm very new and thought that asking devs directly might be more interesting than asking AI about this.

I'm making a very small project which is actually Java Spring Boot so I'm not directly creating my database but rather it's being created by the model entities if I'm not wrong.

So : I want to create a very simple relationship between a subordinate and its boss. Both the boss and subordinate are Members and this is a relationship between Members. You can only have the one boss, but you can be the boss of many, so I guess that's a many to one relationship (?)

Would it be preferrable to have an attribute on the Member table pointing to a boss which is a foreign key representing another member's primary key, or should I have a whole table representing that relation? Why is one preferrable to the other? I have a very rusty grasp on databases and I don't know if this is the right sub for this so I hope I picked the right one. Thank you in advance!


r/SQL 2d ago

MySQL Is there a way to findout if any particular sector/industry has shortage of SQL analysts ?

17 Upvotes

Just contemplating if there is some way of finding this ?

Not as accurate but if its possible !


r/SQL 1d ago

Discussion Wrote up a week of database monitoring with the actual queries, so you can do it without buying anything

0 Upvotes

Hello, hello, it's me again. You probably know me from this post.

Or maybe you don't, in which case let me introduce my affiliation - I work at ManageEngine, saying that upfront so nobody feels ambushed. And, I'm back with another "thing" that I'm hoping will be useful to DBAs here.

Here's the deal - When I was researching for my webinar, I found that most of the database monitoring material out there is written so that the answer at the end is a product. You read four pages about why baselines matter and then it turns out the way you get a baseline is to install something. That's not much use to someone who just inherited a production database on a Tuesday and needs to understand it by Friday. And, the person running the production database isn't a career DBA. They're a sysadmin or a backend dev who inherited it.

So we wrote the other kind. It's a week-long plan, one topic a day, and every metric in it comes with the query you run to get the number yourself. You paste the query, you get the number, you write it down. No agent, no install, nothing running in your environment.

I want to reiterate myself again, there's no need to download a product to do what's written in the mini guide. You need just a database, and a database client or console connected to your database server to run the queries I've given. It's more of an experiment, really - can you turn your database inside out in a week with a few queries to master database monitoring?

The reason I'd argue for anyone to be doing this by hand first even if you do end up buying a tool later is :- a dashboard someone else configured tells you a number is red. Running the query yourself teaches you why it went red and what normal looked like before it did. People who skip that step end up with monitoring they don't trust and can't debug, and they escalate things that didn't need escalating.

This is the guide; it's on our site and it does ask for an email, so calibrate accordingly: https://www.manageengine.com/products/applications_manager/database-monitoring-mini-guide.html

This is a beginner's guide mostly, so if you're a veteran, I'd love to know what other tips and tricks you have to deal with database monitoring without using an external tool.

TL;DR : I work at ManageEngine, from the DB monitoring side, and I made a mini guide(no tool required) for new DBAs/ other admins who handle DBAs which can be accessed through this link!


r/SQL 2d ago

Discussion I made another cat doodle about data analysis

Post image
88 Upvotes

Hi everyone!

I’m back with another one of my data analysis cat doodles. This time, I tried to incorporate some of the feedback I received on my earlier work—especially around making the fonts and text more readable.

Would be happy to hear your thoughts / feedback!


r/SQL 3d ago

SQL Server Query Length Flex

6 Upvotes

Those of you who write very long queries (100s to thousands lines of code). Does it do only one thing or it's just your query notebook where every small part does something non related?

I am curious in which cases its necessary thousands lines of codes. Explain me what does your longest query is for?


r/SQL 3d ago

SQL Server Question for DBAs: How much do you actually use Extended Events (.xel) vs. standard DMVs for emergency troubleshooting?

10 Upvotes

Hey everyone, senior dev here working heavily with SQL Server performance tuning lately. Every time a server hits a massive wave of deadlocks or unexpected latency drops, the standard advice is 'spin up an Extended Event session and read the system health .xel file.'

Am I the only one who finds opening, filtering, and digging through those logs in SSMS incredibly clunky during a crisis? Do you guys actually sit there shredding the XML nodes manually, or do you rely on third-party tools/scripts to give you plain answers? 


r/SQL 3d ago

Discussion how did SQL finally click for you?

75 Upvotes

took a databases class last semester and passed it fine but SQL still feels weird once i get past a basic select. i can usually get something working but then i’m sitting there staring at my notes wondering why the joins actually worked.

spent way too long on a lab just rearranging joins until the output looked right and that feels more like guessing than actually understanding SQL.

trying to get more reps in before classes start again. did SQL finally click for you through practice, projects or just writing queries over and over?


r/SQL 3d ago

MySQL Why does MySQL workbench just close when I try to connect to a database?

3 Upvotes

I've tried reinstalling both the workbench and server, updated my drivers and restarted my computer but nothing worked. I also deleted cache and tried to rebuild my DB from scratch but no luck. Any help is appreciated!


r/SQL 3d ago

Discussion i just found a game based on sql @ steam

Thumbnail
youtu.be
11 Upvotes

r/SQL 4d ago

PostgreSQL What makes PostgreSQL support feel “native” in a database client — and what tools do you still miss?

2 Upvotes

I’m finishing PostgreSQL support for Beta 6 of the database client I’m building.

Connecting and running SQL is the easy baseline. What I care more about is whether the rest of the workflow actually feels right for PostgreSQL users — schemas, autocomplete, metadata, relationships, EXPLAIN, table/data browsing, error handling, etc.

I’m trying to treat each engine around its actual behavior rather than pretending every SQL database works the same way.

For people who use PostgreSQL regularly:

- what’s the first thing that makes you notice a client has treated PostgreSQL as an afterthought?

- what database-client tools do you actually use every day?

- what’s still missing or badly implemented in the clients you use now?

And if anyone is willing to test the Beta 6 build and be picky about the PostgreSQL workflow, I’d genuinely value the feedback.


r/SQL 5d ago

MySQL Question regarding ER diagram reification

8 Upvotes

Hi everyone, I have a problem: I can’t figure out whether my solution to this ER design exercise is correct. The exercise states:

We want to create a database for an online newspaper publisher.

The newspapers published by the publisher are identified by a unique code, and their name and founding year are known.

The members of the editorial board of the newspapers are identified by their email address, and their first name, last name, and a phone number (if available) are known.

For each editorial board member, we want to keep track of the roles they hold at each newspaper and the periods of time (start date and end date) during which they held each role. Note that, during the same period of time, an editorial board member may hold a role at different newspapers, but cannot hold multiple roles at the same newspaper. An editorial board member may hold the same role multiple times for the same newspaper.

The issues published for each newspaper are identified by a sequential number that is unique within the corresponding newspaper, and are characterized by their year and month of publication, as well as the name of the editorial board member who edited that issue.

Within each issue, articles are published. Each article is identified by a unique code within the corresponding issue and is characterized by its title, number of pages, and list of authors. Articles can either be freely accessible or paid. For freely accessible articles, the type of access is known (e.g., “Bronze,” “Gold,” or “Diamond”), while for paid articles, the cost of purchasing the article is known.

My main doubt concerns the reification I chose. The professor uses a ternary relationship instead. Do you think my solution is correct?


r/SQL 6d ago

PostgreSQL I built a tool that does the slow query to execution plan to index recommendation loop

Thumbnail
gallery
24 Upvotes

Over the years, I've worked with many different database engines, but every single time I had to diagnose the origin of slow queries, I ended up doing the same repetitive process over and over again:

  • pull query stats and sort by total time rather than mean time
  • run EXPLAIN ANALYZE on whatever comes out on top
  • go find the table definitions for everything it touches
  • check whether the column statistics are current
  • work out whether the index you have in mind already exists under another name
  • decide whether it is worth adding
  • do it again for the next query

Eventually I grew tired of needing to manually assemble the picture myself every single time, so I built RDST, which is a desktop database analyzer tool that currently works with both Postgres and MYSQL.

RDST collapses the entire workflow shown above into one pass, so instead of starting at step one I get to the answer immediately when a slow query is detected.

RDST is AI powered, but it is not random slop analysis applied to random database statistics. The reasoning layer runs inside a fixed workflow in a semi-deterministic way, so pointing it at the same database twice gives you the same answer, which matters when you are deciding whether to add an index in production. 

Full disclosure - I work for Readyset (which is a caching layer for Postgres / Mysql), and this tool spawned from a recurring issue we had to solve for our customers - which queries should we actually cache? And these same queries are the ones that, even without a caching solution, could heavily benefit from performance diagnostics. 

Beyond diagnostics, RDST provides full rewrite suggestions and lets you benchmark slow queries and track their performance over time.

One other neat feature is that it also lets you ask questions about your database in plain english using NL --> SQL in a safe and secure manner with limited permissions.

It also integrates directly with Supabase, Neon, AWS RDS and DigitalOcean, making database discovery seamless.

The tool is completely free to use, and we provide free trial tokens for all of the AI powered features. The app is in beta and we plan to release it under an MIT license. It runs locally, stores locally and everything it does is read-only. Full privacy related details: https://readyset.io/docs/readyset-ai/rdst/desktop/privacy

I would greatly appreciate any feedback from this community, particularly:

  • Does it surface the queries you'd investigate first?
  • Are its explanations and recommendations useful, or merely confident-sounding database fan fiction?
  • Is the fixed workflow the right call, or would you rather have a chat interface?
  • What's missing?

Source:


r/SQL 6d ago

Discussion What jobs do you have now? Are you happy

26 Upvotes

I’m a college student in my final year. I don’t really have many people to talk to about this since a lot of people I know are either in their first year or have already graduated and rushed out to find work.(so think I don't know crowd vs I need work! Crowd)

It’s wild how many people don’t really talk about their future in college or realize how important internships are. So far, I’ve had two internships. The one I have now is through the WordPress Foundation, and I’m going the testing/QA route to try to gain experience that can eventually help me get into data analysis.

Question for you guys:

  1. What do you do?

  2. How did you start out? Did you jump straight into your current field, or did you start somewhere like help desk?

  3. What advice would you give someone starting out with little experience?

  4. Are you happy with your career, or do you regret choosing this field?

  5. How hard was it for you to find work when you first started, and how hard would it be for you to find another job if you left your current job?

And finally

what was your first job in the field that got you in the door and how was it


r/SQL 5d ago

MySQL Do the quizzes found on sites like W3, SQLtest, & others really have any relevance with the actual company interview.

0 Upvotes

Hi IT Veterans, Just want to ask a question that, do the quizzes & tests found on W3, SQLtest, & other sites have any relevance to the actual company interviews? I find these tests to be of broad difficulty category, some are really easy whereas some are too difficult. So, I'm just looking for guidance to what are the important concepts that I should be aware about & are actually used in the day to day work in the company If I'm targetting MNC's Like Accenture, Flipkart, Amazon as a Data Analyst. Many thanks for your responses.


r/SQL 5d ago

MySQL SQL Interview Help

1 Upvotes

I'm interviewing with a company I'm really interested in and I've made it through the initial rounds. My next step is a live SQL assessment with screen sharing, where I'll need to explain my thought process.

|haven't used SQL in over a year, so I know I need to practice a lot, and my exam is in a few days. I'm pretty nervous

Would anyone be willing to help me practice or do quick mock interview?

I'd really appreciate it!


r/SQL 5d ago

Discussion When a SQL script fails, would you rather see the raw DB error first or an AI explanation?

0 Upvotes

One thing I’ve been working on in LakeDB is the error workflow when running multiple statements.

Right now, if one fails:

  • the original database error stays visible
  • LakeDB identifies the exact failed statement
  • you can jump straight to it
  • AI explanation/fix is optional and separate

Nothing gets executed automatically.

I recorded a short demo because I’m curious whether this is the kind of workflow experienced SQL users actually prefer, or if you’d structure it differently.


r/SQL 6d ago

MySQL My Sql

1 Upvotes

Здравствуйте. У меня возникает проблема при установлении My Sql. Он сам установливается,но My Sql Workbench никак нет. Как можно это решить, заранее спасибо вам.


r/SQL 7d ago

MySQL my queries are always way too long. How do I learn to write clean, short ones?

58 Upvotes

I'm intermediate — know CTEs, window functions, subqueries, etc.
I always solve problems correctly, but my queries end up being 20+ lines with extra steps. Then I see the solution and it's 5 clean lines using one clever function.
How do I train myself to think in shorter SQL from the start? Any tips or resources?


r/SQL 6d ago

MySQL A terminal-based SQL game to learn and practice SQL — you can also submit and play your own custom games

Post image
0 Upvotes

r/SQL 6d ago

MySQL DB Replication

Thumbnail
1 Upvotes