Oracle Quick Guides: Part 3 - Coding in Oracle: SQL and PL/SQL
()
About this ebook
This is Part 3 of a series of quick learning guides for Oracle designers, developers and managers. Part 3 introduces completely new entrants to the main concepts of the SQL language and to the use and development of Oracle's PL/SQL procedural version of SQL.
The guide includes details of how to install and use a SQL*Plus client and the basic use of Oracle's SQL Developer tool. The guide also provides a foundation in coding practise in SQL and PL/SQL with some basic guidelines for good practise in coding and managing SQL and PL/SQL software performance issues. Part 3 also contains a glossary of Oracle terminology related to SQL and PL/SQL with clear explanations of the terms used.
These guides are designed to rapidly deliver key information about Oracle to the following audience groups:
- Project Managers, Team Leaders, and Testers who are new to Oracle and need rapid access to strategic information about the Oracle development environment.
- Business Analysts, Designers and Software developers who are new to Oracle and need to make a first step in gaining a detailed understanding of the design and development issues involved in Oracle.
Part 3 assumes that the reader has read Parts 1 and 2 of the Oracle Quick Guides or their equivalent content. The contents of Part 3 include the following subject headings:
1. What are SQL, SQL*Plus and PL/SQL?
2. Basic Components of SQL.
3. Basic SQL Language Syntax.
3.1 SQL Language Elements.
3.2 SQL Operators
3.3 SQL Expressions
3.4 SQL Functions
3.5 SQL Clauses
3.6 SQL Query syntax.
3.7 SQL Data Modification Language syntax (DML).
3.8 SQL Data Definition Language syntax (DDL).
3.9 SQL Data Command Language syntax (DCL).
3.10 SQL Data Types in Oracle
4. Complex SQL constructs: Understanding Joins.
5. Understanding Commit and Rollback.
6. Basic architecture PL/SQL Procedures, Functions and Triggers.
7. Basic PL/SQL Language syntax.
8. PL/SQL Exception handling.
9. SQL and PL/SQL: some standards for good coding appearance.
10. Performance issues when coding in SQL
11. Installing and using a SQL*Plus client
12. SQL - PL/SQL Development Tools
13. Glossary of Terms.
Malcolm Coxall
Malcolm Coxall is a management consultant, systems analyst, organic farmer and author, with more than 30 years experience working for many of the world's largest corporate and institutional organisations, starting in the field of dispute arbitration for the ILO. These experiences have provided him a ringside view of the management methodologies used by medium and large businesses in areas as diverse as banking, oil, defence, telecoms, insurance, manufacturing, mining, food, agriculture, aerospace, textiles, and heavy engineering. Malcolm has published articles on political science, sociology, human design, sustainable agriculture, organic food production, technology in organic farming, biodiversity, forest management, environmental protection and environmental economics. He is active in European environmental politics and was a successful private complainant in the European Court of Justice in several cases of national breaches of European environmental law. He now lives in Southern Spain from where he continues his IT and system consultancy work, writing and managing the family's organic olive farm.
Read more from Malcolm Coxall
Human Manipulation: A Handbook Rating: 0 out of 5 stars0 ratingsMachiavellian Management: A Chief Executive's Guide Rating: 0 out of 5 stars0 ratingsEthical Eating: A Complete Guide to Sustainable Food Rating: 0 out of 5 stars0 ratingsCivil Disobedience: A Practical Guide Rating: 1 out of 5 stars1/5
Related to Oracle Quick Guides
Titles in the series (4)
Oracle Quick Guides: Part 1 - Oracle Basics: Database and Tools Rating: 0 out of 5 stars0 ratingsOracle Quick Guides: Part 2 - Oracle Database Design Rating: 0 out of 5 stars0 ratingsOracle Quick Guides: Part 3 - Coding in Oracle: SQL and PL/SQL Rating: 0 out of 5 stars0 ratingsOracle Quick Guides: Part 4 - Oracle Administration: Security and Privilege Rating: 0 out of 5 stars0 ratings
Related ebooks
Oracle Quick Guides: Part 1 - Oracle Basics: Database and Tools Rating: 0 out of 5 stars0 ratingsORACLE PL/SQL Interview Questions You'll Most Likely Be Asked Rating: 5 out of 5 stars5/5Oracle Quick Guides: Part 2 - Oracle Database Design Rating: 0 out of 5 stars0 ratingsMastering PL/SQL Through Illustrations: From Learning Fundamentals to Developing Efficient PL/SQL Blocks (English Edition) Rating: 0 out of 5 stars0 ratingsOracle Database 12c Quickstart Rating: 5 out of 5 stars5/5Oracle Quick Guides: Part 4 - Oracle Administration: Security and Privilege Rating: 0 out of 5 stars0 ratingsOracle SQL In 10 Minutes Rating: 5 out of 5 stars5/5Concise Oracle Database For People Who Has No Time Rating: 0 out of 5 stars0 ratingsIntroduction to Oracle Database Administration Rating: 5 out of 5 stars5/5SQL Tutorial For Beginners Rating: 0 out of 5 stars0 ratingsOracle SQL Developer Rating: 0 out of 5 stars0 ratingsSQL Server: Tips and Tricks - 1 Rating: 5 out of 5 stars5/5SQL Interview Questions: A complete question bank to crack your ANN SQL interview with real-time examples Rating: 0 out of 5 stars0 ratingsOracle APEX Tips and Tricks Rating: 0 out of 5 stars0 ratingsQuerying Databricks with Spark SQL: Leverage SQL to query and analyze Big Data for insights (English Edition) Rating: 0 out of 5 stars0 ratingsLearn SQL in 24 Hours Rating: 5 out of 5 stars5/5Learn SQL with MySQL: Retrieve and Manipulate Data Using SQL Commands with Ease Rating: 0 out of 5 stars0 ratingsSQL Server Interview Questions You'll Most Likely Be Asked Rating: 0 out of 5 stars0 ratingsPractical Oracle Cloud Infrastructure: Infrastructure as a Service, Autonomous Database, Managed Kubernetes, and Serverless Rating: 0 out of 5 stars0 ratingsOracle Information Integration, Migration, and Consolidation Rating: 0 out of 5 stars0 ratingsOracle APEX Best Practices Rating: 0 out of 5 stars0 ratingsBeginning Oracle Application Express Rating: 0 out of 5 stars0 ratingsOracle APEX Reporting Tips & Tricks Rating: 2 out of 5 stars2/5Simply SQL: The Fun and Easy Way to Learn Best-Practice SQL Rating: 4 out of 5 stars4/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5Learn SQLite in 24 Hours Rating: 0 out of 5 stars0 ratingsJava Programming Rating: 0 out of 5 stars0 ratings
Programming For You
Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsHTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5C Programming For Beginners: The Simple Guide to Learning C Programming Language Fast! Rating: 5 out of 5 stars5/5JavaScript All-in-One For Dummies Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Python QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsBeginning Programming with C++ For Dummies Rating: 4 out of 5 stars4/5HTML in 30 Pages Rating: 5 out of 5 stars5/5Programming Arduino: Getting Started with Sketches Rating: 4 out of 5 stars4/5Coding with JavaScript For Dummies Rating: 0 out of 5 stars0 ratingsC# Programming from Zero to Proficiency (Beginner): C# from Zero to Proficiency, #2 Rating: 0 out of 5 stars0 ratings
Reviews for Oracle Quick Guides
0 ratings0 reviews
Book preview
Oracle Quick Guides - Malcolm Coxall
Oracle Quick Guides - Part 3 Coding in Oracle:
SQL and PL/SQL
Malcolm Coxall
Edited by Guy Caswell
Published by M.Coxall - Cornelio Books
Copyright 2013 Malcolm Coxall
First Published in Spain , United Kingdom 2013
ISBN : 978-84-940853-8-3
"Space does not exist unless there are objects in it
Nor does time exist without events."
Contents
Preface and Audience .
1. What are SQL, SQL*Plus and PL/ S QL?
2. B a sic C omponents of SQL.
3. Basic SQL Language S yntax.
3.1 SQL Language Elements.
3.2 SQL Operators .
3.3 SQL Expressions .
3.4 SQL Functions .
3.5 SQL Clauses .
3 .6 SQL Query syntax .
3.7 SQL Data M odification Language syntax (DML) .
3.8 SQL Data Definition Language syntax (DDL) .
3.9 SQL Data C ommand Language syntax (DCL) .
3.10 SQL Data Types in Oracle .
4. Complex SQL constructs: Understanding Joins .
5. Understanding Commit and R ollback .
6 . Basic architecture PL/SQL Procedures, Functions and Triggers .
7 . Basic PL/SQL Language syntax .
8 . PL/SQL Exception handling .
9 . SQL and PL/SQL : some standards for good coding appearance .
10 . Performance issues when coding in SQL .
11 . Installing a nd using a SQL*Plus client .
12 . SQL - PL/SQL Development Tools .
13 . Glossary of Terms.
About the Author
Preface and Audience
Oracle Quick Guides: Welcome to Oracle Quick Guides, a series of quick learning guides for Oracle designers, developers and managers.
Guide Audience: These guides are designed to rapidly deliver key information about Oracle to the following audience groups:
- Project Managers, Team Leaders and Testers who are new to Oracle and need rapid access to strategic information about the Oracle development environment.
- Business Analysts, Designers and Software Developers who are new to Oracle and need to make a first step in gaining a detailed understanding of the design and development issues involved in Oracle.
Guide Contents: These guides have been divided by subject matter. They become increasingly complex and more specific the later the volume. Thus, volume 1 is quite general but later volumes are quite technical and specific.
Our Objective: There are plenty of Oracle textbooks and user manuals on the market. Most of them are huge and only partly relevant to a particular group of readers. Therefore, we decided to divide the subject into smaller, more targeted volumes in order that you only get the information YOU need.
For example, a Project Manager doesn't need to know some of the more esoteric programming tips, but will need to know some of the strategic issues affecting design and testing. In a similar way, a Programmer is much more interested in the syntactic details of a piece of software than in the strategic issues affecting the choice of an Oracle upgrade path.
And so we have target ed these guides at particular groups with specific interests whilst try ing to avoid overloading reader s with too much detail or extraneous material.
Assumptions: We assume that the reader will be using Oracle 9i, 10g or 11g, although most of the material will apply equally to earlier versions of the Oracle RDBMS.
1. What are SQL, SQL*Plus and PL/SQL?
SQL stands for Structured Query Language. It is the language most used to communicate with a relational database.
According to ANSI (the American National Standards Institute), SQL is the standard language for relational database management systems. ANSI provides a standard for SQL , which is the basis for many commercial versions of the language.
SQL statements are used to perform fundamental database tasks , such as to enter and update data on a database, or retrieve data from a database. Some common relational database management systems th at use SQL are: Oracle, SQL Server, Access, etc.
Is SQL standard? Yes and No. Although most database systems use SQL, most also have their own additional proprietary extensions that are usually only used on their system s . However, the (ANSI) standard SQL commands such as Select
, Insert
, Update
, Delete
, Create
, and Drop
can be used to accomplish almost everything that o ne needs to do with a database. This means that SQL is very po rtable between database systems , even if you don't happen to be familiar with the local variant of SQL in a different database environment.
How to pronounce SQL? The first version of SQL was in fact called Structured English Query Language
and had the acronym SEQUEL. Due to trademark violations on the acronym, the name was changed to Standard Query Language and abbreviated as SQL. So at first it was intended to be pronounced as SEQUEL
. Nowadays it's a matter of preference. The cognoscenti
tend to call it SEQUEL.
A little history of SQL : SQL was initially developed at IBM by Chamberlin and Boyce during the early 1970s. This original version (initially called SEQUEL ) was designed to manipulate and retrieve data stored in IBM's original quasi-relational database management system known as System R
.
In the late 1970s, Relational Software, Inc. (now Oracle Corporation) saw the potential of the concept s described by Codd, Chamberlin, and Boyce and decided to develop their own SQL-based RDBMS. In June 1979, Relational Software, Inc. introduced the first commercially available implementation of SQL, Oracle V2 (Version2) for VAX computers. Around the same time IBM continued their own development of what later became known as DB2 - their own proprietary relational database - also using SQL.
SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of the International organization for Standards (ISO) in 1987. Since then, the standard has been enhanced several times with added features. But code is not completely portable among different database systems, which can lead to vendor lock-in. The different makers do not perfectly follow the standard, they add extensions, and the standard is sometimes ambiguous. On the other hand, differences in SQL implementations are quite obvious and manageable.
Why is SQL so important? These days SQL is ubiquitous. Although few end-users are aware of what drives most of their daily software systems, generally at the most fundamental level it is almost always SQL , which is the powerhouse of most commercial software applications in current use these days.
So, w henever there is a relational database involved (which is almost always), then the core software will eventually use SQL as the lowest level language for the retrieval and manipulation of data from the database . Whatever layers of software are built on top of a database , such as smart html web front ends, java, .NET etc. , when it comes to interaction with the database it will be small tracts of SQL code that actually insert, extract and manipulate the data at the database level. SQL is the foundation of modern commercial software systems.
SQL and PL/SQL is used in all Oracle application software product s. Oracle Forms and Reports , for example , both rely on SQL , as does Oracle APEX. Oracle Applications are based on software entirely dependent on SQL and PL/SQL. Even Oracle's own utility software systems like Enterprise Manager use SQL to interrogate the Oracle data dictionary.
Therefore, at a software engineering level, an understanding of SQL is immensely important to a fundamental understanding of the design and working of a lot of commonly used commercial software. I t is therefore really worth putting an effort into acquiring a thorough understanding of the SQL language.
What is SQL*Plus? SQL*Plus is basically a working environment for a developer ( or user ) to cr eate and execute SQL commands when using an Oracle database . SQL*Plus is the main interface to an Oracle Database server and it is