Notes and study materials on sql
Four Types of Sql Statements:
1.DDL(Data Definition Language):Providesstatements to specify the storage structure of database.
- CREATE: used to create new tables.
- ALTER: used to change the structure of the database table.
This statement can add up additional column, drop existing,and even change the data type of columns ivolved in a d/b table. - DROP:Used to delete tables from database.
- RENAME:used to rename a table.
2.DML(Data Manipulation Language):Used for the manipulation with d/b objects. It is used to query the databases for information retrieval.
1.SELECT: used to retrieve data from a database.
2. INSERT: used to insert data into a table.
3. UPDATE:Used to update in the table.
4. DELETE:used to delete all records from the table.
3.DCL(Data Control Language):It is used to assign the security levels in the database,which involves multiple ser setups.
They are used to grant defined role and access privileges to the users.
1.GRANT:used to give access privilege of d/b to user.
2.REVOKE:used to withdraw access privileges given with grant command.
4.TCL(Transaction Control Language):It is used for controlling the transactions in a database system.
1.COMMIT:used to save the work done.
2.SAVEPOINT:used to identify a point in a transaction in which you can later rollback
3.ROLLBACK:used to restore database to its original since the last commit.
4.SET TRANSACTION:establishes properties for the current transactions.