MAP

differences between sql & plsql


DIFFERENCES

Sql
Plsql
SQL stands for Structured Query
Language, which does not have
procedural programming
capability.

PL/SQL stands for Procedural
Structured Query Language.
Which have advantage over SQL.
SQL is the language that enables
relational database users to
communicate with the database in
a straightforward manner.

PL/SQL is Oracle's procedural
Language it comprises the
Standard language of SQL and a
Wide array of commands that
Enable you to control the
Execution of SQL statements
According to different conditions.

You can use SQL commands to
query the database and modify
tables within the database.

PL/SQL can also handle runtime
Errors.
No Programming flexibility
available with SQL.
Programmers can divide functions
into logical blocks of code. Modular
programming techniques support
flexibility during the application
development.



Implicit cursor
Explicit Cursor
If  the oracle engine for its internal processing has opened a cursor they are known as IMPLICIT CURSOR.
A cursor defined by user for processing data is known as EXPLICIT CURSOR.
In implicit cursor there is no need to open, fetch and close the cursor it is implicitly maintained by oracle engine.
While in explicit cursor we have to open, close and fetch the data of an cursor.
In implicit cursor when a attributes are used they are used with ‘sql’ keyword.
Ex: -sql%isopen
While in explicit cursor a cursor name is appended to the attribute name when referencing the attribute.
Ex: - c_emp%isopen.
In implicit cursor sql%isopen always evaluates to be false because oracle engine automatically maintains it.
While in explicit cursor if cursor is open it evaluates to be true otherwise false.


Functions

Procedures

A function must return a value back to the caller.
A multiple values can be passed to the caller.
In function only one type of mode is available.
i.e. IN
While in procedure three types of mode are available.
i.e. IN,OUT,INOUT.
In function for returning the value ‘return’ keyword is used.
While in procedure there is no need to use such keyword for returning the values.

Primary Key
Foreign Key
The field on which primary key is given allows unique values only.
While the field on which foreign key is given no such restriction is their.
The field on which primary key is given does not allow NULL values.
While foreign key allows NULL values.
Primary key constraint is independent.
Foreign is dependent on  a table on which primary key is given.
We can’t delete a record from a master table on which primary key is given if that record is available in child table.
We can delete a record from a table on which foreign key is given.
In primary key there is no need to provide references.
In foreign key references are to be provided.
So it is known as referential integrity constraint.

In

Out

In mode is available in functions and procedure.
While out mode is available in procedure.
In mode is used to pass data into function or procedure from calling block.
Out mode is used to return the values from procedure to calling block.
In is the default mode.
OUT is not default.It must be specified explicitly.


TOP:4 Difference between DBMS v/s RDBMS



DBMS

RDBMS



The concept of relationships
is missing in a DBMS. If it
exists it is very less.
It is based on the concept
of relationships.



Speed of operation is very
slow.


Speed of operation is very
fast.


Hardware and software

requirements are less.
Hardware and software
requirements are high.





Facilities and Utilities
offered are limited.

Facilities and Utilities
offered are many.


Platform is used is normally
DOS

Platform used can by any
DOS, UNIX, VAX,VMS etc.


Uses concept of a file.
 Uses concept of a table.


DBMS normally use a 3GL.
RDBMS normally use a 4GL.


Examples are dBASE,
FOXBASE etc.
Examples are ORACLE,
INGERS etc.





0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More