Search code examples
mysqlruntime-errormysql-workbench

"is not valid at this position, expecting FOR, LOCK..." help a mysql workbench beginner


i'm using SQL Workbench and it's been 3 days since i started learning SQL, today i tried to create a database with pokémons, their names, ids, genre, other stuff, but i can't proceed because it keeps telling me that "id" is not valid at its position

error

I tried doing the same thing on an online SQL tester and it worked just fine, can someone help me?

(sorry if bad english, i'm not a native speaker)


Solution

  • A more accurate way to create a table, based on your example, would be to use a format similar to the one provided below:

    create database Pokedex;
    use Pokedex;
    
    create table Pokemons (
    id int primary key,
    name VARCHAR(255),
    genre VARCHAR(255)
    );