Sql Server Language :- TSQL

SQL Server Tools :-

  1. SSMS
  2. SSBIDS
  3. SQL Server Profiles
  4. DB Tuning Advisor.

Transact-SQL (T-SQL):

User a TSQL a SQL Server DataBase 

  • TSQL is a language used to communicate with SQL Server.
  • TSQL is based on SQL language.
  • SQL is introduced by IBM and internal name of that language [SQL]is called “SEQUEL” and later re-named to “SQL”.

SQL   :-  (Structure query language)

User communicates with DB server by submitting in structure is called “queries”.

SQL follows ANSI, ISO standards:

  1. SQL server – RDBMS
  2. ORACLE – RDBMS product
  3. TSQL – RDBMS LANG
  4. SQL – RDBMS LANG.

SQL is common to all rdbms

  • QBE and QUEL are languages for rdbms Mysql
  • QBE- Query by example- which is used in ms access
  • QUEL-query language

Which are not standardized, so sql is popular

Depends on operators performed over database so sql is categorized in following sub-languages.

  • DDL [data definition language]
  • DML [data manipulation language]
  • DRL [data  retrieval language]
  • TCL [transaction control language]
  • DCL [data control language]

DDL :

  • Used to define data.

Example:      Empno         Ename         Sal        Data defination

                                1                    XX            1000         Data

It is a set of command to perform operation over data definition.

  • Create ->To create data definition
  • Alter->To modify data definition
  • Drop->To remove data definition
  • Truncate->To empty the table

Note    :  Data definition exits without data but not vice versa.

DML    :

DML are set of commands to perform operators or data.

  • Insert->To insert data.
  • Update->To modify data.
  • Delete->To delete data.
  • Merge [from 2008]

It is also called [upsent]

  • It is combination of insertupdate.

DRL:

It is a set of command to retrieve data from db.

  • SELECT

TCL  :

Set of commands to process transaction.

  • Commit->To Save transactions.
  • ROLLBACK->To cancel Transaction
  • Save Transaction->To cancel part of transaction.

DCL    :

Set of commands to control data (or)to provide security.

  • GRANT->To give permission to users.
  • REVOKE->To take back the permission for user
  • DENY