Skip to content

ParagWeb7/SQL_Task_2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

SQL_Task_2

: Data Insertion and Handling Nulls

Task 2: Data Insertion and Handling Nulls

πŸ“Œ Objective

Practice inserting, updating, and deleting data in a relational database while handling NULL values and ensuring data consistency.


πŸ› οΈ Tools Used

  • MySQL (Compatible with DB Fiddle / SQLiteStudio)
  • SQL (Structured Query Language)

🧱 Database Schema

This task includes the creation and population of four core tables:

  1. customers – Stores customer information
  2. products – Stores product details
  3. orders – Stores order information
  4. order_items – Stores individual items in each order

πŸ“₯ Operations Performed

βœ… Insertions

  • Added sample customers, products, orders, and order items
  • Handled missing values using NULL where applicable
  • Used INSERT INTO ... SELECT to duplicate a product entry

πŸ” Updates

  • Updated product stock after order placement

❌ Deletion

  • Deleted a customer (Amit Singh) from the database

πŸ’‘ Learning Highlights

  • Use of INSERT, UPDATE, DELETE statements
  • Handling NULL values in fields like phone, address, and description
  • Understanding of foreign key constraints between tables
  • Safe and structured data manipulation with WHERE conditions

πŸ“„ File Info

  • ecommerce_task2.sql – contains all table creation, insertion, update, and delete queries

βœ… Outcome

A populated and relationally consistent database ready for further queries, reporting, or analysis.


πŸ“š Author

Parag Kotkar

About

: Data Insertion and Handling Nulls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published