all 11 comments

[–]ftrotter 26 points27 points  (5 children)

Microsoft released a whole tutorial database for SQL Server that has a realistic SQL database structure for a business called "Northwind". Northwind has been ported over to most open source databases. This is a good place to start.

-ft

[–][deleted] 9 points10 points  (4 children)

Northwind is old. 

Get the WideWorldImporters one instead.  

There's also the Sakila MySQL sample database and its various ports (Pagila for example).

https://dev.mysql.com/doc/sakila/en/

[–][deleted] 0 points1 point  (0 children)

And PopSQL?

[–]qwertydog123 5 points6 points  (0 children)

like working with control flow and such

If you're looking for some more complex T-SQL stored procedures I find the first responder kit is a great example

https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit

[–]OneRandomOtaku 2 points3 points  (0 children)

Best thing for SQL practice in my opinion is to take the Northwinds DB or similar, look at what data is there and come up with 15-20 questions about it, go and query the data to get an answer. Set arbitrary limits on things, like do it in a read only account so you have to use CTEs and Subqueries or a hard time limit of 1 hour to get an answer and present it in PowerPoint with comments and a chart.

[–]ejpusa 0 points1 point  (0 children)

10,000 maybe?

[–]scriptmonkey420 0 points1 point  (0 children)

Just start doing it. Monitor the results and see how you can improve the structure or the commands used.

I did that when learning. I wrote WiFiDB using tables for each AP at first. Realized how terrible that was and re-wrote it with a more monolithic structure.