Let's go back to our doctor's office scenario. Let's first create a simple table of patients. Execute this code in the query window or at a command line:
CREATE TABLE patients (name VARCHAR(30), age INTEGER, med_id INTEGER);
INSERT INTO patients VALUES ( "Jim", 45, 6 ), ( "Peggy", 6, 1 ), ( "Lisa", 25, 4 ), ( "Bert", 66, 2 ) You should now have a table with 4 patients. Each patient has a name, an age and a medicine ID number. Now run this:
CREATE TABLE meds (name VARCHAR(30), dose INTEGER, med_id INTEGER);
INSERT INTO meds VALUES ( "PillA", 2, 1 ), ( "PillB", 3, 2 ), ( "PillC", 1, 3 ), ( "PillD", 4, 4 ), ( "PillE", 2, 5 ), ( "PillF", 5, 6 ) You now have a second table called "meds" which holds the names and doses of 6 types of medicine. You will notice that the field "med_id" now appears in both of our tables.

