Computer Science, asked by khansumaiya5462, 1 month ago

1) Create table BOOK with fields namely: Book_No, Book_Tiltle,Price,Qty, and Author.Create another table BOOK_ISSUE with the fields namely: Book_No, Student_name, Issue_Date,Return_Datea) Now, decide the primary key and foreign key in the above tables.​

Answers

Answered by Equestriadash
6
  • Create table Book(Book_No int Primary Key, Book_Title varch‎ar(50), Price int, Qty int, Author varch‎a‎r(50));

  • Create table Book_Issue(Book_No int Primary Key, Student_name varch‎a‎r(50), Issue_date date, Return_date date);

The Primary keys would be Book_No for both the tables. Since a Primary key must be a unique value and helps eliminate data redundancy, and book numbers cannot be the same, they can be categorized as Primary keys.

The Foreign keys would also be Book_No for both the tables. A Foreign key acts as a point of reference to another table. Since the book number in the first table is for storage purposes and the book number in the second table is to help understand which book has been issued from the Book table, Book_No is the Foreign key for both the tables.

Similar questions