Skip to content

Hilla44/Week8databaseAsignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

README for hillCidLB Database

This database, hillCidLB, manages a collection of books and tracks lenders borrowing those books.

Database and Tables Overview

  • Database: hillCidLB
  • Tables:
    • BOOKTABLE: Stores information about books.
    • LENDERS_Table: Tracks the lenders who borrow books from the collection.

Table Structures

BOOKTABLE

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

LENDERS_Table

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

Key Features

  • Each lender can borrow one book at a time.
  • The BookID in LENDERS_Table links directly to the BOOKTABLE, ensuring that only books available in the collection can be borrowed.
  • The database supports insertion of new books and lender records, maintaining data consistency.

Sample Data

BOOKTABLE Sample Records

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

LENDERS_Table Sample Records

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

Usage Notes

  • To add new books, insert records into BOOKTABLE with unique BookID and Book_Title.
  • To record lending a book, insert a record into LENDERS_Table linking to a valid BookID.
  • Each lender should return a book (by deleting or updating their lending record) before borrowing another to maintain one-to-one lending integrity.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages