This database, hillCidLB, manages a collection of books and tracks lenders borrowing those books.
- Database: hillCidLB
- Tables:
- BOOKTABLE: Stores information about books.
- LENDERS_Table: Tracks the lenders who borrow books from the collection.
- BookID (INT): Primary key, unique identifier for each book.
- Book_Title (VARCHAR(255)): Unique title of the book, cannot be null.
- Writer (VARCHAR(100)): Name of the book's author, cannot be null.
- Lender_ID (INT): Primary key, unique identifier for each lender.
- First_name (VARCHAR(100)): Lender's first name, cannot be null.
- Second_name (VARCHAR(100)): Lender's last name, cannot be null.
- Book_title (VARCHAR(255)): Title of the book borrowed, cannot be null.
- BookID (INT): Foreign key referencing
BOOKTABLE(BookID)
to ensure referential integrity.
- Each lender can borrow one book at a time.
- The
BookID
inLENDERS_Table
links directly to theBOOKTABLE
, ensuring that only books available in the collection can be borrowed. - The database supports insertion of new books and lender records, maintaining data consistency.
BookID | Book_Title | Writer |
---|---|---|
1274 | Laws_of_Human_Nature | Robert_Green |
1275 | Think_Big | Ben_Carson |
1276 | I_Will_Marry_When_I_Want | Ngugi_Wa_Thiongo |
1293 | 48_Laws_of_Power | Robert_Green |
1671 | The_Subconscious_Mind | Murphy |
1278 | Caucasian_Chalk_Circle | Bertold_Bretch |
1269 | My_Dear_Hamilton | Elizabeth_Schuler |
Lender_ID | First_name | Second_name | Book_title | BookID |
---|---|---|---|---|
4257 | Mary | Muiruri | Think_Big | 1275 |
1248 | James | Wangari | The_Subconscious_Mind | 1671 |
1347 | Alex | Miwaki | Caucasian_Chalk_Circle | 1278 |
1675 | Winnie | Kirky | 48_Laws_of_Power | 1293 |
3345 | Onyancha | Daniel | Laws_of_Human_Nature | 1274 |
6849 | Caleb | Osanya | My_Dear_Hamilton | 1269 |
- To add new books, insert records into
BOOKTABLE
with uniqueBookID
andBook_Title
. - To record lending a book, insert a record into
LENDERS_Table
linking to a validBookID
. - Each lender should return a book (by deleting or updating their lending record) before borrowing another to maintain one-to-one lending integrity.