0

it leads to error in mysql

create table book_copies
(
   bookid references book(bookid) on delete set null,  
   programme_id references library_branch(programme_id) on delete set null, 
   no_of_copies int
);

enter image description here a

2

1 Answer 1

1

You are lacking types for your columns. Each column needs a type such as int or varchar(255).

If your columns are referencing primary keys, their type is probably int or bigint.

create table book_copies (
  bookid int references book(bookid) on delete set null,
  programme_id int references library_branch(programme_id) on delete set null,
  no_of_copies int
)
Sign up to request clarification or add additional context in comments.

1 Comment

yes, I got it. how to reference another table thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.