Open misterjaytee opened 2 years ago
Thanks so much for this - love it! I'll pop the fixes in as soon as I can. Really do appreciate it...
It's hard to cover for all audiences and at some point you have to choose and narrow your focus. Mine is for self-taught people but your point about OO/Domain Models is a good one. Maybe I can add an explainer there.
Hi Rob,
In your book you ask your readers to leave feedback here if we find any errors, spelling mistakes, etc.
First up, I enjoyed going through the book, I think this is a good primer for Devs and non-Devs.
Having read through the book and worked through the examples etc., here's some errata, observations and notes which I hope are useful.
Apologies in advance for the many entries here - I don't mean to offend, I merely want to help the community:
Page 6 - I needed to do
sudo docker compose up
(note there's no hyphen, docker-compose did not exist on my version of Linux - Rocky 8.6, the CentOS replacement)Page 6 - When firing up the docker image, the instructions tell the user to go to http://0.0.0.0:8081 - the port number is incorrect, it should be port 8080. However, your book is correct and states port 8080, but the docker image instructions are wrong which may confuse people
Page 10 - there are 255 rows in the running_backs table (it's 124 rows in the quarterbacks table, but that isn't what was in the example)
Page 11 - the screenshot is for the quarterbacks table, again not the running_backs table that was in the example
Page 17 - wrong word used, than instead of then - "If a player, no matter the table, doesn’t have a stat than they’re useless to us." should say "If a player, no matter the table, doesn’t have a stat then they’re useless to us."
Page 19 - wrong word used, case instead of cast - "which means our cast won’t cause a problem as we’ll be trying to case the filtered results." should say "which means our cast won’t cause a problem as we’ll be trying to cast the filtered results."
Page 23 - the open and close brackets "(" and ")" do not seem to be required - is this just a best practice or more portable (i.e. having the brackets)?
Page 25/26 (and then pages 42 and 52), - you show that we can connect to the database with "psql ff", but if using the docker image then this doesn't work. First we need to enter the docker image, then tell psql how to connect to the database:
First, find the PostgreSQL docker image:
docker ps
ordocker container ls
(copy the Id of the docker-postgres image)Next enter the docker image:
docker exec -it 1234567890ab bash
(where 1234567890ab is the container Id you copied)To run psql, type:
psql postgres://docker:docker@postgres:5432/ff?sslmode=disable
Page 27 - missing word "it" or "psql" - "I then typed run and TAB and completed the entire line of SQL for me" should be "I then typed run and TAB and it completed the entire line of SQL for me" or "I then typed run and TAB and psql completed the entire line of SQL for me"
Page 33 - missing word "I" - "and wow did get confused" should be "and wow did I get confused"
Page 45 there a semicolon where there shouldn't be - on the from line there's a
;
which is followed by an order statement which has a;
- this will error on the order by line.Page 50, every insert has the position_id set to 1, instead of 1 for qb, 2 for rb, 3 for wr, 4 for te and 5 for def - so every player would become a quarterback :) (this is corrected in the github code for 01_load.sql, but wrong in the book)
Page 54 - every other table has primary key not null, but seasons doesn't - an inconsistency, albeit psql makes the column not null anyway because it is an autoincrement column
Page 54 - interceptions column is specified twice in the points table, this should be intercepted and interceptions
Page 56 - if people are following the book (and not comparing to the code on github), the insert will fail because we haven't inserted a season yet (fk constraint), so we need to insert a season into the table first:
Page 65 - the results table isn't correct - the fantasy points don't include the deduction for interceptions so the results for people following the book will look different when they run the query
Page 72 - you've made the rob_factor column an int, but your weighting is float (numeric), so when you update your player entries it isn't working as expected (e.g.
update points set rob_factor = 1.2 where player_id=1;
- this is setting the rob_factor to 1 which isn't the desired effect). This also has a knock-on impact to the results on page 78 (projection column values are the same as as the fantasy_points values, instead of being different for Lamar Jackson and Christian McCaffrey).Page 76 - the sql is correct, however in 02_queries.sql the sql query has a missing
;
Page 78 - results incorrect - see comments on page 72
Page 79 - missing word "I" - "Yes, I know that if really wanted to" should be "Yes, I know that if I really wanted to"
Page 79 - The quarterback Russel Wilson should have two "L"s in his first name - Russell Wilson
And finally, I'm sure I'm not the only non-Developer who has bought the Imposter Syndrome book, and subsequently who will also read The Little SQL Book (I'm a Systems Engineer who has, over the course of their long career, dabbled in programming, in multiple languages and technologies for various purposes). In fact, I'm not reviewing the book for me, but for some systems engineer colleagues who want to understand SQL as part of their role. With this in mind, it would be great if some of the explanations also catered for people in the wider Dev and Ops circles who may not know what some of the Developer jargon is about (e.g. the mention of domain models and OO on page 32).
And finally, finally, many thanks for the book - the use of real data makes it much more relateable (albeit many readers won't know much about the kind of Football you talk about here :laughing: ).