This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Could someone please assist me point out the error in this sql statement below.
I have created a table "sunnettable" and I am trying to create the table "dailyactivity" and link it to the first table
CREATE TABLE `dailyactivity` (
`da_id` INT(10) UNSIGNED NOT NULL,
`employee_id` Varchar(10) NOT NULL,
`report_date` date NOT NULL,
PRIMARY KEY (`da_id`))
CONSTRAINT fk_sunnettable FOREIGN KEY (employee_id) REFERENCES sunnettable (employee_id)
This is the error I'm getting:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONSTRAINT fk_sunnettable FOREIGN KEY (employee_id) REFERENCES sunnettable (empl' at line 10