If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > error: 150 please help!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-04-11, 00:08
fr0s1yjack fr0s1yjack is offline
Registered User
 
Join Date: Apr 2011
Posts: 21
Red face error: 150 please help!!

im building up this database for my [homework] application and i keep gettting the 'error:150', i know it has to do with the way the foreign key is formed, I can't see what the problem is though:


CREATE TABLE shift(
shiftID INT NOT NULL,
shift_date DATE NOT NULL,
start_time TIME NOT NULL,
end_time TIME NOT NULL,
PRIMARY KEY (shiftID, shift_date, start_time, end_time)
);

CREATE TABLE shift_day(
shift_date DATE,
dayOfWeek VARCHAR(10),
PRIMARY KEY(shift_date),
FOREIGN KEY(shift_date) REFERENCES shift(shift_date)
);
Reply With Quote
  #2 (permalink)  
Old 05-04-11, 00:37
fr0s1yjack fr0s1yjack is offline
Registered User
 
Join Date: Apr 2011
Posts: 21
Talking

its alright guys, i sussed it, my own stupidity again!!

my normalisation was gack as usual!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On