-1

So I have this:

CREATE TABLE activeSessions (
    id VARCHAR NOT NULL UNIQUE,
    claimtime int,
    mp FLOAT
);

When I put this into the database, this comes up:

#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 'NOT NULL UNIQUE,
    claimtime int,
    mp FLOAT
)' at line 2

How do I fix this?

BenRoob
  • 1,662
  • 5
  • 22
  • 24
Bitsnack
  • 19
  • 2

1 Answers1

2

You need to specify the constraint after the column declaration:

CREATE TABLE activeSessions (
    id VARCHAR(10) NOT NULL,
    claimtime int,
    mp FLOAT,
    UNIQUE(id)
);

Remember to give an INT value to the VARCHAR column.

Alberto
  • 674
  • 13
  • 25