4 ms·
What's a good place to start learning SQL? (for someone with 5+ years C++ and now dabbling in Clojure/ELisp)
by geokon 8y ago
What's a good place to start learning SQL? (for someone with 5+ years C++ and now dabbling in Clojure/ELisp)
- dan-robertson 8y ago0. Look at a few simple sql queries (at most one join) and the corresponding schema. Internalise what the queries do and a rough idea as to the syntax 1. Have a database to query (or think of some project that is basically a frontend on a database and which you can give a reasonable amount of data) 2. Come up with questions for the database you want to answer 3. Look at the SQLite documentation. They have fantastic diagrams for the syntax of a sql query. 4. Write down the sql for your query (or work out what you can’t express and see if you can search on the internet to find out how to express it) 5. Look into relational algebra and try to work out how it corresponds to sql databases. 6. Repeat steps 2-4 7. Understand what different types of joins there are 8. Repeat steps 2-4 9. Read about more exotic things like nested queries, window functions, recursive queries, and so on (just look at the features of your database of choice and see what you can learn about). These might come in handy for future questions 10. Repeat steps 2-4 (repeatedly) If you don’t know which database to use then start with SQLite. It’s basically fine for anything simple and manything complicated.
- victorpascu 8y agoPersonally, I like the gentle introduction given on W3Schools. It shows you what you have and what you aim to get out of it in terms of data, and removes the need to bother with a local setup, letting you focus on the actual queries instead. https://www.w3schools.com/sql/ https://www.w3schools.com/sql/
- forinti 8y agoJoe Celko's books are excellent. And then learn window functions.
- AlisdairO 8y ago(self plug) you might want to give pgexercises.com a go. It takes you from beginner up to somewhat advanced with exercises that you can run in the browser.
- car 8y agohttps://lagunita.stanford.edu/courses/DB/SQL/SelfPaced/info https://lagunita.stanford.edu/courses/DB/SQL/SelfPaced/info
- rane 8y agoThis might be useful: https://selectstarsql.com/ https://selectstarsql.com/
- Serow225 8y agohttps://sqlbolt.com/ https://sqlbolt.com/
- Serow225 8y agoAlso eventually https://use-the-index-luke.com/ https://use-the-index-luke.com/