TranslateProject/sources/tech/20200203 New zine- Become a SELECT Star.md
DarkSun 03a641ec97 选题: 20200203 New zine: Become a SELECT Star!
sources/tech/20200203 New zine- Become a SELECT Star.md
2020-02-05 01:04:21 +08:00

3.9 KiB
Raw Blame History

New zine: Become a SELECT Star!

On Friday I published a zine about SQL called “Become a SELECT Star!”

You can get it for $12 at https://wizardzines.com/zines/sql. If you buy it, youll get a PDF that you can either read on your computer or print out. You can also get a pack of all 7 zines so far.

Heres the cover and table of contents:

https://jvns.ca/images/sql-toc.png

why SQL?

I got excited about writing a zine about SQL because at my old job I wrote a ton of SQL queries (mostly related to machine learning) and by doing that I learned there are a lot of weird things about SQL! For example SQL queries dont actually start with SELECT. And the way NULL behaves isnt really intuitive at first.

Its been really fun to go back and try to explain the basics of SQL from the beginning. (whats the difference between WHERE and HAVING? whats the basic idea with indexes actually? how do you write a join?)

I think SQL is a really nice thing to know because there are SO MANY SQL databases out there, and some of them are super powerful! (like BigQuery and Redshift). So if you know SQL and have access to one of these big data warehouses you can write queries that crunch like 10 billion rows of data really quickly.

lots of examples

I ended up spending a lot of time on the examples in this zine, more than in any previous zine. My friend Anton helped me come up with a fun way to illustrate them, where you can clearly see the query, the table its running on, and what the query outputs. Like this:

experiment: include a SQL playground

All the examples in the zine are real queries that you can run. So I thought: why not provide a simple environment where people can actually run those queries (and variations on those queries) to try things out?

So I built a small playground where you can run queries on the example tables in the zine. It uses SQLite compiled to web assembly, so all the queries run in your browser. It wasnt too complicated to build I just used my minimal Javascript/CSS skills and vue.js.

Id love to hear any feedback about whether this is helpful or not the example tables in the zine are really small (you can only print out small SQL tables!), so the biggest table in the example set has 9 rows or something.

whats next: probably containers

I think that next up is going to be a zine on containers, which is more of a normal systems-y topic for me. (for example: namespaces, cgroups, why containers?)

Heres a link to where to get the zine again :)


via: https://jvns.ca/blog/2020/02/03/new-zine--become-a-select-star/

作者:Julia Evans 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出