SQL Commands
Last week, I did a post that talked about Introduction of SQL. In this post, I linked to some end to end tutorials those are related to SQL functions such as ADO.Net, LINQ and MySQL vs PDO. Sql is like a big room, can store large amount of information. Provide best shield to data through many featuring commands. Mainly SQL commands work as an instructor, which communicate with database for performing specific task or functions. Such as, accessing data, modifying data and insert data in the database. SQL commands are of 4 types:
Data Definition Language (DDL):
For creating, modifying, destroying the database and database object, we can use DDL statements like Create, Update for defining statement.
Create Statement: Through this command, you may creating database or table. For example, you can strore information about employees and their further details in database.
Alter Command: Once you have created the database, you may wish to modify the data in it. Alter command allow you to make changes in structure of table.
Drop Command: Last command of DDL is Drop, allows you to remove entire database object from particular table or database. For example, if we want to permanently delete Employee table from database, we can use Drop command.
Data Manipulation Language (DML):
These statements are used for Storing, Modifying and Deleting data from database. Thses commands will be used by all database user during the routine operation of database. Commands like Insert, Alter, Delete are use for Manipulating database.
Insert Statement: For inserting data into a particular table, we can use insert command. In following example, we are inserting some data into emp table through insert statement.
Update Statement: For managing data, Update command is used to modify information contained within a table, either in indivisual or multiple data.
Select command: Select command is used fetch details or retrieve particular row and coloumn from table.
Delete command: Finally, let’s take a look at Delete command. Delete command is used to destroy an object of database.
Transaction Control Language (TCL):
After doing an alteration in data during transaction, we realize that, we done wrong updation. Now we need to unsave the changes that we have been done. These commands are used for managing changes affecting the data. Some Commands in TCL are Commit, savepoint, Autosavepoint, Rollback etc.
Commit: used to permanently save any transaction into database.
Rollback: This command is used to restore the database to last committed state. It is also used with savepoint command to jump to savepoint in transaction.
Savepoint: It is used to temporarily save any transaction so that you can rollback to that point whenever necessary.
Data Control Language (DCL):
Data control language in SQL. These SQL commands are used for providing security to database object. Basically, DCL is used to create role, permission, refrential integrity, as well as it is used to control access to database by securing it.
Grant: Gives a privilege or provide access to user on database.
Revoke: Takes back or remove privileges granted from user on database.
As above, Given information about SQL Commands and their uses in database, you can get further knowledge in CPD Technologies. CPD Technologies provides you best advance training in different languages along with brief knowledge of SQL server.
for more info : cpd-india
Batches: Regular & Weekends for Working Profession
For FREE DEMO CLASS CALL – 011-65164822 / 91- 8860352748
CPD Technologies Block C 9/8, Sector -7, Rohini, Delhi-110085, India Landmark: Near Rohini East Metro Station, Opposite Metro Pillar No-397
Website :- www.cpd-india.com
Email :- support@cpd-india.com