Few Days ago we started MySQL for beginners tutorial. That was a quick intro about What is a database, What is Database table , What is SQL and Why do we use SQL? Today we will cover What are the types of MySQL database commands. Some readers asked why we are writing on MySQL Basics? We have readers learning MySQL for school or Job, We are Starting from Scratch on MySQL tutorial for beginners.You can Follow us on twitter to get latest updates on MySQL tutorial for beginners. Here is our Twitter [twitter_follow username=”bytetips”]

MySQL

Types Of SQL Commands / Statements

SQL commands / statements are divided into few categories. Such as Data definition language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), Transaction Control Commands.

1. Data Definition Language (DDL):  This SQL statements are used to define database schema such as the creation or deletion of a table. Here are some examples:
[unordered_list style=”arrow”]

  • CREATE : This statement is used for creating objects in Database.
  • DROP: This statement is used for deleting objects from Database.
  • RENAME : This statement is used for renaming objects from Database.
  • ALTER : This statement is used for altering structure of the Database.
  • TRUNCATE : This statement removes all record from a table.TRUNCATE removes all rows from a table immediately after execution .

[/unordered_list]
2. Data Manipulation Language (DML): This statement are used for manipulating data from objects in a Relational Database system. Here are some Examples bellow:
[unordered_list style=”arrow”]

  • SELECT : SELECT is one of the most Used Command in SQL. To Retrieve from Data from Database we use SELECT statement.
  • INSERT : INSERT statement is used for inserting data into Database.
  • DELETE : This statement is used to remove rows from a table. You need to be extra with this command.After using a DELETE operation you need to COMMIT the transaction to make the change permanent.
  • UPDATE : This statement updates existing data within a table.

[/unordered_list]

3. Data Control Language (DCL): This type command is used to control access of data in a database. Here are some DCL example :
[unordered_list style=”arrow”]

  • REVOKE : This statement is used to remove user’s access from Database.
  • GRANT : This statement is used for giving a user access privileges to the database.

[/unordered_list]
4. Transaction Control Statements : This type of statements are used to manage the changes made by Data Manipulation Language. Some of the Transaction Control Statements are:

[unordered_list style=”arrow”]

  • COMMIT : This command can be used for saving changes.
  • ROLLBACK : This command can be use for restoring last COMMIT command .

[/unordered_list]
That’s all for today in beginner basics of MySQL tutorial . If you have any question let us now. Have Fun!!

By Garnel

I like to write about Tips And Tutorials related topics and I blog about my personal interests. I am trying to learn the ways to Promote Blog. Sharing my limited knowledge with the world. Blogging about Tips, Tutorials, and Tweaks for Computers, Internet, Operating System, Windows Xp, Windows Vista, Office Applications, Gadgets, Science, and Technology. And Having Fun..

Leave a Reply

Your email address will not be published. Required fields are marked *

18 + eighteen =