r/SQL

▲ 11 r/SQL

Database Restores, how do you do it?

Hi All,

Background - like most businesses we have Dev, Acceptance and live environments for our developers. We are looking for a controlled way we can refresh the data in the Dev and Acceptance DBs from the current live database.

Historically, the backup solution at the time would dump a .bak file into a folder once the backup was complete. From there multiple scripts were ran to put the data back into either of the other DBs and sanitise it, ready for use by the developers.

Ideally we would like to find a way to automate the process as our new backup product doesn’t provide that functionality so we are currently taking manual backups every time the devs need fresh data.

Does anyone know of any low cost or free products that would do this? How is it done in other organisations?

Thanks in advance.

reddit.com
u/Danny0239 — 12 hours ago
▲ 11 r/SQL+1 crossposts

Is PL/SQL still in demand despite modern technologies if I already know SQL?

Hi everyone,

I already have a good understanding of SQL and I’m currently considering whether I should invest time in learning PL/SQL.

However, I see that many modern technologies like Python, cloud databases, and data engineering tools are becoming more popular.

So my question is:
Is PL/SQL still in demand in the job market today, or is it being replaced by newer technologies?

I would appreciate insights from people working in data or backend development.

Thanks!

reddit.com
u/MelodicUniversity415 — 21 hours ago
▲ 7 r/SQL

Tried dbForge as an SSMS alternative and surprisingly solid

Been on SSMS forever, only tried this because a project basically forced me to switch for a bit. Figured I'd write something up since I went in pretty skeptical. 

The autocomplete is actually good. SSMS IntelliSense loses context constantly (aliases in subqueries, complex CTEs, anything nested enough) dbForge Studio for SQL Server just keeps tracking. Not magic, but noticeably more reliable in the situations where SSMS gives up. Which for me is a lot of the day. 

As SSMS doesn't have it natively, I was always reaching for something external. Having it right there cut a real friction point out of release prep. The diff output is readable too, not just a wall of generated SQL you have to decode before acting on it. 

Tab behavior is a smaller thing but I kept noticing it. After reconnecting, SSMS tabs can act strangely, especially if there are a lot of them open. dbForge keeps state better. It doesn't sound like much, but it adds up over the course of a whole day. 

Startup is slower and the UI is busier than SSMS. For quick administration tasks, I still reach for SSMS, that part just fits better.  

But for actual development work (heavy query writing, comparing environments, prepping a release) it earned its place. Didn't expect to keep using it past the project but here we are. SSMS isn't going anywhere but this sits next to it now. 

Still on SSMS as your main thing, or has something shifted that?

reddit.com
u/Unique_Capter — 21 hours ago
▲ 0 r/SQL

Need help with this Hackerrank solution

This question messed up an OA of mine

Where exactly am I wrong here? I tried to toggle with so many spaces and lpads and rpads and Concats and hackerrank wouldnt budge.

u/App2050 — 16 hours ago
▲ 1 r/SQL

Anything better than phpMyAdmin?

Is there anything better than phpMyAdmin for managing MySQL databases that is free and has a web UI?

reddit.com
u/BlueLinnet — 10 hours ago
🔥 Hot ▲ 59 r/SQL+5 crossposts

Visual Explain started as an idea. Now it’s shipped in Tabularis

SQL EXPLAIN is powerful… but not exactly friendly. 😅

So I released Visual Explain in Tabularis.

👉 https://github.com/debba/tabularis

You can now turn raw query plans into a visual, interactive tree:

• Understand joins at a glance

• Spot bottlenecks faster

• Navigate complex plans visually

• No more walls of text

This feature makes query analysis way more intuitive.

Try it and let me know what you think 👀

u/debba_ — 1 day ago
▲ 1 r/SQL

Any good suggestion for a quick data modeling tool for reverse-engineering

I would be working on a new job and I need to look at the data model of a system. I would expect that there is no documentation coming along my way, so I would need to make one for myself. I used to use Visio (am I old? yes, yes I am) to generate a data model to print and keep around the workarea, but I don't want to use that anymore and am looking at leveraging new tools. Something that is on my local machine and connect to a database server in the network to generate the model (keeping things out of the cloud for the moment)? If possible, something that could also be used for non SQL Servers (but I would probably first use this for SQL Servers).

Any good suggestions?

reddit.com
u/Rohml — 19 hours ago
▲ 0 r/SQL+1 crossposts

Sql Union Syntax

Learn how SQL UNION works and how I use it to combine results from multiple SELECT statements into a single result set

youtu.be
u/Efficient-Public-551 — 16 hours ago
▲ 2 r/SQL+1 crossposts

داتا بيس - QA

ممكن اي حد بدأ يتعلم داتا بيس يرشحلي افضل القنوات لو حد حابب يبداً معي بدراسة يعلق هون

reddit.com
u/DefinitionKey1407 — 1 day ago
▲ 10 r/SQL+1 crossposts

Looking for advice as a beginner, looking to advance carer

Hi and thank you in advance.

I currently work in a bank and am quite into computers. Given the rise in ai, banking is very much incorporating it. There is also a huge shift towards data analytics. Due to this, and to further advance my career, I’m wanting to learn sql. I just wanted to ask a few questions. I appreciate anyone taking time to read and answer.

  1. the most obvious, where would you recommend to start? Looking online is a bit overwhelming with the options.

  2. I have a MacBook, running iOS, and a pc, running windows. If there a significant different between the 2? Should I stick to windows based systems or would it not be an issue to use both ?

  3. is there anything else I should consider learning alongside sql, that would be helpful?

Thanks again!

reddit.com
u/Ok-Recommendation90 — 1 day ago
▲ 0 r/SQL

Stop Switching Database Clients — WizQl Connects Them All

WizQl — One Database Client for All Your Databases

If you work with SQL and juggle multiple tools depending on the project, WizQl is worth a look. It's a single desktop client that handles SQL and NoSQL databases in one place — and it's free to download.


Supported databases

PostgreSQL, MySQL, SQLite, DuckDB, MongoDB, LibSQL, SQLCipher, DB2, and more. Connect to any of them — including over SSH and proxy — from the same app, at the same time.


Features

Data viewer

  • Spreadsheet-like inline editing with full undo/redo support
  • Filter and sort using dropdowns, custom conditions, or raw SQL
  • Preview large data, images, and PDFs directly in the viewer
  • Navigate via foreign keys and relations
  • Auto-refresh data at set intervals
  • Export results as CSV, JSON, or SQL — import just as easily

Query editor

  • Autocomplete that is aware of your actual schema, tables, and columns — not just generic keywords
  • Multi-tab editing with persistent state
  • Syntax highlighting and context-aware predictions
  • Save queries as snippets and search your full query history by date

First-class extension support

  • Native extensions for SQLite and DuckDB sourced from community repositories — install directly from within the app

API Relay

  • Expose any connected database as a read-only JSON API with one click
  • Query it with SQL, get results as JSON — no backend code needed
  • Read-only by default for safety

Backup, restore, and transfer

  • Backup and restore using native tooling with full option support
  • Transfer data directly between databases with intelligent schema and type mapping

Entity Relationship Diagrams

  • Visualise your schema with auto-generated ER diagrams
  • Export as image via clipboard, download, or print

Database admin tools

  • Manage users, grant and revoke permissions, and control row-level privileges from a clean UI

Inbuilt terminal

  • Full terminal emulator inside the app — run scripts without leaving WizQl

Security

  • All connections encrypted and stored by default
  • Passwords and keys stored in native OS secure storage
  • Encryption is opt-out, not opt-in

Pricing

Free to use with no time limit. The free tier allows 2–3 tabs open at once. The paid license is a one-time payment of $99 — no subscription, 3 devices per license, lifetime access, and a 30-day refund window if it's not for you.


Platforms

macOS, Windows, Linux.


wizql.com — feedback and issues tracked on GitHub and r/wizql

u/razein97 — 19 hours ago
▲ 3 r/SQL

ERD advice for an online department store

Hi guys! The client requires a database system for the online shopping experience of their department store. In addition to the core day-to-day functions, they are developing strategies to promote the end-of-financial-year sale through social media channels so they want to capture user interactions, track engagement across social media platforms, and support analytical insights into customer behavior and marketing effectiveness. A key performance metric they consider is the click-through conversion rate. I have outlined an ERD (some attributes are missing because I'm still working on it) and would like some advice to make it a better fit for the client (e.g., Are these entities enough?). Thank you for reading and hope you have a great day!

https://preview.redd.it/s6a75hjsx8wg1.jpg?width=1026&format=pjpg&auto=webp&s=be3176739502613c0ed4cd8f9be3db94b53af8c7

reddit.com
u/Objective_Baby1678 — 1 day ago
🔥 Hot ▲ 84 r/SQL

[META] Vibecoded AI Slop Tools

Mods, can we get a rule disallowing posts promoting vibecoded AI slop tools that someone had Claude build in 5 minutes? They have just about become every other post on the sub. They often aren’t even a useful tools, or try to solve a problem that either doesn’t exist or has already been solved.

reddit.com
u/SweatyControles — 3 days ago
🔥 Hot ▲ 101 r/SQL

You work at E-commerce. Your BOSS/CEO who just use Claude, he just created index on order.status and say index is good. It makes things faster. What do you do here as SQL BE guy?

As the title says

u/lune-soft — 5 days ago
▲ 8 r/SQL

Help Converting Date to a Different Date Style while Querying in SSMS.

Hey everybody! I just had what I think would be a quick question. I'm new to using Sequel Server Management Studio at work. I'm currently trying to build a query from existing databases, but I'm having trouble trying to figure out how to convert a date to another date style in T-SQL. I have two dates that I need to convert from the format "yyyymmdd" to "yyyy/mm/dd'. One I already converted by joining data to our date dimension table, but I can't do the same join to convert the other. How can I convert the date to the desired format in the same query?

reddit.com
u/PrinceFlorfian — 4 days ago
▲ 2 r/SQL+1 crossposts

Help with the error

CREATE TABLE Library (

book_id INT PRIMARY KEY,

book_name VARCHAR(50),

author VARCHAR(60),

price INT NOT NULL

);

Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Library ( book_id INT PRIMARY KEY, book_name VARCHAR(50), author VAR' at line 1

What do you think is wrong with the code?

I m using mysql.

reddit.com
u/Embarrassed-Speed327 — 4 days ago
▲ 1 r/SQL

Has anyone else been burned by a silent schema change? Built a mental model for fixing this, want brutal feedback !

A few months ago, a data engineer on our team renamed a column. email → user_email. Clean migration, tested, merged on a Friday.

By Monday, three things had quietly broken:

An ETL pipeline was loading nulls into a feature table

A churn prediction model was training on stale data because the join silently failed

A Spark job was producing wrong aggregates: no error, just wrong numbers

Nobody caught it for 4 days. The rename was one line. The fallout took a week.

The problem nobody talks about

Schema changes are treated as a database problem. But the blast radius extends way beyond the DB, into Python ETL scripts, Spark jobs, pandas DataFrames, sklearn feature pipelines, TypeScript APIs, dbt models. All of these reference column names as plain strings. No compiler catches a renamed column. No linter flags a broken JOIN.

I call these Silent Data Breaks, they don't throw exceptions, they just corrupt your data quietly downstream.

The worst part: the person who renames the column often has no idea these files even exist. The DE doesn't know about the ML engineer's feature pipeline. The ML engineer doesn't know about the TS API. Everyone works in their silo.

What I'm thinking about building

A local tool (no cloud, no data ever leaves your machine) that maps dependencies between your schema and your code. You point it at your repo, it crawls SQL, Python, TypeScript, Jupyter notebooks and builds a graph of what references what.

Before you rename email, you ask it:

"What breaks if I rename users.email?"

And it tells you:

Found 9 files referencing users.email:

etl_pipeline.py:43 — pd.read_sql [high confidence]

ml_features.py:6 — spark.sql [high confidence]

churn_model.ipynb:31 — HuggingFace dataset [high confidence]

users-api.ts:7 — pg.query [high confidence]

analytics.ts:6 — Prisma [high confidence]

... 4 more

With exact line numbers and suggested fixes. Before you deploy, not after.

Questions I'm genuinely unsure about:

Do you actually hit this problem? Is it a daily annoyance or a rare fire drill?

Where does the pain live for you? SQL→Python? Python→ML models? ORM→ raw queries?

Would you trust a static analysis tool for this, or does it feel like it'd have too many false positives?

Is the bottleneck awareness ("I didn't know those files existed") or tooling ("I knew, but checking manually takes too long")?

Would this be more useful as a CLI you run before commits, or something that lives in your IDE?

Not selling anything, not launching anything, genuinely trying to understand if this is a real problem worth solving or something that's already handled by tools I don't know about.

reddit.com
u/Greedy_Resident6076 — 5 days ago
🔥 Hot ▲ 93 r/SQL+2 crossposts

My 14-Year Journey Away from ORMs: a Stream of Insights Leading to Creation of a SQL-First Code Generator

Blog post about how I went from shipping a popular ORM in 2012… to throwing it all away… to realizing that the database itself should be the single source of truth.

nikita-volkov.github.io
u/nikita-volkov — 6 days ago
▲ 0 r/SQL

Cross database join keys are a silent failure mode in multi DB agents

Cross-database join keys are a silent failure mode in multi DB agents

Post:

We hit a recurring issue while building a multi database data agent for PostgreSQL + MongoDB: joins could return zero rows with no error even when the logic looked right.

The issue was format mismatch, not missing data.

Example:

PG subscriber\_id: 1234567

Mongo subscriber\_id: "CUST-1234567"

What helped:

explicit key normalization

mapping rules per entity type

logging failures by category instead of treating every miss as “query failed”

separating routing, join resolution, and execution into different steps

This changed our design: we stopped treating the problem as “better SQL” and started treating it as data contract mismatch across systems.

Question:

For people working with mixed stores, do you solve this in ETL, in the query layer, or in application logic? Where have you found the least painful boundary?

reddit.com
u/Ambitious-Hornet-841 — 5 days ago