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 or section
Like this
9Activity

Table Of Contents

Physical and logical structuring in Oracle
Difference between RDBMS and DBMS
S.no DBMS RDBMS
Similarities between RDBMS and DBMS
Data Type
Create Table
SQL Select
The Where Clause
The Distinct Keyword
Sorting
Order by Clause
SQL Delete
DROP TABLE
TRUNCATE
SQL Update
alter table:
Rename
Query: rename emp to emp2;
Tab:
Describe:
Arithmetic Functions:
Logical Operators:
Range Searching:
SQL In & Between
Not between
Pattern Matching:
The Like Clause:
ORACLE Table dual
-- AGGREGATE FUNCTIONS:
(i) AVG (Average):
(ii) MIN (Minimum):
(iii) MAX(Maximum):
-- NUMERIC FUNCTIONS:
(i) ABS (Absolute):
(ii)SQRT (Square root)
(iii) POWER:
(iv) ROUND:
(v) Trunc:
(vi) EXTRACT function:
(vii) MOD:
(viii) FLOOR Function:
(ix) CEIL Function:
-- STRING FUNCTIONS:
(i) ASCII:
(ii) UPPER:
(ii) LOWER:
(iii) INITCAP:
(iv) LPAD & RPAD:
--CONVERSION FUNCTIONS:
(i) To_Char:
(ii) To_Number:
(iii) To_Date:
GROUP BY CLAUSE:
HAVING CLAUSE:
JOINS:
-- INNER JOIN:
--Outer Join:
y RIGHT OUTER JOIN:
y FULL OUTER JOIN
UNION and INTERSECT operations
Constraints in SQL
Different Constraints
INDEXES
-- Create Index:
-- Drop index:
VIEWS:
--CREATE VIEW:
Using Views
INTRODUCTION TO PL/SQL
PL/SQL (Procedural Language/Structured Query Language) is Oracle
History
Basic code structure
PL/SQL programs consist of procedures, functions, and anonymous blocks
DECLARE
BEGIN
EXCEPTION
END
Numeric variables
Character variables
Date variables
Difference between SQL and PL/SQL
PL/SQL Execution Environment
Displaying user message on the screen
Set server output on
Conditional Statements
CASE statement can be used with predefined selector:
Looping
LOOP statements
Syntax:
WHILE loops
FOR loops
Cursor FOR loops
Sequential Statements
TRANSACT-SQL (T-SQL)
Syntax: Commit;
Query: If price of product 10 is less than 4000 then change the price to 4000
The price change is to be than recorded to the table oldprice along with
Query: Write a PL/SQL block of code as following:
1. Insert a record in employ2 table
Explicit Cursors
Cursor Attribute Values
%FOUN
%ISOPE
%NOTFOU
%ROWCOU
Next
Declaring a Cursor
Opening a Cursor
Passing Cursor Parameters
Fetching with a Cursor
Closing a Cursor
Implicit Cursors
Using Cursor Attributes
Each cursor or cursor variable has four attributes:
1) %FOUND
2) %ISOPEN
3) %NOTFOUND
4) %ROWCOUNT
IMPLICIT CURSOR HANDLING
SQL%FOUND
In the following example, you use %FOUND to insert a row if a delete
succeeds:
SQL%ISOPEN
SQL%NOTFOUND
SQL%ROWCOUNT
the record is deleted or not using sql%notfound
Program:
records deleted by a delete statement in PL/SQL block
Implicit cursor handling
Query1: Write PL/SQL code to calculate total salary of employee having
Using %type:
Before execution
Query: Write PL/SQL code to calculate total salary of employee having
Using %ROWTYPE:
Methods or steps to perform explicit cursor management
c. Fetch data from cursor into memory variable:
d. Exit from loop
e. Close a cursor:
Using %rowtype:
Cursor for loop
the help of cursor for loop
help of cursor for loop
0 of .
Results for:
No results containing your search query
P. 1
rdbms

rdbms

Ratings: (0)|Views: 757 |Likes:

More info:

Published by: Manpreet Singh Kinra on Nov 06, 2010
Copyright:Attribution Non-commercial

Availability:

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

07/11/2013

pdf

text

original

You're Reading a Free Preview
Pages 4 to 64 are not shown in this preview.
You're Reading a Free Preview
Pages 68 to 79 are not shown in this preview.

Activity (9)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
Ankit Jain liked this
Neeti Singla liked this
Sonia Singla liked this
Girish Sahare liked this
Karan Patel liked this
priya16989 liked this
sachin liked this

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)//-->