- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the different commands used in MySQL?
SQL language is divided into four types of primary language statements: DML, DDL, DCL and TCL. Using these statements, we can define the structure of a database by creating and altering database objects and we can manipulate data in a table through updates or deletions. We also can control which user can read/write data or manage transactions to create a single unit of work.
The four main categories of SQL statements are as follows −
DML (Data Manipulation Language)
DML statements affect records in a table. These are basic operations we perform on data such as selecting a few records from a table, inserting new records, deleting unnecessary records, and updating/modifying existing records.
DML statements include the following −
SELECT – select records from a table
- INSERT – insert new records
- UPDATE – update/Modify existing records
- DELETE – delete existing records
DDL (Data Definition Language)
DDL statements are used to alter/modify a database or table structure and schema. These statements handle the design and storage of database objects.
- CREATE – create a new Table, database, schema
- ALTER – alter existing table, column description
- DROP – delete existing objects from database
DCL (Data Control Language)
DCL statements control the level of access that users have on database objects.
- GRANT – allows users to read/write on certain database objects
- REVOKE – keeps users from read/write permission on database objects
TCL (Transaction Control Language)
TCL statements allow you to control and manage transactions to maintain the integrity of data within SQL statements.
- BEGIN Transaction – opens a transaction
- COMMIT Transaction – commits a transaction
- ROLLBACK Transaction – ROLLBACK a transaction in case of any error
- What are the different "/types" commands in JShell in Java 9?
- What are the different "/vars" commands in JShell in Java 9?
- What are the different "/edit" commands in JShell in Java 9?
- What are the different modes of parameters used by MySQL stored procedure?
- What are the different time format characters used by MySQL DATE_FORMAT() function?
- What are different date format characters used by MySQL DATE_FORMAT() function?
- What are the DDL commands in DBMS?
- What are the DML commands in DBMS?
- What are the DCL commands in DBMS?
- What are the TCL commands in DBMS?
- What are Shell Commands?
- What are the different wildcard characters that can be used with MySQL RLIKE operator?
- What are the different unit values that can be used with MySQL INTERVAL keyword?
- What are the different wildcard characters that can be used with MySQL LIKE operator?
- What are the different data types used in SQL queries?