Search code examples
mysqlsqlpopsql

What is missing in my CREATE TABLE in order to work? mySQL 8.X


I was coding using mySQL 5.x and now i switched to 8.x version and i am confused. What is wrong with this short code ?

[screenshot of my code ]

1

Error message

"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 'rank VARCHAR(50) NOT NULL, discipline VARCHAR(1), yr_start INT(11), ' at line 3"


Solution

  • rank is now a MySQL reserved word. It is used for the rank() window function

    Use a variant, such as ranking instead.

    These functions were introduced in MySQL 8.