mysql - SQL integer type -
i'm trying create simple table:
create table booklended ( library_card_number integer not null , foreign key (library_card_number) references borrower (library_card_number), sequence integer unique, isbn_number int not null, foreign key (isbn_number) references book(isbn_number), librarian_id integer return_date date not null, checkout_date date not null )
and i'm having error:
7: unexpected token: integer in statement [create table booklended ( library_card_number integer not null , foreign key (library_card_number) references borrower (library_card_number),
sequence integer]
you trying give 2 constraints(not null,foreign key
) @ time. instead u can add foreign key
@ end: try follwing
create table booklended ( library_card_number integer not null , sequence integer, isbn_number int not null, librarian_id integer, return_date date not null, checkout_date date not null, unique (sequence), foreign key (library_card_number) references borrower (library_card_number), foreign key (isbn_number) references book(isbn_number) );
Comments
Post a Comment