In MySQL manual I read "However, the system does not enforce a requirement that the referenced columns be UNIQUE or be declared NOT NULL.". So, I tried to create two tables:
CREATE TABLE album(
id INT,
title VARCHAR(20)) DEFAULT CHARSET=utf8;
CREATE TABLE track2(
album int,
dsk INTEGER,
posn INTEGER,
song VARCHAR(255),
FOREIGN KEY (album) REFERENCES album(id) ) default charset=utf8;
and have error: ERROR 1005 (HY000): Can't create table 'b.track2' (errno: 150)
Why can't I to use feature which deviate from SQL standards, but provided by MySQL and described in its manual?