This repository contains the SQL script for creating and populating the SnappDB database, which is a fictional database for a food delivery and online store platform. The script includes the creation of tables for users, stores, products, orders, factors, and more.
To set up the SnappDB database, follow these steps:
-
Database Creation: Execute the SQL script in your preferred database management system to create the necessary tables and relationships.
-
Data Population: The script also populates the tables with sample data to simulate users, stores, products, orders, and other entities. This is useful for testing and exploring the functionalities of the database.
-
Customization: Feel free to modify the script to suit your specific requirements. You can add, remove, or modify tables, columns, and data to meet your needs.
- Information about platform users, including their mobile number, name, address, city, and balance.
- Details about stores on the platform, such as the store name, location, registration date, opening and closing times, and business model.
- Information about products available in stores, including name, discount, cost, category, and whether they support Snapp Express delivery.
- Discounts associated with specific products.
- Records of user orders, including the date, user mobile number, and associated store.
- Summarized information about order costs.
- Mapping of products to stores.
- Users' favorite stores.
- Many-to-many relationship tables between orders, products, and stores.
- User comments and reviews on both products and stores.
Example queries are provided at the end of the script, showcasing how to retrieve data from different tables.