This Presentation is about Oracle Database.
In Oracle Database we have different types of Languages.
In This Presentation We have discussed Data Manipulation Language, Data Defination Language and Data Control Language In the Oracle.
2. DDL
• SCHEMA
– A database schema is the skeleton structure that
represents the logical view of the entire database. It
defines how the data is organized and how the
relations among them are associated.
• DATA DEFINATION LANGUAGE
– Are collection of those statements which are DIRECTLY
related to database Schema
• DDL STATEMENTS ARE
– CREATE, ALTER, DROP, REPLACE AND TRUNCATE
3. CREATE
• Used To Create Objects Like
– CREATE TABLE
– CREATE FUNCTION
– CREATE VIEW
– Etc.
CREATE TABLE STUDENT
(
STDROLLNO number(5) primary key,
NAME varchar2(20),
CAST varchar2(20)
);
STDROLLNO NAME CAST
4. ALTER
• Use to Alter Objects like
– ALTER TABLE
– ALTER USER
– ALTER DATABASE
ALTER TABLE STUDENT ADD
(
ADDRESS NVARCHAR2(50)
);
STDROLLNO NAME CASTSTDROLLNO NAME CAST ADDRESS
5. DROP
• Use to Drop Objects like
– DROP TABLE
– DROP USER
– DROP FUNCTION
– Etc
CREATE TABLE EXTRA
(
NUM number(5) primary key,
NAME nvarchar2(20)
);
NUM NAME
DROP TABLE EXTRA;
6. REPLACE
• Use to Rename table names.
RENAME STUDENT TO STUDENTS;
STDROLLNO NAME CAST ADDRESS
8. DML
• Data manipulation language (DML)
• Are the statements query and manipulate
data in existing schema objects.
– INSERT
– UPDATE
– DELETE
9. INSERT
• Insert into STUDENTS values (3,’Atif’,’Bhatti’,’UK’);
• Insert into STUDENTS values
(13,’Ahsan’,’Khanzada’,’SK’);
STDROLLNO NAME CAST ADDRESS
3 Atif Bhatti UK
13 Ahsan Khanzada SK
10. UPDATE
• USED TO MODIFY DATA IN DB
– UPDATE STUDENTS SET ADDRESS=‘NAWABSHAH’
WHERE NAME=‘Atif”;
STDROLLNO NAME CAST ADDRESS
3 Atif Bhatti UK
13 Ahsan Khanzada SK
STDROLLNO NAME CAST ADDRESS
3 Atif Bhatti Nawabshah
13 Ahsan Khanzada SK
11. DELETE
• Use the DELETE statement to delete the rows
from existing tables which are in your schema
or if you have DELETE privilege on them.
• DELETE STUDENTS WHERE NAME=‘Ahsan’;
STDROLLNO NAME CAST ADDRESS
3 Atif Bhatti Nawabshah
13 Ahsan Khanzada SK
12. DCL
• Data Control Language (DCL) Statements
– Data Control Language Statements are used to
grant privileges on tables, views, procedures to
other users or roles.
– The DCL statements are
• GRANK
• REVOKE
13. GRANT
• Use to grant privileges to other users or roles.
• grant select, update, insert on STUDENTS to
David;
14. REVOKE
• Use to take back privileges granted to other
users and roles.
• revoke select, update, insert on emp from
David;