Jump to content

getting an auto_incremented integer..


gardan06

Recommended Posts

  • 1 year later...
I know this thread is probably old, but I need help with Auto Increment.

This is the table I have created with auto_increment:


CREATE TABLE appointment(appointment_id MEDIUMINT NOT NULL AUTO_INCREMENT, Primary Key (appointment_id), student_id varchar(8), INDEX (student_id), FOREIGN KEY (student_id) REFERENCES student(student_id), lecturer_name varchar(50), INDEX (lecturer_name), FOREIGN KEY (lecturer_name) REFERENCES lecturer(lecturer_name), appointment_date DATE, appointment_time TIME) TYPE=INNODB;

Is the auto increment value also set as a primary key through Primary Key (appointment_id) or does it overide the primary key and its rules?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.