Pizza_Ordering_System_Explanation
Pizza_Ordering_System_Explanation
1. Introduction to Databases
A database is an organized collection of data that can be accessed, managed, and updated. It
helps in storing and retrieving data efficiently, reducing redundancy, and improving data
security.
Examples:
- Library database for books, borrowers, and transactions.
- Online shopping websites storing customer and order details.
2. Types of Databases
Relational Databases:
- Organize data into tables with rows and columns.
- Examples: MySQL, PostgreSQL.
NoSQL Databases:
- Flexible structure for semi-structured or unstructured data.
- Examples: MongoDB, Firebase.
Relational databases are ideal for structured data (e.g., a table of customers and orders),
while NoSQL works well for dynamic, large-scale applications like social media feeds.
3. Introduction to MySQL
MySQL is an open-source relational database management system (RDBMS) widely used for
web applications, data analysis, and e-commerce. It uses SQL (Structured Query Language)
to manage databases and allows features like:
- Scalability.
- Security.
- Data integrity.
5. SQL Basics
Types of SQL Commands:
1. DDL (Data Definition Language):
- Used to define, modify, or delete table structures.
- Commands: CREATE, ALTER, DROP.
Customer Table
cust_id (PK) cust_name cust_address
1 Alice Smith 123 Baker St
2 John Doe 456 Elm St
Pizza Table
pizza_id (PK) pizza_flavour pizza_price
1 Pepperoni $12.99
2 Margherita $10.99
Order Table
order_id (PK) cust_id (FK) pizza_id cust_address total_price
1 1 1 123 Baker St $12.99
2 2 2 456 Elm St $10.99
7. SQL Commands for Pizza Ordering System
Here are some SQL commands to manipulate the above database:
E-commerce websites.
Inventory management.
School management systems.