MySQL + SQL · Lesson 1

Introduction to Database

What is a Database?

A database is an organized collection of related data stored electronically so it can be easily accessed, managed and updated. The software that controls a database is called a DBMS (Database Management System) — for example MySQL, Oracle, PostgreSQL or MS Access.

Instead of keeping student records in paper registers or scattered Excel files, a school stores them inside a database where every record is structured into rows and columns.

Basic Parts of a Database

TermMeaningExample
TableA collection of related rowsstudents table
Row (Record)One complete entryOne student's details
Column (Field)One attribute of dataname, marks
Primary KeyUnique identifier of a rowroll_no

A Simple Example

CREATE DATABASE school;
USE school;
CREATE TABLE students (
  roll_no INT PRIMARY KEY,
  name    VARCHAR(60),
  marks   INT
);
INSERT INTO students VALUES (1, 'Aman', 88);
A database "school" now holds a table "students" with one record.

Types of Databases

  • Relational (RDBMS): data in tables with relationships — MySQL, Oracle.
  • NoSQL: document/key-value stores — MongoDB, Redis.
  • Hierarchical & Network: older tree/graph based models.

Where Databases are Used

Schools
Students, fees, results, attendance
Banks
Accounts, transactions, loans
E-commerce
Products, orders, customers
Hospitals
Patients, doctors, appointments

Common Mistakes

  • Confusing a database (the data) with a DBMS (the software).
  • Thinking a single Excel sheet is a database — it lacks relationships and rules.

Summary

  • A database is an organized collection of related data.
  • A DBMS is the software that manages it (e.g. MySQL).
  • Data is stored in tables made of rows and columns.
  • Used everywhere: schools, banks, hospitals, online shopping.
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

WhatsApp