anthonydb / practical-sql

Code and Data for the First Edition of "Practical SQL" by Anthony DeBarros, published by No Starch Press (2018).
Other
660 stars 406 forks source link

Chapter 1: column "school" of relation "teachers" does not exist #45

Closed tiergan-rey closed 2 months ago

tiergan-rey commented 2 months ago

Windows 10

yes, followed download instructions

using PostgreSQL 16.4 and pgAdmin 8.10

Yes all code was copied from github

Missing school column in order to insert data

1st edition Chapter 1, page 8 and Chapter_01.sql

The code given to create the table does not include a column for the schools but the insert into snippet does make it un-executable unless the column is added or the schools removed. Following the 1st edition of the book so not sure if this has already been seen to.

Screenshot (18) the column tab on the left shows the missing school column

ERROR: column "school" of relation "teachers" does not exist

anthonydb commented 2 months ago

It doesn't look like you created the table correctly. The CREATE TABLE statement has a school column: https://github.com/anthonydb/practical-sql/blob/main/Chapter_01/Chapter_01.sql#L14