MySQL + SQL · Lesson 5

DBMS Tutorial

DBMS क्या है?

DBMS (Database Management System) एक software system है जो users को database define, create, maintain और control करने की सुविधा देता है। यह user/application और disk पर stored data के बीच interface का काम करता है।

DBMS के बिना data flat files में होता है — कोई structure नहीं, कोई security नहीं, कोई sharing नहीं।

Popular DBMS: MySQL, Oracle, Microsoft SQL Server, PostgreSQL, SQLite, MongoDB.

Real analogy: DBMS एक librarian की तरह है। Library (database) में हज़ारों books (data) हैं। Librarian (DBMS) जानता है हर book कहाँ है, कौन ले सकता है, issued books track करता है।

DBMS के Components

ComponentRole
HardwarePhysical devices — server, hard disk, RAM
SoftwareDBMS software (MySQL) + OS + application programs
DataActual data + metadata (structure की information)
ProceduresDatabase use करने के rules और instructions
UsersDBA, End Users, Application Programmers
Query LanguageSQL — database से interact करने के लिए

DBMS के Functions

  • Data Definition: Tables, columns, constraints बनाना और modify करना (DDL: CREATE, ALTER, DROP)।
  • Data Manipulation: Data insert, update, delete और retrieve करना (DML: INSERT, UPDATE, DELETE, SELECT)।
  • Data Security: GRANT और REVOKE से control — कौन क्या access कर सकता है।
  • Data Integrity: PRIMARY KEY, FOREIGN KEY, CHECK constraints से data सही रखना।
  • Concurrency Control: Multiple users को एक साथ काम करने देना — locks और transactions से।
  • Backup & Recovery: Data backup करना और failure के बाद restore करना।
  • Transaction Management: ACID properties ensure करना।

DBMS के Types

TypeStructureExample
HierarchicalTree structure (parent-child)। Fast लेकिन rigid।IBM IMS — पुराने banking systems
NetworkGraph structure — pointers से records linked।IDMS
Relational (RDBMS)Tables (rows और columns)। Keys से linked। SQL use।MySQL, Oracle, PostgreSQL
Object-OrientedData objects के रूप में store।db4o, ObjectDB
NoSQLNon-relational। Documents, key-value, graph।MongoDB, Redis, Cassandra

Class 12 और college के लिए: RDBMS पर focus करें — MySQL standard example है।

RDBMS क्या है?

RDBMS (Relational DBMS) में data tables (relations) में organize होता है। Tables primary keys और foreign keys से linked होती हैं। सभी operations SQL से होते हैं।
FeatureDBMSRDBMS
Data StorageFiles या tables (related नहीं ज़रूरी)हमेशा related tables
RelationshipsMandatory नहींCentral concept — foreign key
Query LanguageVary कर सकती हैहमेशा SQL
ExamplesMS Access (basic)MySQL, Oracle, PostgreSQL

SQL Demo

-- DDL: Structure बनाना
CREATE DATABASE school_db;
CREATE TABLE students (roll_no INT PRIMARY KEY, name VARCHAR(80) NOT NULL);

-- DML: Data add/update करना
INSERT INTO students VALUES (1, 'Aarav Sharma');
UPDATE students SET name = 'Aarav Kumar' WHERE roll_no = 1;
SELECT * FROM students;

-- DCL: Security
GRANT SELECT ON school_db.students TO 'teacher'@'localhost';

-- TCL: Transaction
START TRANSACTION;
INSERT INTO students VALUES (2, 'Priya Verma');
COMMIT;  -- permanent save

Common Mistakes

  • Database और DBMS confuse करना: MySQL = DBMS (software); school_db = Database (data)।
  • सभी DBMS को RDBMS मानना: MongoDB DBMS है लेकिन RDBMS नहीं।
  • DBMS features को ignore करना: Transactions, constraints, user privileges use न करना DBMS का पूरा फायदा नहीं लेना।

Practice Tasks

  1. DBMS components का diagram बनाएं — arrows से interactions दिखाएं।
  2. SQL demo से school_db बनाएं। Teacher user को SELECT-only access दें। INSERT try करें — error note करें।
  3. Library database के लिए DDL, DML, DCL, TCL के examples लिखें।
  4. Viva: "DBMS और RDBMS में 4 अंतर।"

Summary

  • DBMS = database create, manage, control और access करने का software।
  • Components: Hardware, Software, Data, Procedures, Users, Query Language।
  • Functions: Data Definition, Manipulation, Security, Integrity, Concurrency, Backup, Transactions।
  • Types: Hierarchical, Network, Relational, Object-Oriented, NoSQL।
  • RDBMS सबसे important — MySQL, Oracle tables + SQL + keys use करते हैं।
🔗

Share this topic with a friend

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

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

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

💻 लाइव कोड एडिटर

इस पेज के प्रोग्राम यहीं तैयार हैं — चलाएँ, बदलें और सीखें। कुछ भी इंस्टॉल किए बिना।
OneCompiler द्वारा संचालित। कोड एडिटर में अपने आप आ जाता है — Run दबाकर आउटपुट देखें। अगर एडिटर न खुले तो नए टैब में खोलें.