Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
9Activity
0 of .
Results for:
No results containing your search query
P. 1
SQL server

SQL server

Ratings: (0)|Views: 68 |Likes:
Published by akash raj81

More info:

Published by: akash raj81 on Aug 24, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

01/10/2013

pdf

text

original

 
SQL SERVER 2005 Study Material
 
Languages:DML
DML is abbreviation of Data Manipulation Language. It is used to retrieve, store,modify, delete, insert and update data in database.
SELECT
– Retrieves data from a table
INSERT
- Inserts data into a table
UPDATE
– Updates existing data into a table
DELETE
– Deletes all records from a table
DDL
DDL is abbreviation of Data Definition Language. It is used to create and modify thestructure of database objects in database.
CREATE
– Creates objects in the database
 ALTER 
– Alters objects of the database
DROP
– Deletes objects of the database
TRUNCATE
– Deletes all records from a table and resets table identity to initialvalue.
DCL
DCL is abbreviation of Data Control Language. It is used to create roles, permissions,and referential integrity as well it is used to control access to database by securingit.
GRANT
– Gives user’s access privileges to database
REVOKE
– Withdraws user’s access privileges to database given with the GRANT command
TCL
TCL is abbreviation of Transactional Control Language. It is used to manage differenttransactions occurring within a database.COMMIT – Saves work done in transactionsROLLBACK – Restores database to original state since the last COMMIT command intransactionsSAVE TRANSACTION – Sets a savepoint within a transaction
CREATE Statement:Syntax:
CREATE TABLE table_name(column_name1 data_type,column_name2 data_type,column_name3 data_type,....)
Example:
CREATE TABLE Persons(
 
P_Id int,LastName varchar(255),FirstName varchar(255),Address varchar(255),City varchar(255))
INSERT Statement:Syntax:
The first form doesn't specify the column names where the data will be inserted, onlytheir valuesINSERT INTO table_nameVALUES (value1, value2, value3,...)The second form specifies both the column names and the values to be inserted:
INSERT INTO table_name (column1, column2, column3,...)VALUES (value1, value2, value3,...)
Example:
INSERT INTO PersonsVALUES (4,'Nilsen', 'Johan', 'Bakken 2', 'Stavanger')
Insert Data Only in Specified Columns:
INSERT INTO Persons (P_Id, LastName, FirstName)VALUES (5, 'Tjessem', 'Jakob')
INSERT INTO SELECT :Syntax:
INSERT INTO "table1" ("column1", "column2", ...)SELECT "column3", "column4", ...FROM "table2"
SELECT INTO Statement:Syntax:
SELECT *INTO new_table_name [IN externaldatabase]FROM old_tablename
The UPDATE Statement:
The UPDATE statement is used to update existing records in a table.
SQL UPDATE Syntax:
UPDATE table_nameSET column1=value, column2=value2,...WHERE some_column=some_value
Example:
UPDATE PersonsSET Address='Nissestien 67', City='Sandnes'WHERE LastName='Tjessem' AND FirstName='Jakob'
The DELETE Statement

Activity (9)

You've already reviewed this. Edit your review.
1 hundred reads
sajithanazer liked this
lkwier liked this
sxurdc liked this
sxurdc liked this
lrobo liked this
yadav123456 liked this
Kopal Agarwal liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->