This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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