Professional Documents
Culture Documents
CCP505
CCP505
ANDHRA PRADESH
Name : K.Chandra Sekhar
Designation : Associate Lecturer
Branch : DCCP
Institute : Central Institute of Commerce,Tarnaka,
Hyd.
Year/Semester : V Semester
Subject : Relational Database Management System
Subject Code : CCP-505
Topic : Know the components of SQL
Duration : 50 Minutes
Sub-Topic : Write statements using the SQL Commands
Teaching Aids : PPT,Animation, Photographs
CCP505.37TO38 1
OBJECTIVES
On Completion of this period, you would be
able to know :
CCP505.37TO38 2
RECAP
Components of SQL
Various components of SQL with syntax
Various data types
CCP505.37TO38 3
Introduction
What are data types
What are SQL commands
Usage of commands taking sample databases
CCP505.37TO38 4
SAMPLE DATA BASE
Data Base Name : STUDENT Table Name : STD_PER_DETAILS
Fig 1
CCP505.37TO38 5
SAMPLE DATA BASE
Data Base Name : STUDENT Table Name : STD_RESULTS
Fig 2 CCP505.37TO38 6
Structure of STUDENT Database Tables
Table Name : STD_PER_DETAILS
CCP505.37TO38 7
Structure of STUDENT Database
Tables
CCP505.37TO38 9
CREATING TABLE STD_RESULTS
sub5mark number(3));
CCP505.37TO38 10
ALTERING TABLESTD_PER_DETAILS
ALTER TABLE STD_PER_DETAILS
MODIFY
(region char(5));
CCP505.37TO38 11
ALTERING TABLE STD_PER_DETAILS
ADD
phone number(15);
CCP505.37TO38 12
DROPPING TABLES
CCP505.37TO38 13
INSERTing row(s) into STD-PER-DETAILS
VALUES (1001,1008,’K.H.Siddesh’,’K.Ch.Sekhar’),
‘M’, to_date(‘8/7/1992’),’OC’,’AU’);
CCP505.37TO38 14
INSERTing row (s) into STD-RESULTS
VALUES (1,’06049-CCP-014’,’K.H.Siddesh’,
CCP505.37TO38 15
UPDATE TABLES
UPDATE STD_PER_DETAILS
UPDATE STD_RESULTS
CCP505.37TO38 16
DELETE RECORDS IN TABLES
WHERE rollno = 1;
CCP505.37TO38 17
COMMIT
SQL> COMMIT ;
CCP505.37TO38 18
ROLLBACK
SQL> ROLLBACK ;
CCP505.37TO38 19
SAVEPOINT
SQL> SAVEPOINT step3;
CCP505.37TO38 20
Summary
CCP505.37TO38 21
Quiz
1. Which is a DCL command
Select
Create
Commit
None of the above
Answer is : Commit
CCP505.37TO38 22
Frequently asked questions
1. Explain with syntax the following commands
a) Create
b) Insert
c) Update
d) Delete
CCP505.37TO38 23
Assignment
1. Create a Table with the following fields Empno,
Ename,Designation, Address .
CCP505.37TO38 24