create table department
(
dept_name varchar(20),
building varchar(20),
budget numeric(12, 2),
primary key(dept_name)
);
This is table that i created before...
now i am writing this:
create table course
(
course_id varchar(7),
title varchar(50),
dept_name varchar(20),
credits numeric(2, 0),
primary key(course_id),
foreign key (dept_name) references department
);
an it shows :
ERROR 1005 (HY000): Can't create table 'satyarth.course' (errno: 150)