Sql has been sub categorized into 5 sub languages
1 DDL (Data Defination Language)
It deals with the structure of objects that are present in the databas.it provides four commands in it
Create
Alter
Drop
Truncate
2.DML (Data Menupulation Language)
This language deals with the data that is present in the database. It provide following three commands in it.
Insert
Update
Delete
3.DQL (Data Query Language)
It is used for etreving information from database.Which provides a single command Select
4.DCL (Data Control language)
It provide the following commands
Grant
Revoke
Deny
5.TCL (Transation Control Language)
This language deals with the transaction management.Which contain following commands
Commit
Rollback
Save
Note:- A transation is the set of statements which tells all the statements should execute or none of the statement should execute to control this we require Transaction Control Language.
Sql Server is Collection of databases which is internally collection of Tabels,Views,Procedures,Function ,Triggers etc...
Database are of Two types
System Database
User Database
System Database These database are created and maintained by sql server for its Functionality
By Default when sql server is installed we get the following System Databases
Master
Model
MSDB
TempDB
user Database These Databases are created and Maintaind by users of sql server for storing there owm database objects.
Uses of System Databases
Master:- This database record all the system level operations that get perform on sqlserver.
Model:- Its acts as a template for every new database that getts create in sqlserver
whenever we create database a copy of the model is taken and create a database with new name.
TempDB:- This database is provides an options known as temparory objects which can be created on any database.When these objects are created sql server holds the objects in the tempdb but not the on the database where it was created because a temparory object required to be destroyed whenever sqlserver is shuting down it will drop or destroy complete TempDB database so that all the temparory object is destroyed,Whenever sql server is started it recreate TempDB database again by using The Model as a Template.
MSDB:- This databsa ei used for storing the information of objects like Job,Alert,Schedule
Job:- Job is an activity which has to be performe
Alerts:- It is a message given to the user on some conditional basis
Schedule;- it specifys the time period when job has performed.
Every Database is collection of two file in it
.mdf (Master Database File) It contain the actual information about database i.e. Matadata
.ldf (Log Database File) It contain the transation Information i.e.DML statements information
Syntex for create database
create database <databaseName>
e.g. Create database Student
No comments:
Post a Comment