Syntax error in Mysql

Asked

Viewed 162 times

1

I was creating a table in Mysql and this error appeared in this code:

USE cadastro;
CREATE TABLE países(
    cod_país INT NOT NULL AUTO_INCREMENT,
    nome_país VARCHAR (30),
    PRIMARY KEY cod_país
    );

1 errors were found during analysis.

A closing Bracket was expected. (near ")" at position 124)

3 answers

7


-2

Put it like this and see if you can.

USE cadastro;
CREATE TABLE países(
    cod_pais INT NOT NULL AUTO_INCREMENT,
    nome_país VARCHAR (30),
    PRIMARY KEY (cod_pais)
    );

-3

Take the accents of the "is" in the word country. All words "country" are written with acute accent in the.

  • 2

    And why is that a mistake?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.