Creating the lookup tables

We need to create the following three lookup tables:

  • labs: This lookup table will contain the ID strings for our laboratories.
  • lab_techs: This lookup table will have the names of the lab technicians, identified by their employee ID numbers.
  • plots: This lookup table will have one row for each physical plot, identified by lab and plot numbers. It will also keep track of the current seed sample planted in the plot.

Add the SQL query for creating these tables to create_db.sql as follows:

CREATE TABLE labs (id CHAR(1) PRIMARY KEY);CREATE TABLE lab_techs (id SMALLINT PRIMARY KEY, name VARCHAR(512) UNIQUE NOT NULL);CREATE TABLE plots (lab_id CHAR(1) NOT NULL REFERENCES labs(id),  plot SMALLINT NOT NULL, current_seed_sample ...

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.