Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
211Activity
0 of .
Results for:
No results containing your search query
P. 1
NEW DBMS Lab Manual

NEW DBMS Lab Manual

Ratings:

3.75

(3)
|Views: 30,580|Likes:
Published by raghu46

More info:

Published by: raghu46 on Nov 01, 2008
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

04/26/2013

pdf

text

original

 
 
DATABASE SYSTEMS
LAB MANUAL
2008 – 2009
 
DEPARTMENT OF IT
VASAVI COLLEGE OFENGINEERING
IBRAHIMBAGH, HYDERABD-500 031.
www.vce.ac.in
1
 
Overview of SQL DDL, DML and DCL Commands.
DDL is Data Definition Language statements. Some examples:CREATE - to create objects in the databaseALTER - alters the structure of the databaseDROP - delete objects from the databaseTRUNCATE - remove all records from a table, including all spaces allocated for therecords arremovedCOMMENT - add comments to the data dictionary
 
GRANT - gives user's access privileges to databaseREVOKE - withdraw access privileges given with the GRANT commandDML is Data Manipulation Language statements. Some examples:SELECT - retrieve data from the a databaseINSERT - insert data into a tableUPDATE - updates existing data within a tableDELETE - deletes all records from a table, the space for the records remainCALL - call a PL/SQL or Java subprogramEXPLAIN PLAN - explain access path to dataLOCK TABLE - control concurrencyDCL is Data Control Language statements. Some examples:COMMIT - save work doneSAVEPOINT - identify a point in a transaction to which you can later roll backROLLBACK - restore database to original since the last COMMITSET TRANSACTION - Change transaction options like what rollback segment to use
2
 
Basic SQL DDL Commands. 
To practice basic SQL DDL Commands such as CREATE, DROP, etc.
1. SQL - CREATE TABLE
Syntax: CREATE TABLE tablename (column_name data_ type constraints, …)Example: 
INPUT:
SQL>
CREATE TABLE Emp ( EmpNo short CONSTRAINT PKey PRIMARY KEY,EName VarChar(15), Job Char(10) CONSTRAINT Unik1 UNIQUE,Mgr short CONSTRAINT FKey1 REFERENCES EMP (EmpNo),
 
Hiredate Date, DeptNo short CONSTRAINT FKey2 REFERENCES DEPT(DeptNo));
RESULT:
Table created.SQL>Create table prog20 (pname varchar2(20) not null), doj date not null,dob date not null,sex varchar(1) not null, prof1 varchar(20),prof2 varchar(20),salary number(7,2) not null);
RESULT:
Table created.SQL>desc prog20; Name Null? Type--------------------------------- -------- ----------------------------PNAME NOT NULL VARCHAR2(20)DOJ NOT NULL DATEDOB NOT NULL DATESEX NOT NULL VARCHAR2(1)PROF1 VARCHAR2(20)PROF2 VARCHAR2(20)SALARY NOT NULL NUMBER(7,2)
3

Activity (211)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Ram Prasad K liked this
Hunny Topiwala liked this
Hunny Topiwala liked this
Hunny Topiwala liked this
thanga_sharmi liked this
Hunny Topiwala liked this
mskumar_me liked this
Niranjan Reddy added this note
nice

You're Reading a Free Preview

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