In order to detect Concurrency Violations, the tables in the database need a TIMESTAMP column.
The following code creates the database and tables with a TIMESTAMP column, as well as putting in a few stores and employees for practice. You can copy and paste the code into the MySQL Query Browser and execute it (assuming the Query Browser is properly setup):
use mysql;
drop database if exists mystore;
create database mystore;
use mystore;
create table store
(
storeID int unsigned auto_increment primary key,
city char(50),
state char(2),
manager char(50),
concurrency timestamp
);
create table employee
(
employeeID int unsigned auto_increment primary key,
storeID int unsigned not null references store(storeID),
lastname char(50),
firstname char(50),
concurrency timestamp
);
insert into store values
(default,'San Diego','CA','Russell Smith', default),
(default, 'St. Louis', 'MO','Jim Marks', default);
insert into employee values
(default,1,'Jones','Bill', default),
(default,1,'Collins','Howard', default),
(default,2,'Johnson','Cindy', default),
(default,2,'Gonzales','Hector', default),
(default,2,'Hanson','Danny', default);
