Assign Primary key the correct way

38 views Asked by At

I have assigned the primary key to my first column but when i run the 'DESCRIBE' command it is a success but i cannot see on the describe table that a primary key has been assigned.

How do I assign a primary key properly?

Pop SQL image

1

There are 1 answers

4
Mahmudul Hasan On

The primary key should be a not nulled field. You can try this query.

create TABLE register (
    student_iden INT NOT NULL PRIMARY KEY,
    naam VARCHAR(20),
    course VARCHAR(20)
);

DESCRIBE register;