662 points · by tosh · 7y ago · 52 comments
Are there any other fields with a "Red Book"? I am mildly curious.
https://en.wikipedia.org/wiki/Red_Book_of_Westmarch
I'll show myself out...
If you ever need to design a logically sound query processor/optimizer and/or data storage layer, this is a book you should study.
It still sits on my bookshelf, waiting for the student whose interest in databases is deeper than dujourDB, so that I can pass it down to them.
It's still one of my favourite technical books.
I read it when I started looking at RDBMS after having worked in NoSQL and I clearly recall how excited I was to learn that there is a full fledged system that I could utilize which would get rid of 90% of my code.
I know this term is usually not used when it comes to technical books, but I found it to be quite a page turner!!
COUNT(case when <complex condition> then 1 end) as foo
Count occurrences of complex condition over a row set. Works because COUNT ignores null.
NVL(1/NULLIF(foo, 0), 0)
Protect against division by zero. The expression 1/X is a simple example but this generalizes well. In fact, I’ve come to think that NULL turns any SQL value into a Monadic option type like those used functional languages and Rust.
Note that I’m not saying the above cannot be done without NULL, just that NULL is a really useful tool in my experience.
> Graphs allow us to build complex, intuitive relationships between data points. Unlike many traditional methods of structuring data, which focus on the format of relationships, graphs focus on the topology of relationships in the dataset.
https://blog.usejournal.com/data-modelling-with-graph-theory...
When it comes to making database concepts more intuitive, I find visually rich representations very helpful, for example using geometric space-encoded logical relationships to aid diagrammatic reasoning.
It goes along well with many other people's efforts to improve mathematical represenations and interfaces through intuitive visualizations, ie:
https://www.reddit.com/r/mathgifs/
https://www.reddit.com/r/visualizedmath/
...
It's a good idea to familiarise with the code in bottom-up order of layers.
Readme says this: > The implementation takes heavy inspiration from Edward Sciore's SimpleDB, augmented by implementations of various exercises in his textbook Database Design and Implementation.
Some additional resources I'd recommend if you're interested:
Designing Data-Intensive Applications is a fantastic place to start if you're interested in the intersection of databases & distributed systems:
The Architecture of Open-Source Applications book has a fewer chapters on databases:
https://aosabook.org/en/bdb.html
https://aosabook.org/en/hdfs.html
https://aosabook.org/en/nosql.html
There's some fantastic documentation on Postgres and its internals:
http://www.interdb.jp/pg/index.html
The Classic: a basic database theory course covering the classical material would center around Parts B and C. Chapter 10 and parts of Chapter 9 of Part C are somewhat more advanced and could be skipped. If time allows, some of Chapter 12 and a selection of Part F might be covered.
Feast of Query Languages: a course on the theory of query languages would start with a quick review of the basic material on classical languages (Part B), and continue with Parts D and E. If time allows, some material on languages for complex objects and object-oriented databases (Part F) could be covered.
Gourmet Sampling of Database Theory: a course for people with theoretical appetites that emphasizes the specificity of database theory. Logicians wishing to explore the connection between finite-model theory and databases will be interested in Parts C and E. Those interested in descriptive complexity will find Part E closest to their hearts. Researchers in logic programming will prefer Part D, particularly Chapters 12, 13, and 15. People with a background in theoretical artificial intelligence will find Parts D and F of particular interest. Rule-based systems are related to Chapter 14 (see also parts of Chapter 22). Programming language people will be interested in much of the material on query languages, including Chapters 20 and 21 in Part F.
Fast-Food Database Theory: a course for applied database students that is meant to provide informal exposure to some of the basic results of database theory. This would include assorted topics, with an informal presentation emphasizing the examples, results, and intuition provided in the text, rather than the proofs. A possible syllabus would include Part B; parts of Chapters 8, 9, and 11 in Part C; Chapter 12 and parts of Chapter 15 in Part D; and selected chapters of Part F.
Numerous exercises have been included, and they are essentially of three categories. Routine exercises (unmarked) require easy manipulation of the basic concepts and results. Harder exercises are marked with a (*). Another category of exercises is meant to complement the material in the text and often contains results from related research articles. These exercises are usually on the hard side and some may constitute term projects. These exercises are marked with a ( ).
Play around with a small RDBMs like sqlite. Do a project around it. Look at the source maybe and then learn about the principles. Foundations of databases are based on discrete mathematics ( where relational comes from in RDBMs ) so a background in discrete math helps.
For enterprise level stuff ( clustering, replication, distribution, etc ), it's more practical to learn on the job where you have access to the hardware, servers, etc.
In fact I added this thread to my favorites because the book references look useful.
Here is an updated edition: https://www.amazon.com/dp/129202447X/