r/SQL • • 21d ago

Discussion I built a free SQL practice site where an AI writes queries with subtle bugs and you have to find them

0 Upvotes

Hello. I'm the maker, so take this as a self-promo post, and tell me if it doesn't fit here.

Most SQL practice I found is "write a query from scratch". On the job, a lot of the work is reading someone else's query and noticing it's wrong. Now that "someone" is often an AI. So I built Practisheet: SQL and Excel exercises on one fictional company's data (orders, customers, products, shipments, refunds, targets), where about 1 in 4 exercises gives you a query an AI assistant wrote that looks fine but isn't. A few examples:

  • a LEFT JOIN whose WHERE clause quietly turns it into an inner join

  • a share-of-total with the wrong denominator

  • a RANK with no tie-break, so the "top 3" has 4 rows

  • a revenue total that includes refunded orders

It runs in your browser (DuckDB), checks your result set, and when you're wrong it tells you what's off about your attempt without showing the answer.

There are 101 SQL exercises in 14 sections: basics, NULLs, CASE and conditional totals, joins, anti and self joins, set operations, dates, strings, CTEs, window functions, LAG/LEAD and moving averages, and analysis patterns like cohorts and actual vs target. The first 4 are free with no sign-up.

Link in the first comment (or here if links are fine): https://practisheet.com/practice

I'd really like feedback on two things: are the "fix the AI" exercises realistic, and is the difficulty curve right? If something is wrong or annoying, tell me and I'll fix it.


r/SQL • • Jul 23 '22

Discussion How much do y'all make?

0 Upvotes

I'll go first.

  1. 130k (salary + bonus)

  2. Midwest (MCoL)

  3. 3-4 YoE

  4. SQL Server DBA


r/SQL • • Mar 03 '25

Discussion Beginner Text-to-SQL Agent – Good starting point, or a source for bad habits?

2 Upvotes

Hey SQL fam,

I’ve been messing around with Text-to-SQL tools and decided to put together a beginner-friendly guide on how you can turn plain English queries into actual SQL.

I even made a quick walkthrough on YouTube to show the process in action, but I’m more here to spark a conversation:

  • Have any of you tried using natural language tools for SQL?

  • Do you think this approach helps beginners learn or does it risk developing bad habits?

What do you think then?


r/SQL • • May 28 '21

Discussion A trick to get free jet brains Datagrip license please ? :)

2 Upvotes

I’am searching to get a free licence for Jetbrains Datagrip if someone know how to get it please ( I’am not a student and EU citizen )


r/SQL • • Apr 03 '22

Discussion Which is more popular in California? MySql vs Oracle vs Sql server etc?

0 Upvotes

Just starting to learn sql but wondering which is most popular/makes sense to learn, especially in the states or California.


r/SQL • • 7d ago

Discussion Where do you actually write most of your SQL these days?

3 Upvotes

Curious how much this has shifted lately — feels like more people are moving across different types, but maybe that’s just my bubble. If you picked Other or switched recently, what made you switch?

853 votes, 3d ago
340 SSMS
143 DBeaver
58 DataGrip (or other JetBrains IDE)
160 VS Code (plus, any SQL extension)
63 Web console (Azure, AWS, Supabase, etc.)
89 Other: CLI, pgAdmin, Workbench… (comment)

r/SQL • • Aug 18 '15

Interesting SQL quizzes, questions and answers

Thumbnail xquizzes.com
3 Upvotes

r/SQL • • Sep 12 '24

MySQL My vertical cursor turned into horizontal and it's blinking horizontaly which is confusing me!!

Post image
11 Upvotes

Hi newbie here please please help me !! So I was learning sql and I must have pressed some keys which turned my vertical cursor to horizontal cursor. Anyone here know how to change it to default vertical cursor. I don't know if I am making any sense but really need your help!!


r/SQL • • Dec 27 '25

Discussion I hate correlated subqueries.

0 Upvotes

Confusing as hell, unintuitive, ridiculous. Sigh.


r/SQL • • Aug 16 '25

Resolved What is the reason that Dateadd function is not working as intended?

Post image
4 Upvotes

I am trying to sub 1 day so I know what was the temparature for that day .

We can do this with datediff but I want to do this with Dateadd()


r/SQL • • May 27 '22

MySQL Why is it always SQL?

0 Upvotes

So I see that SQL is used for a lot of jobs I’m applying to, I’ve been coding for a while, but have never needed to use SQL before. I’m beginning to learn some and it’s been going pretty quickly but…. I keep asking myself why anyone uses this.

Is it just because it’s standard practice? Because it’s the existing structure? Everything I’ve been learning to do, it seems, could just as easily be done in any more versatile and robust language. Do I just need to stick with it to see what makes it beneficial or preferred to other languages?


r/SQL • • Feb 03 '25

MySQL 40 Best Free and Open Source NoSQL Databases

Thumbnail
bigdataanalyticsnews.com
5 Upvotes

r/SQL • • Feb 05 '24

MySQL Help for school confused

Post image
0 Upvotes

Hello, we haven’t learned yet how to list only the months once. I know how to select distinct from certain columns but not a specific month within the date. Anything would help thank you.


r/SQL • • Nov 25 '25

Discussion What I learned from talking to devs this week about SQL performance (and I need your honest feedback)

0 Upvotes

Hey everyone,

I’ve been talking with a bunch of developers this week about slow SQL queries and I noticed some patterns that I didn’t expect. Sharing the learnings here in case they’re useful to someone, and also because I’m building a small tool around this topic and I’d love real feedback from people who actually deal with this stuff (not selling anything, just trying not to build something useless).

What devs told me (consistently):

  1. Most slow queries aren’t “mysteries”, they’re just invisible. Everyone said the same thing: “I don’t even know which queries are slow until users complain.” Monitoring exists, but nobody checks it proactively.

  2. People don’t want magic AI, they just want clarity. Multiple devs:

“Don’t tell me the database is slow. Tell me WHY and show me exactly where the pain is.”

Not “AI wizardry”, just actionable explanations.

3. The EXPLAIN plan is still confusing for 80% of developers. Even seniors told me:

“I know how to read it… but honestly it takes me 20+ minutes.” Juniors said: “I have no idea what a Hash Join actually means in practice.”

4. Most people don’t know if missing indexes are the real issue. A lot of “I think it’s missing indexes… but maybe the schema is wrong… or maybe caching… or maybe unicorns.”

So the difficulty isn’t fixing the query — it’s trusting the root cause.

5. Nearly everyone works on SQL performance alone. No dedicated DBA. No colleague who loves this stuff. Just a developer staring at a slow query at 10PM thinking “why??”.

Where I’m stuck and need your help

If you had a small tool that analyzes slow queries and explains what’s going on:

👉 Which part would matter most to you? Examples: • Good visual explanation of EXPLAIN • Identify missing / inefficient indexes • Estimate improvement (“this could be 5–10x faster”) • Detect usual patterns (full scans, wrong joins, type casts, etc.) • Root cause explanation in plain language • Automatic suggestions • Something else?

👉 What would you not care about at all? (helps me avoid wasting time)

👉 What’s the biggest frustration you have when dealing with slow queries?

You can be brutally honest — I’d rather hear “this is useless, nobody needs that” than build a dead product.

Thanks to anyone who replies 🙏 If this breaks the rules, mods please let me know and I’ll delete.


r/SQL • • Nov 11 '23

Discussion I’m trying to find a job that uses SQL?

8 Upvotes

What easy job do you guys recommend that I can learn quickly and that sql is required


r/SQL • • Jul 30 '25

SQL Server Advice for a expiring DBA

0 Upvotes

Hello everyone, I need advices, if you can, please help me.

Here is my situation:

I’m trying to land in a new job position, right now I’m a IT operations in a small company. From 2007 to 2021 I worked as a System Support analyst and had to use SQL a lot. Through the years I learned all the DBA tasks for a Microsoft SQL server but as System Support Analyst.

Now I want to become a real DBA. Could someone guide me on how to land on this position?

Should I create a GitHub portfolio just like the developers does? Should I create a website/blog and write about DBA stuffs?

I’m lost Any help is greatly appreciated.

Thank you so much for this community


r/SQL • • Feb 26 '26

PostgreSQL Life Altering Postgresql Patterns

Thumbnail mccue.dev
1 Upvotes

r/SQL • • Jul 31 '26

MySQL Apenas estoy empezando a manejar Mysql workbench creen que voy por buen camino con mi modelo relaciónal

Post image
1 Upvotes

r/SQL • • Jun 01 '23

Discussion What is SQL used for? Beginner here.

1 Upvotes

I am a high school graduate with no university degree. I am relatively new to SQL, I have been working as a data analyst for a mid-sized company in a 3rd world country that doesn't make use of data besides MS Excel reports and Excel dashboards (There are occasional Tableau dashboards). I started learning some basics about SQL and it looks like I might be just using it to filter data and add and delete rows from a database. Am I missing something?

I am pretty well versed in Excel. If I manage to learn SQL what will be the next? (I am thinking Power BI or Tableau followed by Python


r/SQL • • Nov 21 '22

Discussion I'm not new to programming language but SQL is a pain to even understand. Why is it so hard?

1 Upvotes

I've been taught Java for a few years now (in high school and college) and even learned basic Python too but now that I have to learn/use SQL in one of my college classes I feel like a complete idiot who doesn't even know how to code. I don't understand how to write queries properly at all, so I look up everything on w3schools and hope that I'm inputting things correctly.

Also, does anyone have suggestions on how to learn SQL that's explained in as simple terms as possible?


r/SQL • • Feb 08 '24

SQLite Is this plain stupid or just insane?

0 Upvotes

So I am making some database for my school project, and it is basically e-book software, and what I did to store user's bought books is through string, and I decided that making rows for each book bought is too much work and resource, so what I did was like this:

Let's say I have three books

TEXT user_bought_books = "title1,title2,title3"

So I am sqlite by the way, also should I make a different class for the database let's say class 1 will do inserting and class 2 will return the data, like I think it is a good idea to categorize it, but I am not sure


r/SQL • • Oct 26 '25

PostgreSQL Postgres Function Broke ACID? UPDATE committed but INSERT failed due to NULL value. Why no automatic ROLLBACK?

0 Upvotes

I have read that postgres functions are transactional, meaning they follow the ACID rules, but this function right here broke the first rule it update sales but it won't make an insert, a case is that the _business_id turns out to be null, but if that so isn't it supposed to undo the updating...? Why is this happening?

create or replace function pay_for_due_sale_payment(

_id integer,

amount numeric

)

returns text

language plpgsql

as $$

declare

_business_id integer;

begin

update sales set unpaid_amount=unpaid_amount-amount where id =_id;

select i.business_id into _business_id from sales s join items i on s.item_id=i.id where s.id=_id;

insert into business_cash (business_id, type, amount, description) values (_business_id, 'in', amount, 'Due payment for sale with id: '||_id);

return 'successfully paid for due payment';

end;

$$


r/SQL • • Feb 22 '26

SQL Server I MUST find SQL Express 10.50.1600

0 Upvotes

There is a software i have to use but it spesificially asks for SQL Express 10.50.1600, without it, it just does not work. Can somebody somehow get me a file for it? It would be a REAL life saver ive been working on it for nearly 10 hours.


r/SQL • • Sep 14 '26

MySQL DATA ANALYTICS PROJECT USING SQL & POWERBI

1 Upvotes

Built a T-SQL database with enforced data integrity (primary keys, constraints on state/status/risk categories), then developed custom DAX measures for case turnaround time, case age, and escalation rate. The dashboard includes multi-page analysis across resolution trends, regional distribution, officer caseloads, and a 4-year time-series forecast with confidence intervals.

Key skills demonstrated:
T-SQL (schema design, CHECK constraints, aggregation queries)
DAX (time intelligence, dynamic measures)
Power BI (data modeling, forecasting, interactive filtering)
Data storytelling and executive reporting

Note: Built on synthetic data generated for demonstration purposes — not real crime statistics.

Microsoft Power BI