35
submitted 1 year ago* (last edited 1 year ago) by BurningnnTree@lemmy.one to c/programming@programming.dev

I'm looking for a website where I can practice SQL by doing challenges. Like something where it provides you with some tables and you're tasked with writing a script to achieve a certain output. I know how to do basic SELECT and UPDATE commands and stuff, but I need a way to practice writing more complex scripts. What do you guys recommend?

top 12 comments
sorted by: hot top controversial new old
[-] xmunk@sh.itjust.works 17 points 1 year ago

https://mystery.knightlab.com/

The SQL Murder Mystery, of course!

[-] testfactor@lemmy.world 12 points 1 year ago

Codewars. It has Postgres as one of the languages.

[-] lemmyvore@feddit.nl 7 points 1 year ago

I second this. Learn Postgres as a beginner, it's SQL standard compliant and it has the amazing EXPLAIN feature (just add EXPLAIN in front of any query). People who start on MySQL or MariaDB have a harder time learning proper SQL concepts later.

[-] BurningnnTree@lemmy.one 4 points 1 year ago

This is weirdly morbid and controversial for a programming tutorial. Can't say I've ever practiced SQL queries on execution records before. But I'll check it out

[-] andioop@programming.dev 8 points 1 year ago* (last edited 1 year ago)

Your comment made me curious, so I looked around the website and found this.

Our dataset documents Texas death row inmates executed from 1976, when the Supreme Court reinstated the death penalty, to the present.

On one level, the data is simply a part of a mundane programming book. On another, each row represents immense suffering, lives lost, and in some cases amazing redemption and acceptance. In preparing for this dataset, I was deeply moved by a number of the statements and found myself re-evaluting my position on capital punishment. I hope that as we examine the data, you too will contemplate the deeper issues at play.

Just a warning for folks who might not be in a good mental spot for seeing this in their SQL tutorial right now, or even just if it wouldn't be to your personal tastes. It's not your average school exercise but with morbid flavoring, the site really integrates its data. It provides a lot more information about capital punishment than you strictly need to solve the database problems. That works nicely with their intention of "Exercises should be realistic and substantial".

Likewise, the exercises here have been designed to introduce increasingly sophisticated SQL techniques while exploring the dataset in ways that people would actually be interested in.

[-] jadero@programming.dev 1 points 1 year ago

I think the general idea has a lot of merit. I don't know about execution records specifically (no death penalty in Canada for many decades), but government data sets in general.

I retired from database stuff a decade ago, but would jump at the chance to take a course that used Canadian data from various levels of government and public institutions.

[-] Pyroglyph@lemmy.world 1 points 1 year ago

Do people actually say "select star"? When I read SQL I always say "select all" because it reads better.

[-] beejjorgensen@lemmy.sdf.org 2 points 1 year ago

They most definitely do.

[-] HiddenTower@lemmy.world 3 points 1 year ago

Execute program is another online learning tool that teaches SQL. I have used it for typescript lessons and like it a lot.

[-] colonial@lemmy.world 1 points 1 year ago
[-] nerdblood@programming.dev 1 points 1 year ago

Sqlbolt has been good so far, just started myself

this post was submitted on 14 Dec 2023
35 points (92.7% liked)

Programming

17671 readers
94 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS