1 / 3

The difference between Oracle, SQL and PL_SQL

Sudha, thanks for the comments. I'd love to hear your thoughts. And your question is a common one, so I thought I would address it as a blog entry instead of a reply to your comment. I'm going to expand on it a little bit also. I

digital167
Download Presentation

The difference between Oracle, SQL and PL_SQL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The difference between Oracle, SQL and PL/SQL Sudha, thanks for the comments. I love to hear feedback. And your question is a common one so I thought I would address it as a blog entry instead of a reply to your comment. I'm going to expand on it a little bit also. In addition to SQL and PL/SQL, I hear people refer to SQL commands so I am going to address the question: What is the difference between SQL, SQL Commands, andPL/SQL What is Oracle? I cover this answer in the entry, Learn Oracle - What is Oracle?. I also cover SQL and PL/SQL very briefly in that article. I'll try to be a little more explicit in thisentry. What isSQL? SQL is the Structured Query Language. Actually, I think I covered SQL pretty nicely in the article Sudhat commented on, Intro to basicSQL. I'll just add that SQL is composed of DML and DDL. DML are the keywords you use to access and manipulate data, hence the name Data Manipulation Language. DDL are the keywords you use to create objects such as views, tables and procedures, hence the name Data Definition Language. Examples of DML are SELECT, UPDATE, INSERT, MERGE, DELETE, etc. Examples of DDL are CREATE TABLE, ALTER VIEW, CREATE OR REPLACE PROCEDURE, etc. What are SQL Commands? SQL commands are commands that aren't actually a part of the SQL standard but are supported by the tools that support SQL. For example, SQL*Plus has been arounda long time and many tools that allow scripting also allow SQL*Plus commands. When someone asks me about a SQL command, I first clarify if the mean a SQL keyword or a SQL*Plus (or some other tool)command. SQL commands are usually meant to help format output: BREAK, BTITLE, COLUMN, PRINT or they are meant to create or store data or scripts: COMPUTE,DEFINE, STORE, SAVE. There are also commands that interact with thedatabase:

  2. SHUTDOWN, CONNECT, COPY. And there is at least one that interacts with data: XQUERY. So when you hear someone refer to a SQL command, first ask if they really mean SQL or if they mean the SQL tool they are using What isPL/SQL? he quick answers is from the PL/SQL UserGuide: PL/SQL, Oracle's procedural extension of SQL, is an advanced fourth-generation programming language (4GL). It offers software-engineering features such as data encapsulation, overloading, collection types, exceptions, and informationhiding. PL/SQL also supports rapid prototyping and development through tight integration with SQL and the Oracle database. But what does that mean? The key here are the words: procedural extension of SQL. PL/SQL is a procedural language like C++, Java, ADA, etc. If has variables and variable declarations, conditional controls like IF and CASE. It has looping structures such as LOOP, FOR LOOP and the WHILE LOOP. PL/SQL uses SQL to use, manipulate and save data to thedatabase. If I wanted to create my own, very short, definition of PL/SQL it would be this: PL/SQL is the Oracle native programming language that provides database-centric application development. It can natively call static SQL and providesmultiple methods of calling dynamic SQL. What is the difference between SQL andPL/SQL? SQL is a data oriented language for selecting and manipulating sets of data. PL/SQL is a procedural language to create applications. You don't normally have a "SQL application". You normally have an application that uses SQL and arelational 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 andreports.

  3. 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 toPL/SQL. I hope that clears it up some! In the next few days, I am going to repost a couple of articles I wrote last year on basic SQL syntax. I already posted part 1 here (and that was the post that Sudhat was commenting to). I figure to complete the set, I'll post the other two and if they get a decent response, I may continue theseries.

More Related