Day 32 β MySQL Database & Tables (Using phpMyAdmin)
π― Day 32 Goal
By the end of this day, students will clearly understand:
What is a Database
Why we create multiple databases
What is a Table
Rows & Columns in real life
What is phpMyAdmin
How to:
Create a database
Create tables
Insert basic data (concept level)
π Today is foundation day for CRUD
π Quick Revision (From Day 31)
MySQL = Relational Database
Data is stored in tables
MySQL Server runs in background
We connect using tools (GUI / Node.js)
Today we go one level deeper π
π§ What Is a Database? (Very Simple)
A database is a container that holds tables.
π« Real-Life Example
School System
| Real Life | MySQL |
| School building | Database |
| Class rooms | Tables |
| Students | Rows |
| Name, Roll No | Columns |
π One database can have many tables
ποΈ Why We Create Separate Databases?
Because every project is different.
Examples:
school_dbhospital_dbrailway_dbtodo_app_db
π This keeps data:
Organized
Secure
Easy to manage
π₯οΈ What Is phpMyAdmin?
π Simple Definition
phpMyAdmin is a web-based GUI tool to manage MySQL databases.
Instead of terminal commands:
We use browser
Click & manage databases easily
π Very beginner-friendly π
π§ Why We Are Using phpMyAdmin (Instead of Workbench)
| phpMyAdmin | MySQL Workbench |
| Web-based | Desktop app |
| Easy for beginners | Slightly heavy |
| Comes with XAMPP | Separate install |
| Good for learning | Good for professionals |
π phpMyAdmin is perfect for teaching students
π§© How phpMyAdmin Works (Concept)
Browser β phpMyAdmin β MySQL Server β Database
phpMyAdmin is just a middle tool, not a database itself.
π Creating a Database (Step-by-Step)
π’ Step 1: Open phpMyAdmin
Usually:
http://localhost/phpmyadmin
π’ Step 2: Click on βNewβ
This means β Create new database
π’ Step 3: Enter Database Name
Example:
todo_app_db
π’ Step 4: Click βCreateβ
π Database created successfully
π§ Important Naming Rules (Teach Students)
β Use lowercase
β Use underscore _
β No spaces
β Todo App
β
todo_app_db
π What Is a Table?
A table stores actual data.
Database β Container
Table β Data holder
π§Ύ Real-Life Example: Todo App
Table Name: tasks
| Column | Meaning |
| id | Unique number |
| title | Task name |
| status | Pending / Done |
| created_at | Date |
π§± Table Structure Explained
Columns (Fields)
Fixed structure
Same for all rows
Rows (Records)
Actual data
Can be many
π οΈ Creating a Table in phpMyAdmin
π’ Step 1
Select database β todo_app_db
π’ Step 2
Click Create Table
Table name:
tasks
Number of columns:
4
π§ Understanding Column Properties (Very Important)
1οΈβ£ Column Name
Example:
id
2οΈβ£ Data Type
Defines what kind of data is stored
Examples:
INT β Numbers
VARCHAR β Text
DATE β Date
3οΈβ£ Length
Max size of data
Example:
VARCHAR(255)
π Common Data Types (Must Teach)
| Data Type | Use |
| INT | Numbers |
| VARCHAR | Text |
| TEXT | Long text |
| DATE | Date only |
| DATETIME | Date + Time |
| BOOLEAN | True / False |
π Primary Key (Most Important Concept)
What Is Primary Key?
Unique identifier
No duplicate values
No NULL allowed
Example:
id
π Every table must have a primary key
π§ Auto Increment (Explain Slowly)
Auto Increment means:
- MySQL automatically increases number
Example:
1, 2, 3, 4...
Perfect for:
User ID
Task ID
Order ID
π§Ύ Example Table Structure (Conceptual)
tasks table
| Column | Type | Extra |
| id | INT | PK, Auto Increment |
| title | VARCHAR(255) | Not Null |
| status | VARCHAR(20) | Default: pending |
| created_at | DATETIME | Current time |
β Inserting Data (Using phpMyAdmin)
phpMyAdmin provides Insert tab
Example record:
title β Learn MySQL
status β pending
π Row gets added automatically
π§ How This Helps in Node.js
Later in Node.js:
We will fetch rows
Insert new tasks
Update status
Delete tasks
π Database structure is foundation of backend
ποΈ Professional Tip (Very Important)
Before writing backend code:
Always design database
Decide tables & columns
Professionals do DB design first, coding later.
π§ Day 32 Key Takeaways
β Database = Container
β Table = Data storage
β Rows = Records
β Columns = Fields
β phpMyAdmin = Easy GUI tool
β Primary Key is mandatory
π What We Will Learn on Day 33
π SQL queries (SELECT, INSERT, UPDATE, DELETE)
π Real CRUD using phpMyAdmin
π Prepare for Node.js connection
π Homework for Students (Optional)
1οΈβ£ Create database: school_db
2οΈβ£ Create table: students
3οΈβ£ Add columns:
id
name
class
phone
π Stay Connected
If you found this article helpful and want to receive more such beginner-friendly and industry-relevant Node JS notes, tutorials, and project ideas β π© Subscribe to our newsletter by entering your email below.
And if you're someone who wants to prepare for tech interviews while having a little fun and entertainment, π₯ Donβt forget to subscribe to my YouTube channel β Knowledge Factory 22 β for regular content on tech concepts, career tips, and coding insights!
Stay curious. Keep building. π
About the author
- Hi there, tech enthusiasts! I'm a passionate Software Developer driven by a love for continuous learning and innovation. I thrive on exploring new tools and technologies, pushing boundaries, and finding creative solutions to complex problems. What You'll Find Here On my Hashnode blog, I share: π In-depth explorations of emerging technologies π‘ Practical tutorials and how-to guides π§Insights on software development best practices πReviews of the latest tools and frameworks π‘ Personal experiences from real-world projects. Join me as we bridge imagination and implementation in the tech world. Whether you're a seasoned pro or just starting out, there's always something new to discover! Letβs connect and grow together! π
Comments
Join the discussionNo comments yet. Be the first to comment.

