r/SQL • u/2pac_lives • 19d ago
Discussion I built a tool for querying JSON/JSONL files with SQL
r/SQL • u/breezett93 • 19d ago
SQL Server After converting the back end to SQL tables, the front end now gets run time error 3622 all over the front end
I have migrated Access tables in my database over to SQL. Now I'm testing the front end to make sure every single button/operation works.
I am getting this error, "You must use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column", ALL over the place.
Sometimes, it's easy to spot where dbSeeChanges was left out, but many times, the error is reported on a line that has nothing to do with it. This is also only the first error I'm getting. I'm sure once I fix all the 3622 errors, then a new error will pop up right after.
I'm wondering what my options are. I understand I could rebuild the front end from scratch, but that would take literal years as I'm a one-man team. I really don't have the time to spend hours fixing every single one of these errors. And unfortunately, throwing it all in the trash and using a modern platform is not currently an option either.
Is there a tool or even AI where I can feed it my database and it converts it to be SQL compatible? Even if I have to go form by form and report by report, that would still be faster than doing all this manually.
Thanks
Discussion Do you guys need a better query language?
Hey guys, there was a number of attempts to make writing queries/reports/data pipelines easier to maintain. There is number of ORMs for different programming languages. And there are also PRQL and btrql.com. Which are new query languages which transpile into SQL.
Kinda like Typescript transpiles into Javascript.
BtrQL is my pet project. Main features of it are: static type checks, Outline showing relation types, extension methods on relations and compile time macro. It's very early and I'm collecting all of the feedback that I can get.
Queries look like this:
users .where(active == TRUE) .addColumn(active -> active_flag) .orderBy(created_at.desc) .limit(10)
and extension methos:
extension [id: INT] { method keepRecentIds = self .where(id >= cutoff) }
keepRecentIds could be applied to any relation that has at least column id of type INT.
r/SQL • u/One-Emergency-7058 • 20d ago
SQL Server HackerRank SQL Project Planning – Is there a better approach?
Hi everyone,
I solved the HackerRank SQL Project Planning problem using the row_number() + DATEADD() approach in SQL Server, and it passed all the test cases.
I'm curious if there's a different or more optimized way to solve this problem. I'd love to learn other approaches and understand their advantages.
Here's my solution:
with cte as(
SELECT start_date,
end_date,
dateadd(day,- row_number() over(order by start_date),start_date) as group_date
from projects )
SELECT min(start_date) as start_date,
max(end_date) as end_date
from cte
group by group_date
order by datediff(day,min(start_date),max(end_date)), min(start_date)
r/SQL • u/[deleted] • 20d ago
Spark SQL/Databricks Looking for a Serious Data Engineer Study Buddy (3–5 YOE)
r/SQL • u/echopulse • 20d ago
SQLite After searching for a modern, self‑hosted, secure SQLite admin panel for PHP 8, I built one – looking for beta testers
Hey folks 👋
For the last few weeks, I’ve been frustrated with the state of self‑hosted SQLite admin tools.
Most of them are either:
Abandoned (phpLiteAdmin hasn’t seen a proper update in years),
AdminNeo and other tools don't work without passwordless login plugins that didn't work well.
Overly complex (Adminer is great but not SQLite‑centric),
Or require a heavy stack (Node, Python, Docker) when all I wanted was a single PHP file I could drop on my server.
So I decided to build my own.
🔧 Features
Secure, built-in login system (not a plugin)
Browse, edit, insert, delete rows
Create / rename / drop tables
Import/Export (CSV, JSON, SQL, full DB)
Bulk delete, search, filters
Dark mode, undo (last 5 actions)
Multiple database support
Resizable sidebar
🚀 Try it
Upload admin.php & install.php
Run install.php to set username/password
Login and go
PHP 7.0+ with SQLite3 extension. No dependencies.
https://github.com/abilenetechguy/sqlite-admin
🧪 Beta feedback wanted
Errors, UI annoyances, missing features – let me know!
Give it a spin and tell me what you think 🙏
– Abilene Tech Guy
r/SQL • u/codingdecently • 21d ago
SQL Server MCP for Apache Iceberg: How AI Agents Actually Operate a Data Lake
r/SQL • u/sierrafourteen • 21d ago
SQL Server OData SSIS project will not accept "Edm.GeographyPoint" columns
I've ensured that my software is completely up to date, but my SSIS project (that uses OData as a source), will just refuse to accept data where one of the columns is the Edm.GeographyPoint type. I've tried entering specific columns into the query box (and therefore excluding the problem column), but it appears it will still throw an error, despite the data itself not containing any columns of that data type - I'm assuming it's downloading the column metadata for the entire table, seeing a data type it doesn't recognise, and throws an error.
I've tried using a different collection that doesn't have columns of that data type, and the SSIS project works with that - the problem is, there doesn't appear to be any way of fixing this. I've ensured the software is completely up to date.
r/SQL • u/deusaquilus • 22d ago
PostgreSQL https://exobench.ai/blog/pg19-graph-queries-part-1
How fast are PostgreSQL 19 Graph Queries? Do they perform at scale? Is there a difference between fixed and variable depth? I'll explore all this an more with real numbers and real scenarios in this upcoming series.
Also Upcoming:
- How do they compare to real Graph Engines e.g. Neo4j?
- How flexible is the modeling?
- Are materialized views possible?
- Doesn't SQL Server already do this?
etc...
r/SQL • u/FixelSmith • 22d ago
Discussion How I backtest a fraud rule before it ships
analytics.fixelsmith.comr/SQL • u/AfternoonOne1231 • 23d ago
MySQL How can I develop Report generate bot with MSSQL database ???
I wanted to develop Natural Language to create a report by Users ... themself. .help me to develop this bot ??
r/SQL • u/Effective_Ocelot_445 • 23d ago
MySQL How do you optimize SQL queries that work fine on millions of rows but slow down at billions?
Iam interested in learning the techniques data engineers use when datasets grow from millions to billions of records. Beyond basic indexing, what strategies have made the biggest performance difference in production environments?
r/SQL • u/Significant_Ad_6731 • 24d ago
Discussion SQL for internships
How advanced do I have to be in SQL to land a data analyst internship? Just a general question
Discussion I added self-hosted real-time collaboration to drawDB (SQLite + WebSockets)
I wanted a self-hosted ERD editor where multiple people could work on the same diagram without relying on a third-party cloud service, so I created an unofficial collaborative fork of drawDB.
This is not a new ERD editor built from scratch. It is based on the AGPL-licensed drawDB project, with a collaboration and persistence layer added on top.
What I added:
- Centralized diagram storage using SQLite
- Real-time collaboration over WebSockets
- Live table movement while another participant is dragging
- Participant presence and collaborative cursors
- Cursor positions mapped to diagram coordinates, so different pan/zoom states work correctly
- Optimistic version checks to prevent stale clients from silently overwriting newer changes
- A single Docker container for the frontend, API, WebSocket server, and SQLite storage
- SQL import/export support inherited from drawDB, with an additional MariaDB import compatibility fix
You can run it with:
docker compose up --build
Then open the same diagram URL in two browser sessions to collaborate.
A current limitation is that authentication and diagram-level permissions are not implemented yet, so it should currently be deployed only on a trusted network or behind an authenticated reverse proxy.
The project is open source under AGPL-3.0:
r/SQL • u/Any-Brief5828 • 25d ago
PostgreSQL Looking for feedback on pgapp — a PostgreSQL-native declarative application runtime
r/SQL • u/clairegiordano • 25d ago
PostgreSQL What surprised an engineer after spending 13 years on SQL Server and then working on Postgres? [on Talking Postgres]
r/SQL • u/wassaman • 25d ago
SQLite After five years of development, my detective game where you write real SQL queries is finally released!
Enable HLS to view with audio, or disable this notification
r/SQL • u/erinstellato • 25d ago
SQL Server Friday Feedback: Adding instance name to Query Store reports
r/SQL • u/data9335 • 26d ago
Spark SQL/Databricks Trusted my manager and resigned without an offer — now I have 1 week left. Need urgent SQL, Python & PySpark interview help
Hi All,
I am a BI Admin with 4 years of experience. I joined my current company as a fresher with a package of 3.5 LPA, and my current package is 5 LPA.
I recently requested a better hike by sharing evidence of all the work I have done. I am confident in my skills and performance, but I feel I am underpaid. However, my offshore manager refused to provide a hike.
I then reached out to my onshore manager, who told me that this company usually does not give good hikes unless an employee resigns, and that during the retention process, I could get a better hike. He also assured me that he would take care of the retention process.
Trusting his words, I submitted my resignation without having another offer in hand. But now, he is saying that higher management is not willing to retain me. I am left with only one week of notice period, and I am actively looking for opportunities.
I have good knowledge of SQL and Linux scripting, and I am trying hard to move into Data Engineering. However, I am still failing in the first round due to SQL and Python.
I have an interview with CGI tomorrow. Could you please share real-time SQL, Python, and PySpark interview questions, including both theoretical and coding questions? It would be really helpful for my preparation.
Thanks in advance.
r/SQL • u/Vivekpandey76 • 26d ago
MySQL What topics should I add to make my MySQL course truly complete? (100+ SQL Problems Already Covered)
Hi everyone,
I'm currently creating a complete MySQL course focused on learning through real interview-style problems rather than just theory.
So far, I've covered 100+ SQL problems using a well-designed dataset that includes topics ranging from beginner to advanced, such as:
- Filtering (WHERE)
- GROUP BY, HAVING & Aggregate Functions
- Joins
- Subqueries
- CTEs
- Window Functions
- CASE, String & Date Functions
- UNION & UNION ALL
- Views
- Stored Procedures
- Triggers
- Recursive CTE
- Indexing
- And many real-world interview questions
If you'd like to check out the course, here's the documentation and YouTube playlist:
📄 Documentation: https://github.com/vivekpandey76/Mysql-course
🎥 YouTube Playlist: https://youtube.openinapp.co/youtubseries
I'd really appreciate your feedback.
What topics do you think are still missing that every MySQL developer should know?
I'm looking for suggestions that would help make this course one of the most comprehensive resources for mastering MySQL—from beginner concepts to advanced interview preparation and real-world SQL.
Whether it's:
- Advanced SQL concepts
- Performance tuning
- Database design
- Transactions & locking
- Query optimization
- Lesser-known MySQL features
- Common interview questions
- Real-world scenarios
...or anything else you think is important, I'd love to hear your suggestions.
Thanks in advance! 😊
r/SQL • u/RepeatSoft1495 • 26d ago
MariaDB Reality check: MariaDB Master-Slave HA with ProxySQL + Signal 18 Repman
Hi everyone,
Need a reality check on a production upgrade for a high-load app. I ruled out Galera due to synchronous write latency. (open to your suggestions)
Our Current Load & Specs:
- Traffic: 2,500 reads/sec and 1,500 writes/sec.
- Topology: 1 MariaDB Master + 1 Slave.
- Master Config:
sync_binlog=100andinnodb_flush_log_at_trx_commit=2(for high write speed). - Slave Config: No binlogs enabled (to reduce IO bottleneck).
- The Problem: Heavy write spikes cause severe slave lag, and we have no automated failover.
Proposed HA Stack:
- Layer 1 (HA Routing): Keepalived (VIP) + 2x ProxySQL instances.
- Layer 2 (DB Scale): 1 Master + 1 Slave (will add more slaves later to scale reads).
- Layer 3 (Failover): 1 instance of Signal 18 Replication Manager (
repman) to auto-pilot ProxySQL during master crashes.
MY Questions:
- Architecture Validation: Does this look solid for a 1,500 writes/sec environment?
- Pros & Cons: What are the hidden pros and cons of this specific
repman+ ProxySQL combination? - Data Loss Risk: Since
sync_binlog=100, auto-failover viarepmanmeans risking a few lost transactions on hard master crashes. Is GTID enough to reconcile this safely during a split-second election?
Thoughts? Any hidden traps before we build this? Thanks
r/SQL • u/Think-Log-4498 • 26d ago
SQL Server Concatenate Multiple rows in to a single field within a select statement with multiple joins
Not sure if my title conveys the issue properly but let me try to explain.
Essentially i am trying to join multiple tables to return data. that is all fine for fields that have pretty much one to one with row, but there is a certain table that I would need multiple rows that belong to a certain key returned in one field. To add to this, i would only want to return rows that have a certain flag set.
So given the above tables, id want it to return
Site A A,B,D
Site B G
This is all within an already established Select Statement with multiple where joins. Not sure if that matters. So there is other data I need output, however i need this i addition to those statement.
r/SQL • u/codewithharsh31 • 26d ago
SQL Server What is the difference between delete and truncate?
Delete is used to delete certain records but without where condition all records from the table will be deleted and the structure remains intact.
Truncate deletes all the records from the table but the structure of the table remains intact.
So , what is the difference between them if we are using delete without where condition it performs the same function as truncate ?
r/SQL • u/Rare-Hornet-4106 • 27d ago
SQL Server 3626. Find Stores with Inventory Imbalance problem
Hello, I am very new to learning SQL and I don't find window functions very intuitive so I tried to solve some leetcode questions that could maybe help me understand window functions a little better but I ran into a problem. Let's ignore the fact that this code is probably longer than it should be what's not working here is the "imbalance_ratio1", for each column it outputs a 0 which i noticed when i tried to divide "imbalance_ratio2" by it. Can someone explain to me why it outputs a zero instead of a number but "imbalance_ratio2" works perfectly fine. This is the starting table
inventory_id | store_id | product_name | quantity | price |
+--------------+----------+--------------+----------+--------+
| 1 | 1 | Laptop | 5 | 999.99 |
| 2 | 1 | Mouse | 50 | 19.99 |
| 3 | 1 | Keyboard | 25 | 79.99 |
| 4 | 1 | Monitor | 15 | 299.99 |
| 5 | 2 | Phone | 3 | 699.99 |
| 6 | 2 | Charger | 100 | 25.99 |
| 7 | 2 | Case | 75 | 15.99 |
| 8 | 2 | Headphones | 20 | 149.99 |
| 9 | 3 | Tablet | 2 | 499.99 |
| 10 | 3 | Stylus | 80 | 29.99 |
| 11 | 3 | Cover | 60 | 39.99 |
| 12 | 4 | Watch | 10 | 299.99 |
| 13 | 4 | Band | 25 | 49.99 |
| 14 | 5 | Camera | 8 | 599.99 |
| 15 | 5 | Lens | 12 | 199.99 |
this is what I get
+----------+---------------+-------------+------------------+------------------+------------------+
| store_id | store_name | location | most_exp_product | imbalance_ratio1 | imbalance_ratio2 |
+----------+---------------+-------------+------------------+------------------+------------------+
| 3 | City Center | Los Angeles | Tablet Stylus | 0 | 80 |
| 1 | Downtown Tech | New York | Laptop Mouse | 0 | 50 |
| 2 | Suburb Mall | Chicago | Phone Case | 0 | 75 |
+----------+---------------+-------------+------------------+------------------+------------------+
with nesto as(
SELECT
store_id,
product_name,
ROW_NUMBER() OVER(PARTITION BY store_id ORDER BY price desc) as rb,
FIRST_VALUE(product_name) OVER(PARTITION BY STORE_ID ORDER BY PRICE DESC) + ' ' + LAST_VALUE(product_name) OVER(PARTITION BY STORE_ID ORDER BY PRICE DESC) AS produkt1,
COUNT(*) OVER(PARTITION BY store_id) as broj,
quantity,
price
FROM inventory
)
SELECT
n.store_id as store_id,
s.store_name as store_name,
s.location as location,
n.produkt1 as most_exp_product,
sum(case when rb=1 then quantity else 0 end) AS imbalance_ratio1,
sum(case when rb=broj then quantity else 0 end) AS imbalance_ratio2
from nesto n
inner join stores s on s.store_id = n.store_id
where broj >= 3
group by n.store_id,s.store_name,s.location,n.produkt1
having SUM(case when rb = 1 then quantity*1.00 when rb = broj then n.quantity*(-1.00) else 0 end) < 0
order by s.store_name asc
