0% found this document useful (0 votes)
2 views

lab5

The document outlines the structure of four database tables: Sales, Book, Request, and Inventory, each with specific fields and data types. The Sales table tracks individual sales transactions, while the Book table contains details about books available for sale. Additionally, the Request table manages customer book requests, and the Inventory table records stock levels and procurement details, including a Threshold alert system for low stock management.

Uploaded by

sai713194
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

lab5

The document outlines the structure of four database tables: Sales, Book, Request, and Inventory, each with specific fields and data types. The Sales table tracks individual sales transactions, while the Book table contains details about books available for sale. Additionally, the Request table manages customer book requests, and the Inventory table records stock levels and procurement details, including a Threshold alert system for low stock management.

Uploaded by

sai713194
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Sales Table

Unique identifier for each sale


SaleID INT (Primary Key)
transaction.
Customer who made the
UserID INT
purchase.
BookID INT Book being purchased.
SaleDate DATETIME Date and time of the sale.
Quantity INT Number of copies sold.
TotalAmount DECIMAL(10,2) Total price of the sale.

Book Table
Field Name Data Type Description
BookID INT (Primary Key) Unique identifier for each book.
Title VARCHAR(100) Title of the book.
Author VARCHAR(100) Author of the book.
Publisher VARCHAR(100) Publisher of the book.
ISBN VARCHAR(20) Unique book identifier.
Price DECIMAL(8,2) Price of the book.
Number of available copies.
Shelf location of the book in the
Stock INT
shop.

Request table

Field Name Data Type Description


RequestID INT (Primary Key) Unique request identifier.
UserID INT Customer making the request.
BookTitle VARCHAR(100) Name of the requested book.
Author VARCHAR(100) Author of the requested book.
Date when the request was
RequestDate DATETIME
made.
Status ENUM (‘Pending’, ‘Processed’) Request status.

Inventory Table
Field Name Data Type Description
Unique identifier for inventory
InventoryID INT (Primary Key)
records.
BookID INT Book linked to inventory.
Number of books added to
StockAdded INT
inventory.
SupplierName VARCHAR(100) Name of the supplier.
Date when the stock was
ProcurementDate DATETIME
added.
Threshold alert Table
Field Name Data Type Description
Unique identifier for threshold
AlertID INT (Primary Key)
alert.
BookID INT Book running low on stock.
Current number of books in
CurrentStock INT
stock.
Minimum stock level before
ThresholdValue INT
alert is triggered.
Date when the alert was
AlertDate DATETIME
triggered.

You might also like