Monday, May 10, 2010

SQL Vs PL-SQL : Actual difference

.
SQL is a data oriented language for selecting and manipulating sets of data. PL/SQL is a procedural language to create applications.

Normally, you don't have a "SQL application". You normally have an application that uses SQL and a relational database on the back-end. PL/SQL can be the application language just like Java or PHP can. SQL may be the source of data for your screens, web pages and reports. PL/SQL might be the language you use to build, format and display those screens, web pages and reports.

Think of it like this: The code that makes your program function is PL/SQL. The code that manipulates the data is SQL DML. The code that creates stored database objects is SQL DDL. DDL compiles the code that is written in PL/SQL. PL/SQL may call SQL to perform data manipulation. The commands that format the output of a tool are not related to the SQL standard or to PL/SQL.

-- SQL is a data oriented language for selecting and manipulating sets of data.
-- PL/SQL is a procedural language to create applications.

-- PL/SQL can be the application language just like Java or PHP can. PL/SQL might be the language we use to build, format and display those screens, web pages and reports.
-- SQL may be the source of data for our screens, web pages and reports.

-- SQL is executed one statement at a time.
-- PL/SQL is executed as a block of code.

-- SQL tells the database what to do (declarative), not how to do it.
-- In contrast, PL/SQL tell the database how to do things (procedural).

-- SQL is used to code queries, DML and DDL statements.
-- PL/SQL is used to code program blocks, triggers, functions, procedures and packages.

-- We can embed SQL in a PL/SQL program
-- but we cannot embed PL/SQL within a SQL statement.

-- SQL is a language that is used by relational database technologies such as Oracle, Microsoft Access, and Sybase etc.
-- PL/SQL is commonly used to write data-centric programs to manipulate data in an Oracle database. PL/SQL language includes object oriented programming techniques such as encapsulation, function overloading, and information hiding.

1 comment:

Unknown said...

wonderful piece of information, I had come to know about your blog from my friend Nandu , Hyderabad, I have read at least 7 posts of yours by now, and let me tell you, your website gives the best and the most interesting information. This is just the kind of information that I had been looking for, I'm already your RSS reader now and I would regularly watch out for the new posts, once again hats off to you! Thanks a ton once again, Regards, sql and plsql difference