r/SQL • u/watchinu75 • 5h ago
r/SQL • u/Bright-Opposite-1808 • 7h ago
SQL Server Looking for unique, real-world database project ideas (MS SQL Server + C#)
Hey everyone,
I’m a currently working on my university Database Systems course project, and we are looking for inspiration before we starting.
Needs to solve a real-world, tangible problem (we want to build something genuinely useful and engaging, not just a throwaway academic demo).
We want to completely avoid overdone clichés like hospital, library, pharmacy, or flight booking systems.
If you work in an industry with messy workflows, or if you've ever thought "someone really needs to build a proper database system for X", I’d love to hear your ideas!
Thanks in advance!
r/SQL • u/Bright-Opposite-1808 • 7h ago
SQL Server Looking for unique, real-world database project ideas (MS SQL Server + C#)
Hey everyone,
I’m a currently working on my university Database Systems course project, and we are looking for inspiration before we starting.
Needs to solve a real-world, tangible problem (we want to build something genuinely useful and engaging, not just a throwaway academic demo).
We want to completely avoid overdone clichés like hospital, library, pharmacy, or flight booking systems.
If you work in an industry with messy workflows, or if you've ever thought "someone really needs to build a proper database system for X", I’d love to hear your ideas!
Thanks in advance!
r/SQL • u/EmirVivident • 22h ago
Discussion I built a free native Windows SQL client because DBeaver felt too heavy
I write SQL all day and got tired of waiting on Java and Electron apps, so I wrote RimestDB with WinUI 3 and .NET. On my machine it opens in about 2 seconds and uses 66 MB with a connection open. DBeaver on the same machine and database: 11 seconds and 338 MB (warm start, memory as shown in Task Manager).
It works with PostgreSQL, SQL Server, MySQL/MariaDB and SQLite.
Things I built for my own prod habits: manual commit mode per connection, a confirmation before UPDATE/DELETE without WHERE, and in manual mode read-only SELECTs don’t open a transaction, so browsing data doesn’t leave a lock that holds up a migration.
It’s free, with no account and no time limit. There’s also an optional paid Pro tier. Windows 10/11 only.
I’d like blunt feedback from people who live in a DB client: what would stop you from switching?
r/SQL • u/NightlySpiraling • 1d ago
Resolved Im trying to set the PK to default bc I forgot but idk how and this isn't working
The names are exactly the same I saw online that this combination of alters would work, it works with other variable types but it doesn't work with default
Discussion Database indexes explained from first principles - a 3 part series
I have been spending some time understanding database indexes beyond just knowing when to add one or what a B tree is.
I wanted to understand what actually happens inside a database when a query executes, how the query optimizer makes decisions, and how indexes affect those decisions.
I ended up writing a 3-part series, trying to explain these concepts from first principles using simple examples.
Here's what the series covers:
Part 1, Understanding how indexes work
How databases physically store data using pages
How B+ trees help locate records
Clustered vs. non-clustered indexes
Key lookups and covering indexes
Why an index seek isn't always faster than a table scan
Part 2, Query plans and statistics
How databases choose between index seeks and table scans
How data distribution affects query execution
How statistics influence the query optimiser
Why cached execution plans can sometimes be inefficient
Part 3, Understanding joins
How databases join two tables internally
Nested loop joins
Hash joins
Merge joins
How indexes and data ordering influence the choice of join algorithm
I am a software engineer, and writing this series also helped me organise and deepen my own understanding of database internals.
Would love to hear your feedback, especially if you spot something I have misunderstood. Always happy to learn from people with more database experience.
r/SQL • u/Ahmed_Abo_Al_Naga • 1d ago
Oracle في شغل بال Database فقط
انا متخرج ومعايا اساسيات البرمجه بس حولت اشتغل اي حاجه غلي الكمبيوتر في أي مكان لحد ما اخد كريات ويكون في عائد مدي اشتري منه الكرسات ودلوقتي سبت الشغل بقالي شهر عشان اعرف اذاكر فهل في مصر في شغل بالداتا بيز وال SQL فقط ولا اعمل ايه عايز اعرف
r/SQL • u/Top_Tooth_6995 • 1d ago
PostgreSQL I found 39 SQL games and put them all in one place (most are free)
I think SQL games are an effective way to get your SQL reps in while avoiding "brain fry", but I keep seeing the same 5-6 games mentioned in threads and on websites. So I set out to find as many as I could and put them in one place. I found 39 of em.
https://sqlmaxx.com/sql-games/
Also, I made two of these (SQL Block Game and Station Zero). They are in the top row, which is pure coincidence. 🙂
If you made a SQL game, or you know one that is not on the list, drop a comment and I will add it!
r/SQL • u/clairegiordano • 1d ago
PostgreSQL CFP is open for POSETTE: An Event for Postgres 2027 (until Sun 3 Jan 2027)
r/SQL • u/Various-Strawberry55 • 2d ago
SQL Server SQL Server Agent job fails with Error 233 when loading data through a Linked Server, but the same query works in SSMS
reddit.comr/SQL • u/grahamdietz • 2d ago
Snowflake Which Snowflake view do you query first for Cortex AI spend?

My answer is CORTEX_AI_FUNCTIONS_USAGE_HISTORY. It lists every AI function call with its model, user, role, credits and tokens. METERING_HISTORY gives the account-wide total.
Two traps cost me time:
- CORTEX_AISQL_USAGE_HISTORY does not cover every AI function, so a dashboard built on it under-counts.
- CORTEX_SEARCH_DAILY_USAGE_HISTORY includes embeddings that also appear in the AI functions view, so summing the two double-counts them (that is the meme).
The guide lists the usage-history view for each Cortex service: https://altimate.ai/blog/snowflake-cortex-pricing-spend-caps
r/SQL • u/Professional_Top332 • 2d ago
Discussion The future of programming
I want to ask about your opinion.. what do you think the future of programming will be? Especially in the AI era !!
r/SQL • u/Inevitable_Paper_776 • 2d ago
Discussion Ruddy is now running DuckDB 2.0!
Hey everyone,
I’m an independent developer who started building Ruddy in my free time: a fast, modern macOS IDE for data management, analysis, and data science powered 100% by DuckDB.
With this new release, the core engine has officially been upgraded to DuckDB 2.0!
Ruddy runs on a true Pay-What-You-Want (PWYW) model—support independent development with whatever you feel it’s worth, or start exploring for free.
Check it out: ruddy.pro
I’d love your thoughts, benchmark requests, or features you'd like to see next!
What’s inside Ruddy:
DuckDB 2.0 Core Engine: Blazing-fast columnar processing over local files, Parquet, Arrow, CSV, and Iceberg/Delta Lake tables without spinning up heavy infra.
Multi-Cloud Direct Querying: Federate and query across AWS S3, Cloudflare R2, Google Cloud Storage, Azure Blob, and MotherDuck seamlessly in a single SQL statement.
Reactive Notebooks & Marimo: Build reproducible, reactive Python data science notebooks that sync directly with your in-memory DuckDB tables.
First-Class Geospatial Analytics: Full DuckDB spatial extension support—render GeoParquet, Shapefiles, and spatial geometries interactively on high-performance maps.
Auto-Ontology & Modular Semantic Layer: Automatically infers FACT/DIMENSION roles, deduces canonical SQL metrics, verifies joins via physical data overlap, and generates Open Semantic Interchange (OSI v1.0 / Apache Ossie) YAML specifications per dataset domain.
Context-Aware AI Assistant (Ruddynie): Text-to-SQL agent grounded in your workspace ontology and self-improving query memory—zero phantom table or join hallucinations.
Model Context Protocol (MCP) Integration: Expose your DuckDB catalogs, query tools, and semantic context to any external MCP-compatible AI agent or client.
Built-in Git Version Control: Track schema migrations, SQL queries, notebooks, and semantic models with standard Git repositories right from the workbench.
Force-Directed Semantic Graphs & Visual SQL Builder: Explore domain schemas visually or drill down with interactive force-directed relationship maps.
r/SQL • u/adolf_rizzzlerr • 2d ago
Discussion Vibe coded projects
Pls suggest some projects that i can vibe code to show on my CV. Im 19 and i know basic mysql
r/SQL • u/shdw_0x0 • 3d ago
Discussion Do Salesforce developers need admin support just to discover accessible fields?
I recently learned that in Salesforce, having access to an object doesn't necessarily mean you can read all its fields. Field-level security comes into play as well.
This made me wonder about one thing: when developers or integration teams want to query Salesforce data, do they need the admin to provide the available field names and grant access to those fields?
Coming from a traditional database background, I'm used to being able to inspect table columns through metadata queries, provided I have the necessary permissions.
Is there an easier way to discover accessible fields in Salesforce, or is this something that usually needs coordination with the admin team?
r/SQL • u/shdw_0x0 • 3d ago
Discussion I didn't realize Salesforce had permissions at the individual column level
I recently came across Salesforce field-level security, where a user can have access to an object but still not be allowed to read certain fields within it.
Coming from a traditional database background, I found this interesting. I'm more used to thinking about permissions at the database, schema, or table level.
Does this create challenges when building integrations or extracting data through APIs? Especially when the same query works for one user but fails or returns fewer fields for another?
Curious how people usually manage field-level permissions in real-world Salesforce projects.
PostgreSQL prepared statements prevents SQLi. But it also helped me to exploit a 22 years old PostgreSQL 0-day Code Execution Vulnerability (CVE-2026-6460)
r/SQL • u/MrRoy_SQL • 3d ago
Discussion My churn query showed 0 churn every month. It was a missing-row problem
was doing a simple MRR breakdown (new / expansion / churn per month) and churn came out as 0 every single month. looked great for about a minute
small version of the data:
```
customer | month | mrr
A | 2025-01 | 100
A | 2025-02 | 100
A | 2025-03 | 100
B | 2025-01 | 50
B | 2025-02 | 80
B | 2025-03 | 80
C | 2025-01 | 70 <- cancels after january
D | 2025-03 | 40 <- new in march
```
total MRR is 220, 180, 220. so feb dropped by 40: B expanded +30 and C churned -70
**first attempt, LAG straight on the table**
```
SELECT month,
SUM(CASE WHEN prev IS NULL THEN mrr ELSE 0 END) AS new,
SUM(CASE WHEN mrr > prev THEN mrr - prev ELSE 0 END) AS expansion,
SUM(CASE WHEN mrr < prev THEN mrr - prev ELSE 0 END) AS churned
FROM (
SELECT month, mrr,
LAG(mrr) OVER (PARTITION BY customer ORDER BY month) AS prev
FROM invoices
) t
GROUP BY month
ORDER BY month;
```
feb comes out as new 0, expansion 30, churned 0. the -70 just isnt there
reason: C has no row in february. LAG can only compare rows that exist, so a customer who left never shows up in the month they left
**fix: build every customer x every month first**
```
WITH grid AS (
SELECT c.customer, m.month, COALESCE(i.mrr, 0) AS mrr
FROM (SELECT DISTINCT customer FROM invoices) c
CROSS JOIN (SELECT DISTINCT month FROM invoices) m
LEFT JOIN invoices i
ON i.customer = c.customer AND i.month = m.month
),
moves AS (
SELECT month, mrr,
LAG(mrr) OVER (PARTITION BY customer ORDER BY month) AS prev
FROM grid
)
SELECT month,
SUM(CASE WHEN prev = 0 AND mrr > 0 THEN mrr ELSE 0 END) AS new,
SUM(CASE WHEN prev > 0 AND mrr > prev THEN mrr - prev ELSE 0 END) AS expansion,
SUM(CASE WHEN prev > 0 AND mrr = 0 THEN -prev ELSE 0 END) AS churned,
SUM(mrr - prev) AS net_change
FROM moves
WHERE prev IS NOT NULL
GROUP BY month
ORDER BY month;
```
```
month | new | expansion | churned | net_change
2025-02 | 0 | 30 | -70 | -40
2025-03 | 40 | 0 | 0 | 40
```
now C becomes a 0 in feb and LAG sees 70 -> 0. and net_change matches the real total change (-40, +40), which is the check i do now every time: the parts have to add up to the total, if they dont something is missing
two things i'm still not sure about:
- in a real table, months with zero invoices for everyone would be missing from SELECT DISTINCT month. do you generate the months instead (generate_series / calendar table)?
- a customer who leaves and comes back later counts as "new" here. do you treat that as reactivation separately?
r/SQL • u/Low_Guard5883 • 3d ago
Discussion How do you keep yourself from running the wrong UPDATE on production? Here's what I built into my client
Everyone has a story about an UPDATE without a WHERE, or the right query in the wrong tab. I built NiceDB, an open-source database client, around that problem:
a production connection is marked everywhere it appears (tree, tab, title bar, status line) and opens read-only;
writing unlocks for ten minutes with the time left in view, then locks again by itself;
before a change is applied, it shows what it touches and asks you to type the connection’s name;
UPDATE and DELETE without WHERE, DROP and TRUNCATE ask before they run;
every statement that changed something is logged with who, when, where and how many rows.
Each step can be configured. All writes go through one place in the core, so no screen can skip it.
It works with PostgreSQL, MySQL, SQL Server, Oracle, SQLite and others. Free, GPL-3.0: https://github.com/maxib0n/NiceDB, with a browser demo at https://nicedb.app.
What do you do today: separate users, read-only replicas, a habit? I’m curious what I’m missing.
One honest note: the drivers are mature and the common paths are tested against real servers, but I’m one person and can’t cover every version and setup. If you try it on anything that matters, be careful, and please report what breaks with steps to reproduce.
Discussion Working on a live view of table changes. Looking for opinions
I'm building a live watch view in my database workbench and would love your opinion on this. I want to be able to do something in my app and see what happened to the tables without going through them one by one and refreshing.
Something like placing an order. An order gets created, items get added, the cart gets cleared, maybe a background job starts. I want to see those changes together.
This is what I'm trying so far:
Each table gets a line on a timeline. Inserts, updates and deletes have different markers. (if a new table updated showcase it in the chart). I am also thinking of just allowing users to select the tables to watch.
Hovering over a change shows the row and the values that changed.
You can pin a watch for something specific, like jobs changing to failed, and keep it checking while this workbench is opened.
I'm a visual person, so seeing the changes lined up across tables makes sense to me. But I'm still figuring out how useful this would be beyond a small local database. A busy table could fill that line pretty quickly.
Would you use something like this while developing or debugging? I'm particularly curious what you'd want to see when an update happens. Is the before and after enough, or would you immediately want to know which query caused it?
Still building this, so any criticism of the idea or how I'm showing it would help. 😊
r/SQL • u/Happieeman • 3d ago
Discussion SQL HACKS
Hello guys,
I work as a SQL Developer. What productivity hacks or practices do you follow in your day-to-day office work?
For example:
I create a new SQL script every morning, naming it with the current date (SYSDATE), to keep track of my daily work.
I maintain an Excel sheet listing the database objects I've created, along with remarks about each object.
What other useful productivity hacks or practices do you follow?
I'd love to learn from your experience!
r/SQL • u/shdw_0x0 • 3d ago
Discussion What's the actual difference between SQL and SOQL?
I recently came across SOQL while exploring Salesforce and got curious about how different it is from regular SQL.
Both seem to be used for querying data, but SOQL appears to have some limitations compared to SQL.
Can someone explain the main differences between them? For example, how do joins, aggregations, subqueries, and filtering work differently in SOQL?
Also, in what situations would you prefer SOQL over SQL?
Would appreciate some practical examples if anyone has worked with both.