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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.