Skip to content

A comprehensive SQL database project for managing a bookstore, including inventory, sales, and customer data.

License

Notifications You must be signed in to change notification settings

Don-Withana/BookHaven-SQL-Database

Repository files navigation

BookHaven-SQL-Database

A comprehensive SQL database project for managing a bookstore, including inventory, sales, and customer data.

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

BookHaven BookStore Management SQL

Table of Contents
  1. About The Project
  2. Database Structure
  3. Installation
  4. Usage
  5. Example Queries
  6. Data Dump
  7. Contributing
  8. License
  9. Contact
  10. Acknowledgments

About The Project

This project is a SQL database designed for a bookstore management system named BookHaven with complete ERD diagrams. It contains various tables that store information about books, customers, orders, items, suppliers, and payments. The project uses MySQL as the database server.

Built With

SQL: The primary language used for designing and managing the database structure and performing data operations.
DBMS (Database Management System): Utilized to manage and interact with the SQL database, ensuring data integrity and efficient querying.
ERD (Entity-Relationship Diagram): Created to visually represent the data model and relationships between entities within the bookstore database.

MySQL

Database Structure

The database bookhaven consists of the following tables:

  • book: Stores information about books such as item code, ISBN, title, genre, category, author, publisher, and year of publication.
  • customer: Stores customer details like customer ID, name, NIC, contact number, email address, and postal address.
  • item: Contains information on items such as item code, price, and stock level.
  • order_: Stores order details including order ID, quantity, order date, delivery date, destination address, payment ID, and customer ID.
  • order_item: Maps the relationship between orders and items.
  • payment: Records payment information such as payment ID, amount, date, time, and payment type ID.
  • payment_type: Defines different types of payment methods.
  • stationary: Stores details about stationary items.
  • stock: Represents the stock information for items and their suppliers.
  • supplier: Stores supplier details such as supplier ID and name.

Installation

To set up the database locally:

  1. Clone the Repository:

    git clone https://github.com/yourusername/bookhaven-sql-database.git
    cd bookhaven-sql-database
  2. Import the SQL Dump: Open phpMyAdmin or any MySQL/MariaDB client. Create a new database named bookhaven. Import the bookhaven.sql file included in this repository.

  3. Run SQL Scripts: Ensure that all tables are created and data is loaded by executing the SQL commands in the bookhaven.sql file.

Usage

This database can be used to manage the inventory, customer orders, and payment processing of a bookstore. To interact with the database, you can use SQL queries to retrieve, insert, update, or delete data as required.

Example Queries

  1. Retrieve all books in the store:
    SELECT * FROM book;
  2. Get details of a specific customer:
    SELECT * FROM customer WHERE cust_id = '4001';
  3. Check stock levels of items:
    SELECT * FROM item WHERE stock_level > 0;

Data Dump

The SQL dump included in this repository contains initial data for testing and development purposes. It is not intended for use in a production environment.

Contributing

Contributions are welcome! If you have ideas for new features or bug fixes, please fork the repository and submit a pull request. Here’s how:

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License. See the LICENSE.txt for more details. This means you can freely use, modify, and distribute the code, but please include the license notice in any copies or substantial portions of the software

Contact

Have questions, suggestions, or just want to chat about the project? Reach out to me!

Name: Himan Withana
Email: [email protected]

Acknowledgments

Special thanks to the following resources and tools that have been invaluable in the creation and development of this project:

About

A comprehensive SQL database project for managing a bookstore, including inventory, sales, and customer data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published