hi there, I've found online describing how the CASCADE functionality of foreign keys will help maintain referential integrity for my DB.
here is the batch file I run which outlines the exercise. my output from running that batch. I'm running mysql version 4.1.21 over a mapped drive. My variable FOREIGN_KEY_CHECKS is set to 1. so I assume that's correct.
there is one row missing in the final table
[START BATCH (gen.txt)]
drop table if exists genre;
create table genre (
id serial PRIMARY KEY UNIQUE,
name varchar(16));
drop table if exists subgenre;
create table subgenre(
name varchar(16),
genre_id int REFERENCES genre(id) ON UPDATE CASCADE);
insert into genre(name) values('Rock');
insert into genre(name) values('Jazz');
insert into subgenre values('Metal', '1');
insert into subgenre values('Bebop',
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --