DBMS – SQL Databases
SQL Databases
A SQL (Structured Query Language) Database is a type of Relational Database Management
System (RDBMS) that stores data in the form of tables with rows and columns. SQL is used to
create, retrieve, update, and delete data. It maintains relationships between tables using Primary
Keys and Foreign Keys, ensuring data accuracy and consistency.
Features
• Stores data in tables.
• Uses SQL to manage data.
• Supports relationships between tables.
• Ensures data security and integrity.
• Provides fast and efficient data retrieval.
Examples of SQL Databases
• MySQL
• Oracle Database
• Microsoft SQL Server
• PostgreSQL
• SQLite
Basic SQL Commands
1. SELECT Command
The SELECT command is used to retrieve data from one or more tables.
Syntax:
SELECT * FROM Student;
Example:
SELECT Name, Age FROM Student;
Output: Displays only the Name and Age columns from the Student table.
2. INSERT Command
The INSERT command is used to add new records into a table.
Syntax:
INSERT INTO Student VALUES (101, 'Pooja', 19);
Example: Inserts a new student record.
3. UPDATE Command
The UPDATE command is used to modify existing records.
Syntax:
UPDATE Student SET Age = 20 WHERE RollNo = 101;
Example: Updates the age of Roll No. 101.
4. DELETE Command
The DELETE command is used to remove records.
Syntax:
DELETE FROM Student WHERE RollNo = 101;
Example: Deletes the record of Roll No. 101.
Applications of SQL Databases
• Banking systems
• Hospital management
• Student management systems
• E-commerce websites
• Library management systems