CREATE DATABASE music DEFAULT CHARACTER SET utf8;
CREATE TABLE Artist
(artist_id INTEGER NOT NULL AUTO_INCREMENT,
name varchar(255),
PRIMARY KEY(artist_id)
)
ENGINE = INNODB;
CREATE TABLE Album
(
album_id INTEGER NOT NULL AUTO_INCREMENT,
title varchar(255),
artist_id INTEGER,
PRIMARY KEY(album_id),
INDEX USING BTREE(title),
CONSTRAINT FOREIGN KEY (artist_id)
REFERENCES Artist(Artist_id)
ON DELETE CASCADE ON UPDATE CASCADE
)
ENGINE = InnoDB;
CREATE TABLE Genre
(
genre_id INTEGER NOT NULL AUTO_INCREMENT,
name VARCHAR(255),
PRIMARY KEY(genre_id),
INDEX USING BTREE (name)
)
ENGINE = INNODB;
CREATE TABLE Track
(
track_id INTEGER NOT NULL AUTO_INCREMENT,
title VARCHAR(255),
len INTEGER,
rating INTEGER,
count INTEGER,
album_id INTEGER,
genre_id INTEGER,
PRIMARY KEY (track_id),
INDEX USING BTREE(title),
CONSTRAINT FOREIGN KEY (album_id) REFERENCES Album(albumn_id)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FOREIGN KEY(genre_id) REFERENCES Genre(genre_id)
)
ENGINE = INNODB;
我已多次检查过。怎么了?
答案 0 :(得分:-1)
你拼错了外键
parameters.put("subReport", "/edu/ijse/gdse41/ams/reports/Answers.jasper");