Saturday, November 18, 2023

RELATIONAL DATABASE MANAGEMENT SYSTEM - SQL COMMANDS

 SQL COMMANDS


  • SQL stands for Structured Query Language. It is used for storing and managing data in Relational
  • Database Management System (RDBMS). 
  • It is a standard language for Relational Database System. 
  • It enables a user to create, read, update and delete relational databases and tables.
  • All the RDBMS like MySQL, Informix, Oracle, MS Access and SQL Server use SQL as their standard database language.
  •  SQL allows users to query the database in a number of ways, using English-like statements

Types of SQL Commands

There are five types of SQL commands: DDL, DML, DCL, TCL, and DQL.

Data Definition Language (DDL):

CREATE: Creates a new database, table, or index.

ALTER: Modifies the structure of an existing table or database.

DROP: Deletes an existing database, table, or index.

TRUNCATE: Deletes all data from a table.


Data Manipulation Language (DML):

SELECT: Retrieves data from one or more tables.

INSERT: Inserts new data into a table.

UPDATE: Modifies existing data in a table.

DELETE: Deletes data from a table.


Data Control Language (DCL):

GRANT: Provides privileges to users or roles.

REVOKE: Removes privileges from users or roles.


Transaction Control Language (TCL):

COMMIT: Saves all changes made in the current transaction.

ROLLBACK: Discards all changes made in the current transaction.

SAVEPOINT: Sets a savepoint within the transaction.


Data Query Language (DQL):

JOIN: Combines rows from two or more tables.

GROUP BY: Groups rows based on a column's values.

HAVING: Filters grouped rows based on conditions.

ORDER BY: Sorts rows in the result set.



No comments:

Post a Comment

Introduction to Stack Data Structure