比较类似术语之间的差异

Difference Between

家 / Technology / IT / Database /Difference Between SQL and PL SQL

Difference Between SQL and PL SQL

January 2, 2011Posted byAndrew

SQL vs PL SQL

SQL (Structured Query Language) is the standard language to write entry relational databases. SQL is simple statements, which allows to retrieve, insert, delete, update records as user needs. Simply it is data oriented language for selecting and manipulating set of data. PL SQL (Procedural Language/Structured Query Language) is a procedural extension language for data entry and manipulation by Oracle.

“ PL/SQL是SQL的Oracle的程序扩展,是一种高级的第四代编程语言(4GL)。它提供了现代功能,例如数据封装,过载,收集类型,异常处理和信息隐藏。PL/SQL还提供无缝的SQL访问,与Oracle服务器和工具,可移植性和安全性紧密集成。”

SQL

Structured query language (SQL) pronounced as “sequel” is a database computer language designed for managing data in relational database management systems (RDBMS), and originally based upon relational algebra.

Basic scope of SQL is to insert data and perform update, delete, schema creation, schema modification and data access control against databases.

SQL has elements, sub-divided into the followings:

Queries– Retrieve data, based on specific criteria. There are few keywords which can be used in queries. (Select, From, Where, Having, Group by and order by)

e.g: SELECT * FROM table1 WHERE column1 > condition ORDER BY column2;

语句– That may control transactions, program flow, connections, sessions, or diagnostics

Expressions– That can produce either;

Scalar values

Tables consisting of columns and rows of data

Predicates- 指定可以评估为SQL布尔值的条件

条款– Constituent components of statements and queries

PL/SQL

PL/SQL(Procedural Language/Structured Query Language) is Oracle Corporation’s procedural extension language for SQL and the Oracle relational database. PL/SQL supports variables, conditions, loops, arrays, exceptions. PL/SQL essentially code containers can be complied in to the oracle databases. Software developers can therefore implant PL/SQL units of functionality into the database straight.

PL/SQLprogram units can be defined as follows:

Anonymous blocks

构成最简单的PL/SQL代码的基础

Functions

函数是一组SQL和PL / SQL的状态ments. Functions execute a task and should return a value to the calling environment.

Procedures

Procedures are alike to Functions. Procedures also can be executed to perform work. Procedures cannot be used in a SQL statement, can return multiple values. In addition, functions can be called from SQL, while procedures cannot.

Packages

Use of packages is re-using of code. Packages are groups of theoretically linked Functions, Procedures, Variable, PL/SQL table and record TYPE statements, Constants & Cursors etc… Packages usually have two parts, a specification and a body

Two advantages of packages include:

模块化方法,业务逻辑的封装

Using packages variables can declare in session levels

PL/SQL中的变量类型

变量

Numeric variables

Character variables

Date variables

特定列的数据类型

Difference between SQL and PL/SQL

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

SQL executes one statement at a time whereas in PL SQL block of code could be executed.

SQL is declarative where as PL SQL is procedural.

SQL is used to write Queries, Data Manipulation Language (DML) and Data Definition Language (DDL) whereas PL SQL is used to write Program blocks, Triggers, Functions, Procedures, and Packages.

回顾:

SQL is structured query language. In SQL various queries are used to handle the database in a simplified manner. PL/SQL is procedural language contains various types of variable, functions and procedures. SQL allows developer to issue single query or execute single insert/update/delete at a time, while PL/SQL allows writing complete program to get done several selects/inserts/updates/deletes at a time. SQL is simple data oriented language while PL/SQL programming language.

Related posts:

Difference Between MS SQL Server 2008 and 2008 R2

Filed Under:Database标记为:光标,数据库,Oracle,PL SQL,RDBMS,SQL,Triggers

About the Author:Andrew

注释

  1. Venky说

    November 21, 2012 at 5:51 am

    ya ur correct

    Reply
  2. 拉杰什·亚达夫(Rajesh Yadav)说

    December 22, 2012 at 8:11 am

    thanks .. d difference is good as needed

    Reply
  3. rajesh rana说

    2013年4月25日上午6:25

    很好,清楚地理解.. thanx…

    Reply
  4. anuradha说

    July 8, 2014 at 6:36 am

    我可以知道内联视图和正常视图之间的区别,并带有输出的示例代码示例

    Reply
  5. Venky Honey说

    2015年4月30日下午12:29

    极好的

    Reply
  6. Venky Honey说

    April 30, 2015 at 12:33 pm

    thnkq

    Reply
  7. amit goswami说

    April 27, 2017 at 3:55 pm

    good difference and perfect points

    Reply

发表评论取消回复

Your email address will not be published.Required fields are marked*

请求文章

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

冠状病毒和SARS之间的差异

冠状病毒和SARS之间的差异

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

你可能喜欢

Difference Between Apothecium and Cleistothecia

Difference Between Apothecium and Cleistothecia

Difference Between HTC Rhyme and HTC Droid Incredible 2

Difference Between Character and Charisma

Difference Between Character and Charisma

Difference Between North America and USA

依赖人群和生产率之间的差异

依赖人群和生产率之间的差异

Latest Posts

  • What is the Difference Between Depression and Schizophrenia
  • 分子几何和电子几何形状有什么区别
  • What is the Difference Between 2B and HB Pencil
  • 下丘脑和垂体有什么区别
  • What is the Difference Between Graphite and Lead
  • What is the Difference Between Symptom and Syndrome
  • 家
  • Vacancies
  • About
  • 请求文章
  • 联系我们

Copyright © 2010-2018Difference Between. All rights reserved.Terms of Use和隐私政策:合法的.