Home > database >  MySQL: Syntax error while linking two tables
MySQL: Syntax error while linking two tables

Time:11-05

I have two tables: userdata and videodata. I have the email as the primary key in the first table (userdata) and I want to use email in the second table (videodata) as a foreign key.

userdata table-

ss of userdata table

Whenever I execute the query for the videodata table creation, I get this error-

enter image description here

Here is the query for creating videodata table-

enter image description here

CodePudding user response:

LIKE is a reserved word. Enclose it in back ticks.

create videDate (
...
`like` int,
...
);
  • Related