1 year ago

#333934

test-img

Touseef Khan

Is there is any method to sove this error of MYSQL workbench when working on database?

Apply changes to exams Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '

CONSTRAINT `reg`
     FOREIGN KEY (`reg`)
     REFERENCES `students`.`stdinf...
 at line 6 SQL Statement:
CREATE TABLE `students`.`exams`
(
  `reg`VARCHAR(25) NOT NULL,
  `code`VARCHAR(10) NOT NULL,
  `marks` INT NULL,
   PRIMARY KEY (`reg`, `code`),
   INDEX `code_idx` (`code`ASC) VISIBLE,
   CONSTRAINT`reg`
     FOREIGN KEY (`reg`)
     REFERENCES `students`.`stdinfo` (`reg`)
     ON DELETE NO ACTION
     ON UPDATE NO ACTION,
     CONSTRAINT `code`
     FOREIGN KEY (`code`)
     REFERENCES `students`.`courses` (`code\`)
     ON DELETE NO ACTION
     ON UPDATE NO ACTION
)

I wanted to make foreign key in third table for connecting my other two tables but it showing this error.

mysql

sql

database

mysql-workbench

dql

0 Answers

Your Answer

Accepted video resources