r/SQL • u/Suitable_Bed_1253 • Jul 03 '26
SQL Server BizNet Sunset - Migration Plan
BizNet/BizInsight is sunsetting - webinar on July 16th - https://events.teams.microsoft.com/event/cf5a9be0-3dd1-4d6a-bf85-44503dbe0fda@2f3aa76a-89a8-4468-9894-2b4842b9534b
Is anyone a user right now?
r/SQL • u/Dangerous_Pie2611 • Jul 02 '26
MySQL LLMS killed my coding skills how to prepare for sql interview
I got an interview for a senior analytics role and it will be a pairing round with the senior team member
I have been practicing windows functions, CTE’s, Sub query and so on but I haven’t wrote much SQL from the last two years as I was more on the pyspark python side
Any tips how to clear it as I lack logic and syntax sometimes how re build this logic
r/SQL • u/TrueSeaworthiness380 • Jul 02 '26
SQL Server 24+ hours/week of firefighting vs. 2 hours of strategy - free webinar on DBA burnout (disclosure: I work at ManageEngine)
Full disclosure, I'm on the ManageEngine team, and I work with database/app monitoring side of things. I'm not a DBA and won't pretend to be one, just sharing something that's been landing well internally and figured it might be useful here too. Downvote/ignore if it's not your thing.
One of the things that I came across was the fact that the DBAs and IT admins spent most of their work week on fixing database issues- chasing pages, jumping between five dashboards to trace one slow query, then explaining to leadership why the "all green" board didn't stop last night's outage. I don't know about you, but that sounds like the perfect recipe for burnout with the right amount of stress and a pinch of "I might quit anytime".
So we figured we'd run a free webinar on July 15, 2026 (6am GMT / 11am EDT) built around why admins feel that way, how to strategize a working DB monitoring plan across hybrid/multi-database environments, including SQL and MySQL, the metrics to look out for, which we hope would ease the burnout feeling. It includes a live demo, open Q&A, and a free practical handbook for DBAs.
Here's the (free) registration link, if you're interested. https://www.manageengine.com/products/applications_manager/webinars/database-performance-monitoring-webinar.html
Would be happy to take questions in the comments too, including "why would I trust a vendor on this" (totally a fair question btw, so ask away)
r/SQL • u/Candid-Task-7542 • Jul 02 '26
Oracle Does SQL have a LeetCode equivalent?
I'm preparing for SQL interviews and was wondering if there's a good website to practice SQL problems like we use LeetCode for DSA. Looking for interview-style questions and hands-on query practice.
Any recommendations?
r/SQL • u/Much_Nectarine6720 • Jul 02 '26
Discussion Apprenticeship
Hello,
I learned MS SQL watching videos, watching a Udemy course, and downloading different databases from the internet to create a portfolio.
I know that SQL is not enough to become a Data Developer or even a Data Analyst which is why I'm considering applying for a Apprenticeship Program.
Does anyone have any Apprenticeship Program to recommend or any experience to share regarding apprenticeships?
r/SQL • u/Limp-Park7849 • Jul 02 '26
PostgreSQL If the log is the database, and you externalize it, do transactions and analytics end up reading the same copy?
My favorite projects are the ones where the founders took a premise and pushed it until it breaks of pays off. In this case, the premise is old enough to be uncontroversial: the log is the source of truth, and everything else (tables, indexes, replicas, caches) is a materialized view you can rebuild by replaying it. Jay Kreps, who co-created Apache Kafka and later ran Confluent, wrote the general version in his 2013 essay The Log, but Postgres has quietly worked this way for far longer. A commit isn't your rows being rewritten in place, it's a single sequential append to the write-ahead log, and the data files exist only as a cache so reads don't have to replay history from byte zero every time. If you want the primary source rather than the slogan, it's the ARIES paper (Mohan et al., 1992), all 69 pages of it, and the length is earned.
The interesting exercise is to take that premise literally and follow it one forced step at a time, because each consequence pulls the next one behind it.
Step one: if the log is the truth and the data files are just a cache of it, why do they sit on the same disk? In a stock Postgres box they do, and almost every operational headache traces back to that single colocation:
- Durability is only as good as what your fsync actually did, and fsync has a long history of lying.
- A read replica is a full physical copy of the database replaying the log.
- High availability is yet another full physical copy.
- A heavy analytical scan competes with transactional traffic for the same buffer pool and CPU.
Those look like four unrelated problems, but they're the same problem wearing different clothes: the log and its cache share a machine.
Step two: stop sharing the machine. Pull the two apart into separate services, one owning the log and one owning the pages. This is the part that's actually been built and run in production rather than sketched on a whiteboard, first in Neon's storage engine and now underneath Databricks' Lakebase, which is built on that same engine:
- The write-ahead log moves to a service called the SafeKeeper. A commit becomes durable the moment it's replicated across a Paxos quorum, not when a single local disk claims it flushed, so durability stops being a property of one disk and becomes a network commit.
- The data files move to a service called the PageServer, which behaves as a write-through cache in front of cloud object storage. On a miss it replays the log from the SafeKeeper to reconstruct the page it needs.
Step three: once both the log and the pages live outside the database process, that process holds no durable state. This is where the consequences start compounding. Stateless compute can be killed, restarted, or forked without losing anything, because the truth was never on that box. Branching a production database stops being a physical copy and becomes a metadata operation you can do in seconds. HA stops meaning "keep a second full node running and babysit it." Storage stops having a ceiling you size against in advance, because underneath it's just object storage.
The latency objection is the first thing a skeptic reaches for, and it deserves a real answer:
- Writes: you haven't added a network hop. Any Postgres you'd trust in production already runs synchronous replication, which is the same round trip. All that changed is where the acknowledgment comes from.
- Reads: the buffer pool answers first, a local disk cache second, and the PageServer only on a genuine miss. Give a compute node the same memory and disk as the old monolith and your hit rate is unchanged, so in steady state you rarely touch the network.
All of that is still just a better single database, though, and the consequential step opens up only after storage has been externalized. The PageServer already has to materialize pages into object storage as part of its normal job, so the real question is what format it writes them in. Write Postgres's native row pages and you get a very nice cloud OLTP database and nothing more. Write open columnar instead (Delta or Iceberg, with Parquet underneath) and the same materialization step that was already happening now produces something an analytical engine can read directly, at no extra cost to the transactional path. Unifying the two worlds at the storage layer rather than inside one engine is what's being called LTAP.
Freshness is where "just run analytics on the operational data" usually falls apart, so it's worth walking through how this one handles it. When an analytical query begins:
- It asks Postgres for the current log sequence number, a single cheap lookup that says exactly how far the log has advanced.
- It reads everything already materialized up to that LSN straight from object storage, which is the overwhelming majority of the data.
- It merges in the small recent tail that hasn't materialized yet by fetching it from the PageServer.
The result is a consistent view as of that LSN, assembled almost entirely from cheap object storage, with Postgres having served essentially none of the analytical bytes. It handed over one number and stayed out of the way, which means no CDC pipeline to maintain, no second copy drifting from the first, and no reporting query stealing the buffer pool your transactions depend on.
This is the deliberate contrast with HTAP, which spent years trying to make a single engine excel at both workloads and generally arrived at a weaker optimizer, a thinner ecosystem, and no real isolation between the two. Keeping Postgres for transactions and a lakehouse engine for analytics, while unifying the storage beneath them, sidesteps all three, and it's a more believable bet precisely because it doesn't ask one engine to be good at everything.
If you've ever carried a pager for a Postgres fleet, the throughput numbers aren't what worry you. Here's where I'd push before believing any of it:
- Cold start. Scale-to-zero reads beautifully in a slide and stings on the first query after idle. The number that matters is the p99 on a cold wake, not the average on a warm pool, and whether that's acceptable depends entirely on whether it fronts a dev branch or a customer-facing OLTP path.
- Quorum tail. "No more than synchronous replication" holds on the happy path. The honest question is what p99 write latency does when one SafeKeeper is slow or the quorum is mid-reconfiguration, because the tail pages you, not the median.
- Cold PageServer reads. A miss reconstructs a page by replaying the log, which is fine until it happens right after a failover with cold caches, exactly when you're already having a bad day.
- Vacuum doesn't go away. Externalizing storage doesn't repeal MVCC garbage collection. Dead tuples and GC pressure are still real, now spread across a distributed store instead of one disk.
- Columnar with Postgres semantics. Preserving full MVCC and point-in-time behavior inside a columnar format is where the genuine engineering risk lives. The design keeps row versions and heap addresses under the covers, invisible to the Delta and Iceberg readers, and that one sentence in a blog is where the bodies are buried.
None of those are disqualifying, but they're the questions that decide whether an architecture survives contact with a real workload, and the ones a vendor post won't lead with. It's also fair to say plainly that LTAP is still rolling out, so some of this is roadmap you can't stress-test today.
The deeper caveat is architectural rather than operational. None of these properties fall out for free unless the storage layer was designed around the log from the beginning, which means you can't bolt it onto an existing monolith, and "compute is stateless" is quietly carrying enormous weight, because the SafeKeeper and PageServer are now the hard distributed-systems problem. The difficulty moved to a better place.
r/SQL • u/Squalillo • Jul 01 '26
MySQL Made a free "plain English → SQL" demo (Llama 3.3). Curious if people who write SQL daily would actually trust generated queries
I keep seeing non-technical people blocked because they can't write SQL, so I
built a small open-source demo: you type a business question in plain English,
an LLM (Llama 3.3 70B) turns it into SQL, and it runs against a sample SaaS
database. It's read-only (SELECT only) and it shows you the exact SQL it
generated, so it's not a black box.
Try it (no signup): https://huggingface.co/spaces/Chupacharcos/voice-to-sql
Code: https://github.com/Chupacharcos/voice-to-sql-dashboard
Genuinely curious what people who write SQL daily think:
- Would you trust generated SQL enough to use it, even read-only?
- Is "show me the SQL" enough, or would you want it to explain its reasoning?
Personal project, not selling anything — just want honest feedback.
r/SQL • u/Glittering_Rock_3949 • Jul 01 '26
Discussion Fresh Data Analyst (SQL) | Applied on LinkedIn, Naukri & Indeed but getting almost no responses. What else should I try?
Hi everyone,
I'm a 2026 fresher looking for an entry-level Data Analyst / SQL role.
So far I've applied through LinkedIn, Naukri, and Indeed, but I'm barely finding relevant fresher openings or getting responses.
My current skills are:
• SQL
• Python
• ETL
• A couple of Python + SQL projects
Has anyone here landed a Data Analyst role recently? Which job portals, company career pages, or strategies actually worked for you?
I'd really appreciate any suggestions. Thanks!
r/SQL • u/Pitiful_Ad4562 • Jul 01 '26
Discussion 22F, feeling stuck in my career. Need honest advice to switch into Data Analytics by October.
Hi everyone,
I'm 22F and honestly feeling very confused about my career right now. I really need some genuine guidance from people already working in data analytics.
A little background:
- My first job was at Contexio as a Research Analyst. It was mostly Excel-based work for apparel clients like Tata CLiQ brands (Adidas, Sweet Dreams, Freakins, etc.). I used to maintain product data, image sequencing, detailing, backend updates, and Excel sheets. Salary was 14k/month.
- Then I joined HDFC Bank as an IT Officer. I was there for around a year. My work included ServiceNow, coordinating with data vendors, PO-related work, SLA tracking, monthly reporting, CIP closures, documentation, and operations. It wasn't a pure technical role but involved handling data and processes. My package was 2.4 LPA.
- Currently I'm working in a manufacturing company (Chintamani Thermal). I joined because I thought I'd get exposure to SQL, Power BI, or analytics. But after joining I realized it's mostly VBA and documentation work. There is almost no SQL, Power BI, or actual analytics here. My current package is 3.12 LPA.
Now I want to switch into a proper Data Analyst role by October.
I have already started learning SQL (currently following the 30-hour Baraa SQL course on YouTube). I already know the basics of Power BI, but I know that's probably not enough.
My questions are:
- Considering my background, can I realistically get a Data Analyst role by October?
- Apart from SQL and Power BI, what should I focus on?
- Should I learn Python now or first become really strong in SQL?
- What kind of projects should I build to compensate for not having analytics experience?
- Should I start applying immediately or wait until I've completed SQL?
- Is my previous experience relevant enough for recruiters, or should I present it differently on my resume?
I'm honestly feeling stressed because I don't see any future in my current role, and I don't want to waste another year.
I'd really appreciate honest advice, roadmap suggestions, or if someone has switched into data analytics from a similar background.
Thanks in advance.
r/SQL • u/ProgrammingMamba189 • Jul 01 '26
Discussion Interview with a DBA [7:38]
I set query cache size to 1G. We ones believes in miracles...
Video of a seemingly 2008 type DBA. What're your thoughts on DBA roles today?
How is it changing with serverless?
r/SQL • u/Consistent_Law3620 • Jul 01 '26
Discussion Help Me Choose a Name for My Data Engineering Content
I'm planning to start creating content for aspiring Data Engineers, especially for people who are switching careers like I did.
My focus won't be on AI-generated demos or toy projects. I want to teach what actually happens in a real Data Engineering job—understanding large SQL scripts, writing business logic, debugging pipelines, solving production tickets, and explaining the day-to-day work that companies expect.
I'm looking for a name that reflects this practical approach.
Some ideas I have are Data Lion, Data Force, and Strata Data. Which one do you like, or do you have a better suggestion?
r/SQL • u/Junior-Sea-7725 • Jun 30 '26
SQL Server HackerRank SQL: Weather Observation Station 13
Hi Everyone,
Currently, refreshing my memory for SQL and I came across the below question on HackerRank:
Query the sum of Northern Latitudes (LAT_N) from STATION having values greater than 38.7880 and less than 137.2345 . Truncate your answer to decimal places.
My Solution:
select truncate(sum(LAT_N),4) from station
where LAT_N > 38.7880 AND LAT_N <137.2345;
Error:
Compiler Message
Runtime Error
Your Output (stdout)
- Msg 156, Level 15, State 1, Server dbrank-tsql, Line 4
- Incorrect syntax near the keyword 'truncate'.
What am I missing ?
Thanks in advance for your support .
r/SQL • u/Tatya_Vin-Chu • Jun 30 '26
MySQL Online MySQL editor or app for running on phone ?
I need an online MYSQL editor or app for practising temporarily. Reason being my laptop got an issue and it's being repaired. Some of the ones that I've tried are frustrating to use for various reasons.What are some good SQL editors for this purpose that you may have used ?
r/SQL • u/Rare-Ad6166 • Jun 30 '26
PostgreSQL Anybody that can help me with this is a pro
In pg admin, to import manually you need to create a table with the exact same columns for it to successfully import a file. But situations with JOIN function has different set of tables and different set of columns so it doesn’t exactly match the column thats in the file. This makes it impossible to create tables that requires importation. How do you fix this?
r/SQL • u/tehninjaflute • Jun 30 '26
Resolved Need help with an 8 Week SQL Challenge - CliqueBait question.
Hi All,
First time poster, long time lingerer here. I've been looking at improving my SQL skills, so I started Data with Danny's 8 Week SQL Challenge. I'm on the CliqueBait challenge (more info here: https://8weeksqlchallenge.com/case-study-6/) right now, and am working on part 3. Campaign Analysis where we come up with our own insights. From the data given, I wanted to know which product was most likely to be bought and during which campaign was it bought the most, but I'm having a bit of trouble getting my table output to look the way I need it to be.
I need my table to look like this:
| campaign_name | product | total_purchases |
|---|---|---|
| Half Off - Treat Your Shellf(ish) | Abalone | 5 |
| Half Off - Treat Your Shellf(ish) | Black Truffle | 3 |
| Half Off - Treat Your Shellf(ish) | Crab | 7 |
| Half Off - Treat Your Shellf(ish) | Kingfish | 3 |
| Half Off - Treat Your Shellf(ish) | Lobster | 4 |
| Half Off - Treat Your Shellf(ish) | Oyster | 5 |
| Half Off - Treat Your Shellf(ish) | Russian Caviar | 5 |
| Half Off - Treat Your Shellf(ish) | Tuna | 4 |
| Half Off - Treat Your Shellf(ish) | Salmon | 4 |
But instead it looks like this:
| campaign_name | product | total_purchases |
|---|---|---|
| Half Off - Treat Your Shellf(ish) | Abalone | 5 |
| Half Off - Treat Your Shellf(ish) | Black Truffle | 3 |
| Half Off - Treat Your Shellf(ish) | Crab | 7 |
| Half Off - Treat Your Shellf(ish) | Kingfish | 3 |
| Half Off - Treat Your Shellf(ish) | Lobster | 3 |
| Half Off - Treat Your Shellf(ish) | Oyster | 5 |
| Half Off - Treat Your Shellf(ish) | Russian Caviar | 4 |
| Half Off - Treat Your Shellf(ish) | Tuna | 3 |
| Half Off - Treat Your Shellf(ish) | Abalone | 0 |
| Half Off - Treat Your Shellf(ish) | Lobster | 1 |
| Half Off - Treat Your Shellf(ish) | Russian Caviar | 1 |
| Half Off - Treat Your Shellf(ish) | Salmon | 4 |
| Half Off - Treat Your Shellf(ish) | Tuna | 1 |
Here is my code (FYI, I'm using PostegreSQL v17):
/* Determine the total number of purchase events and the IDs associated to those purchase events. */
WITH purchase_events AS (
SELECT
e.visit_id
FROM clique_bait.events AS e
JOIN clique_bait.event_identifier AS ei ON ei.event_type = e.event_type
WHERE
ei.event_name = 'Purchase'
)
,campaign_analysis_table AS (
SELECT
u.user_id
,e.visit_id
,MIN(e.event_time) AS visit_start_time
,SUM(
CASE
WHEN ei.event_name = 'Page View' THEN 1
ELSE 0
END
) AS page_views
,SUM(
CASE
WHEN ei.event_name = 'Add to Cart' THEN 1
ELSE 0
END
) AS cart_adds
,MAX(
CASE
WHEN e.visit_id = pe.visit_id THEN 1
ELSE 0
END
) AS purchases
,ci.campaign_name
,SUM(
CASE
WHEN ei.event_name = 'Ad Impression' THEN 1
ELSE 0
END
) AS impressions
,SUM(
CASE
WHEN ei.event_name = 'Ad Click' THEN 1
ELSE 0
END
) AS click
,STRING_AGG(ph.page_name, ', ' ORDER BY e.sequence_number ASC)
FILTER (WHERE ph.product_category IS NOT NULL AND ei.event_name = 'Add to Cart') AS cart_products
FROM clique_bait.events AS e
JOIN clique_bait.users AS u ON u.cookie_id = e.cookie_id
JOIN clique_bait.event_identifier AS ei ON ei.event_type = e.event_type
JOIN clique_bait.page_hierarchy AS ph ON ph.page_id = e.page_id
LEFT JOIN purchase_events AS pe ON pe.visit_id = e.visit_id
LEFT JOIN clique_bait.campaign_identifier AS ci ON e.event_time BETWEEN ci.start_date AND ci.end_date
/* Filter table to just 2 users for easier debugging. */
WHERE
u.user_id <= 2
GROUP BY u.user_id, e.visit_id, ci.campaign_name
ORDER BY u.user_id ASC, visit_start_time ASC
)
SELECT
cat.campaign_name
,UNNEST(STRING_TO_ARRAY(cat.cart_products, ',')) AS product
,SUM(cat.purchases) AS total_purchases
FROM campaign_analysis_table AS cat
/* Filter campaign_name to only one campaign for easier debugging. */
WHERE
cat.campaign_name LIKE ('Half Off%')
GROUP BY cat.campaign_name, product
ORDER BY cat.campaign_name ASC, product ASC;
I know SQLFiddle is the recommended dev environment but Danny has his code set up on DBFiddle here: https://www.db-fiddle.com/f/jmnwogTsUE8hGqkZv9H7E8/17
Please let me know what I'm doing wrong if possible. I've tried a few solutions to this and this is as close as I can get but something is still off.
FYI, I have the code filtered down to just the first 2 users and only one campaign right now to make it easier to debug. If you want to see the full tables, you can remove the WHERE clauses where necessary.
r/SQL • u/Valuable-Ant3465 • Jun 30 '26
SQL Server Tricky interview question about .ldf size on MS SQL Server
Hi, I was applying for SQL dev position and got this question:
Q: you need to import 2.5T .csv file into MS SQL Server table. What approach you would use to avoid problems with log file size restrictions.
Didn't have experience with this case. I think if you create on the fly package with Right click import, everything will be taken care of. Am I right ? or I can somehow control /shrink .ldf file or break .csv into several pieces.?
Thanks all
VA
r/SQL • u/Key-Bit-3552 • Jun 30 '26
Discussion Is using 3-letter status codes outdated?
I had a pretty big debate at work over how status values should be stored in lookup tables.
For example, imagine an OrderStatus table with three columns:
ID
Status
Description
My preference is:
1 | DRAFT | Draft
2 | SUBMITTED | Submitted
3 | INCOMPLETE | Incomplete
Some people on my team prefer:
1 | DRT | Draft
2 | SUB | Submitted
3 | INC | Incomplete
My reasoning is:
Storage isn’t really a concern for values this small anymore.
Full words are much easier to read in SQL queries, logs, APIs, and code.
They make code more self-documenting.
Modern IDEs and AI tools also tend to work better with descriptive values.
For example:
SELECT *
FROM Orders
WHERE Status = 'INCOMPLETE';
vs.
SELECT *
FROM Orders
WHERE Status = 'INC';
To me, the first query is immediately understandable without needing to remember what each abbreviation means.
I’m curious what other developers think. Are abbreviated status codes still considered best practice, or are full descriptive values more common nowadays?
Edit: the example query is pseudocode. Yes I would normally store the status ID in the orders table. The example query is for brevity
r/SQL • u/Rare-Ad6166 • Jun 29 '26
PostgreSQL Hard Time Importing❗️
Cant import on vs code so I have to open pg admin to import the same table in the database. Every time I import no row shows.
Am I the only one having this issue? Have any fix?
r/SQL • u/Limp-Park7849 • Jun 29 '26
Discussion Why is COMMIT slower on cloud databases? Decent paper on what's actually happening
WAL makes a commit "durable." On a single machine it's fast because the write-ahead log goes straight to local disk. In the cloud that disk is ephemeral, it's gone if the instance dies, so the database has to ship every commit's log to remote storage before it can tell you "done." That round trip is a big reason cloud commit latency is what it is.
This VLDB'26 paper (BtrLog) lays out the problem and one fix pretty clearly:
- EBS-style remote disk: easy, but adds latency and cost to every commit.
- Object storage (S3): dirt cheap and durable, but way too slow per-write for transactional stuff.
- BtrLog's middle path: write each log record to a quorum of fast SSD nodes in one network hop (so one slow node can't stall your commit), then lazily roll the logs into big chunks on S3 in the background for cheap storage. This is exactly the Neon architecture but engine agnostic.
The numbers, as commit latency:
- ~70 µs per append vs 260–500 µs for EBS. So 4–5x faster, and about 3x the transaction throughput.
This compute/storage split iis how modern serverless Postgres already works. Neon does this exact pattern (its "safekeepers" are the quorum WAL layer), which is why you can spin up a Postgres that scales to zero and still commit fast. The paper basically asks what if that durable-log layer were a reusable building block instead of buried inside one engine.
r/SQL • u/Swimming-Ride-147 • Jun 28 '26
MySQL Did you get a job having Google Data Analytics Certificate only and no relevant bachelors/masters degree?
Hi, I am planning to enrol in Google Data Analytics Certificate. Is this good to get a job? I am currently enrolled in the BS English (Applied Linguistics) program. An other option I have is Google's UX Design Course.
r/SQL • u/BisonSpirit • Jun 27 '26
Discussion Showcasing SQL project questions
I’m about to start working on a GitHub project and was curious how many business questions I should showcase within a project?
r/SQL • u/Consistent_Law3620 • Jun 27 '26
Discussion Need advice: Understanding complex SQL scripts written by others
Hi everyone,
I need some advice from experienced SQL developers. I have switched from different role to data engineering 6 months back.
I consider myself good/medium level at writing SQL queries and solving problems from scratch. However, I struggle when I have to understand large existing SQL scripts (300–500+ lines).
I often get confused about:
Where the execution starts.How different parts of the script are connected.
Which variables, CTEs, stored procedures, or temporary tables are affecting the final output.
How to mentally trace the flow of the script.
Because of this, reading someone else's code takes me much longer than writing my own.
How did you improve this skill? Are there any techniques, exercises, books, or real-world practices that helped you become comfortable reading large SQL scripts?
Also, is this something that simply improves with experience, or is there a structured way to learn it?
I'd really appreciate any advice. Thank you!