Our Ironclad Guarantee
You must be satisfied. Try our print books for 30 days or our eBooks for 14 days. If they aren't the best you've ever used, you can return the books or cancel the eBooks for a prompt refund. No questions asked!
Over the years, Oracle Database has gained a reputation for being expensive and difficult to use. Today, however, you can download a free IDE called SQL Developer that makes it easy to enter, edit, and run SQL and PL/SQL statements. And this book makes it easier than ever to master the SQL and PL/SQL skills for working with an Oracle database.
Go to our instructor's site to learn more about this book and its instructor's materials.
This book is worth its cost just for its detailed and complete description of the SQL SELECT statement. The book takes 4 chapters (129 pages) to cover all aspects of it. I have not found any other book, including Oracle’s own documentation, which more completely describes how to use the SELECT statement."
In this section, you’ll learn the concepts and terms you need for working with any database. You’ll also learn how to use Oracle Database and Oracle SQL Developer to run SQL statements on your own computer.
In this section, you’ll learn all the SQL skills for retrieving data from a database and for adding, updating, and deleting that data. These skills move from the simple to the complex so you won’t have any trouble if you’re new to SQL. But these skills are also sure to raise your expertise even if you already have SQL experience.
Here, you’ll learn how to design a database and how to implement that design by using the DDL (Data Definition Language) statements that are a part of SQL. When you’re done, you’ll be able to design and implement your own database. You’ll also gain valuable perspective that will make you a better SQL programmer, even if you never have to design a database.
In this section, you’ll learn how to use Oracle’s procedure language, PL/SQL, to create stored procedures, functions, and triggers. You’ll also learn how to manage transactions and locking. That will give you a powerful set of PL/SQL skills.
Here, you’ll learn how to work with the timestamp, interval, and large object data types. These data types became available with releases 9i and 8, and they provide features that are critical for storing data in today’s global and digital world.
Like all of our books, you’ll find Murach features in this book that you won’t find in competing books. Here are just a few:
I think it’s fair to say that most developers don’t know enough about SQL and the database management system they’re using. As one customer put it, "I know just enough about SQL to be a little bit dangerous!"
That’s why developers often code SQL statements that don’t perform as efficiently as they ought to. That’s why they aren’t able to code some of the queries that they need for their applications. And that’s why they don’t take advantage of all the power that Oracle Database has to offer.
That’s also why our Oracle SQL book should be required reading for every application programmer who uses Oracle Database. It shows you how to code the SQL and PL/SQL statements that you need for your applications. It shows you how to code these statements so they run efficiently. And it introduces you to many of the most useful advanced features that Oracle has to offer.
This book is also the right first book for anyone who wants to become a database administrator. Although this book doesn’t present all of the advanced skills that are needed by a DBA, it will get you started. Once you’ve finished it, you’ll be prepared for more advanced books on the subject.
This book is also a good choice for anyone who wants to learn standard SQL. Since SQL is a standard language for accessing database data, most of the SQL code in this book will work with any database management system. As a result, once you use this book to learn how to use SQL to work with an Oracle database, you can transfer most of what you have learned to another DBMS such as MySQL, DB2, or Microsoft SQL Server.
Although you will progress through this book more quickly if you have some development experience, everything you need to know about databases and SQL is presented in this book. As a result, you don’t need to have any programming background to use this book.
Since our customers loved the first edition of this book, we added just a few Oracle 12c features to the new edition:
Maybe more important, though, we now include the solutions to the exercises as a download from our website. That’s because the only customer complaints we received for this book were that we didn’t provide the solutions to the exercises.
To run SQL statements with an Oracle database using the techniques in this book, we recommend that you use:
Both of these products can be downloaded for free from Oracle’s website. And appendix A of this book provides complete instructions for installing them.
If you want to use another edition of Oracle Database, like the Personal Edition of 12c, you can still use the techniques described in this book. However, you may need to install that edition, and you may need to use a different procedure to connect SQL Developer to it. That’s why appendix B shows you how to do both.
Unfortunately, you can’t use SQL Developer to connect to versions of Oracle Database that are prior to version 9.2.0.1. So if your company is using an earlier version, one alternative is to use SQL*Plus to work with it as described in chapter 2. A better training alternative, though, is to download and install the Express Edition of Oracle Database and SQL Developer as described in appendix A. Then, when you’re through training, you can use SQL*Plus or a commercial product like Toad to work with the version of Oracle Database that your company uses.
"If you use Oracle as a backend database to your VB, C#, or ASP.NET database applications, then Murach’s Oracle SQL and PL/SQL should be the next addition to your developer library."
- Jeff Manley, a1vbcode.com
"This book is worth its cost just for its detailed and complete description of the SQL SELECT statement. The book takes 4 chapters (129 pages) to cover all aspects of it. I have not found any other book, including Oracle’s own documentation, which more completely describes how to use the SELECT statement."
- Eric Mortensen, North East Ohio Oracle Users Group
"A lifesaver! Got stuck on one of my Oracle 9i assignments and it took just one look in this book and I was all set and ready to take on other assignments. It is really a reliable reference book."
- Posted at an online bookseller
"Although I am primarily a SQL Server programmer, this book explained many of the ‘Oracle’ ways to do the stuff I already do with SQL Server in a manner that I could understand and relate to. I found lots of examples of stuff that I was struggling with in entering into my first large, full-scale Oracle programming projects. It is open daily when I work on Oracle code now."
- Posted at an online bookseller
"Murach books have a reputation for accessibility to the novice user. Murach’s Oracle SQL and PL/SQL is just as accessible to the novice, but also contains plenty to assist other Oracle users.... The result is a book that is great for Oracle novices, but also great for casual intermediate users like myself."
- David O’Meara, JavaRanch.com
"I bought this book to take my SQL skills up a notch or more. This book really does that. It moves from the basics to advanced queries. The advanced queries are very well explained and you get useful skills and understand how to extend this to other queries."
- Posted at an online bookseller
“This book is a must-have for programmers looking to get into data management. It is clear and simple and the examples are easy to understand. All programmers that deal with databases should have this book in their library.”
- Posted at an online bookseller
“Loved the layout. Not long winded; just the facts. The page on the left gives a more indepth explanation. The page on the right gives you the nitty-gritty of what you need to know. I highly recommend the book and will look for Murach's books in the future.”
- Posted at an online bookseller
View the table of contents for this book in a PDF: Table of Contents (PDF)
Click on any chapter title to display or hide its content.
The hardware components of a client/server system
The software components of a client/server system
Other client/server architectures
How a table is organized
How tables are related
How columns in a table are defined
A brief history of SQL
A comparison of Oracle, DB2, and Microsoft SQL Server
The SQL statements
An introduction to the SQL statements
How to work with database objects
How to query a single table
How to join data from two or more tables
How to add, update, and delete data in a table
How to work with views
SQL coding guidelines
How to work with stored procedures
How to work with user-defined functions
How to work with triggers
Three data access models
Java code that retrieves data from an Oracle database
How to start and stop the database service
How to use the Database Home Page
How to use SQL*Plus
How to create a database connection
How to export or import database connections
How to navigate through the database objects
How to view the column definitions for a table
How to view the data for a table
How to edit the column definitions
How to enter and execute a SQL statement
How to work with the Snippets window
How to handle syntax errors
How to open and save SQL statements
How to enter and execute a SQL script
How to view the manual
How to look up information
The basic syntax of the SELECT statement
SELECT statement examples
How to code column specifications
How to name the columns in a result set
How to code string expressions
How to code arithmetic expressions
How to use scalar functions
How to use the Dual table
How to use the DISTINCT keyword to eliminate duplicate rows
How to use the ROWNUM pseudo column to limit the number of rows
How to use the comparison operators
How to use the AND, OR, and NOT logical operators
How to use the IN operator
How to use the BETWEEN operator
How to use the LIKE operator
How to use the IS NULL condition
How to sort a result set by a column name
How to sort a result set by an alias, an expression, or a column number
How to limit the number of rows
How to return a range of rows
How to code an inner join
When and how to use table aliases
How to work with tables from different schemas
How to use compound join conditions
How to use a self-join
Inner joins that join more than two tables
How to use the implicit inner join syntax
How to code an outer join
Outer join examples
Outer joins that join more than two tables
How to use the implicit outer join syntax
How to combine inner and outer joins
How to join tables with the USING keyword
How to join tables with the NATURAL keyword
How to use cross joins
The syntax of a union
Unions that combine data from different tables
Unions that combine data from the same table
How to use the MINUS and INTERSECT operators
How to code aggregate functions
Queries that use aggregate functions
How to code the GROUP BY and HAVING clauses
Queries that use the GROUP BY and HAVING clauses
How the HAVING clause compares to the WHERE clause
How to code complex search conditions
How to use the ROLLUP operator
How to use the CUBE operator
How to use subqueries
How subqueries compare to joins
How to use subqueries with the IN operator
How to compare the result of a subquery with an expression
How to use the ALL keyword
How to use the ANY and SOME keywords
How to code correlated subqueries
How to use the EXISTS operator
How to code subqueries in the FROM clause
How to code subqueries in the SELECT clause
A complex query that uses subqueries
A procedure for building complex queries
How to code a subquery factoring clause
How to code a hierarchical query
How to create the tables for this book
How to create a copy of a table
How to commit changes
How to rollback changes
How to insert a single row
How to insert default values and null values
How to use a subquery to insert multiple rows
How to update rows
How to use a subquery in an UPDATE statement
How to delete rows
How to use a subquery in a DELETE statement
Data type overview
The character data types
The numeric data types
The temporal data types
The large object data types
How to convert characters, numbers, and dates
Common number format elements
Common date/time format elements
How to convert characters to and from their numeric codes
How to use the common character functions
How to parse a string
How to sort a string in numerical sequence
How to sort mixed-case columns in alphabetical sequence
How to use the common numeric functions
How to search for floating-point numbers
How to use the common date/time functions
How to parse dates and times
How to perform a date search
How to perform a time search
How to use the CASE function
How to use the COALESCE, NVL, and NVL2 functions
How to use the GROUPING function
How to use the ranking functions
The basic steps for designing a data structure
How to identify the data elements
How to subdivide the data elements
How to identify the tables and assign columns
How to identify the primary and foreign keys
How to enforce the relationships between tables
How normalization works
How to identify the columns to be indexed
The seven normal forms
How to apply the first normal form
How to apply the second normal form
How to apply the third normal form
When and how to denormalize a data structure
How to create a table
How to code a primary key constraint
How to code a foreign key constraint
How to code a check constraint
How to alter the columns of a table
How to alter the constraints of a table
How to rename, truncate, and drop a table
How to create an index
How to drop an index
How to create a sequence
How to use a sequence
How to alter a sequence
How to drop a sequence
An introduction to scripts
How the DDL statements work
How to use a sequence as a default
How to use the GENERATED clause
How to work with the columns of a table
How to work with the data of a table
How to work with the constraints of a table
How to work with indexes
How to work with sequences
How views work
Benefits of using views
How to create a view
How to create an updatable view
How to create a read-only view
How to use the WITH CHECK OPTION clause
How to insert or delete rows through a view
How to alter or drop a view
How to get information about a view
How to drop a view
How to alter or create a view
How to create an admin user
How to use SQL Developer to view database objects for a schema
How to create end users
How to use SQL*Plus to test end users
System privileges and object privileges
How to create, alter, and drop users
How to create and drop roles
How to grant privileges
How to revoke privileges
How to work with private synonyms
How to work with public synonyms
A script that creates roles and users
How to view the privileges for users and roles
How to work with users
How to grant and revoke roles
How to grant and revoke system privileges
An anonymous PL/SQL block in a script
A summary of statements for working with PL/SQL and scripts
How to print data to an output window
How to declare and use variables
How to code IF statements
How to code CASE statements
How to code loops
How to use a cursor
How to use collections
How to handle exceptions
A list of predefined exceptions
How to drop database objects without displaying errors
How to use bind variables
How to use substitution variables
How to use dynamic SQL
How to run a script from a command line
How to commit and rollback transactions
How to work with save points
How concurrency and locking are related
The four concurrency problems that locks can prevent
How to set the transaction isolation level
How to prevent deadlocks
How to create and call a stored procedure
How to code input and output parameters
How to code optional parameters
How to raise errors
A stored procedure that inserts a row
A stored procedure that drops a table
How to drop a stored procedure
How to create and call a function
A function that calculates balance due
How to drop a function
How to create a package
How to drop a package
Advantages of packages
How to view and drop procedures, functions, and packages
How to edit and compile procedures and functions
How to grant and revoke privileges
How to debug procedures and functions
How to create a BEFORE trigger for a table
How to use a trigger to enforce data consistency
How to use a trigger to work with a sequence
How to create an AFTER trigger for a table
How to use an INSTEAD OF trigger for a view
How to use a trigger to work with DDL statements
How to use a trigger to work with database events
How to enable, disable, rename, or drop a trigger
How to code a compound trigger
A trigger that causes the mutating-table error
How to solve the mutating-table problem
How to view, rename, or drop a trigger
How to enable or disable a trigger
How to edit a trigger
How to debug a trigger
Database time zone vs. session time zone
How to change the default date format
How to change the default time zone
Session settings vs. database settings
How to use functions to work with time zones
An introduction to the TIMESTAMP types
How to work with the TIMESTAMP type
How to work with the TIMESTAMP WITH LOCAL TIME ZONE type
How to work with the TIMESTAMP WITH TIME ZONE type
Common format elements for timestamps
How to use functions to work with timestamps
An introduction to the INTERVAL types
How to work with the INTERVAL YEAR TO MONTH type
How to work with the INTERVAL DAY TO SECOND type
How to use functions to work with intervals
The LOB types
APIs for working with LOBs
How to work with CLOBs
How to work with NCLOBs
How to work with BLOBs
How to work with BFILEs
How to specify LOB storage options
How to migrate to the new LOB types
The main method for the sample application
How to write an image to a table
How to read an image from a table
A utility class for working with databases
The methods of the DBMS_LOB package
An example that uses the DBMS_LOB package
How to install the Oracle Database Express Edition
How to install Oracle SQL Developer
How to install the SQL documentation
How to install the PL/SQL documentation
How to install the source files for this book
How to create the tables and users for this book
How to restore the tables and users
How to install the Personal Edition of Oracle Database
How to create the tables and users for this book for Oracle 12c and later
How to restore the tables and users
How to connect to Oracle 12c and later
How to start and stop database services
Oracle SQL Developer is a free, graphical tool that makes it so much easier to work with Oracle databases that we think you should use it right from the start. So this chapter shows you how to use SQL Developer to work with database objects and to build and run SQL statements.
Once you have SQL Developer installed on your system, chapter 3 shows how to use SQL SELECT statements to retrieve data from a single table. Our hope is that this will give you a better idea of how well our book works and how much there is to learn about SQL.
Chapter 2 PDF (572Kb) Download Now
Chapter 3 PDF (271Kb) Download Now
This download includes:
Appendix A in the book describes how to install and use these files.
Exe file for Windows (4.9 Mb) Download Now
Zip file for any system (4.8 Mb) Download Now
To view the "Frequently Asked Questions" for this book in a PDF, just click on this link: View the questions
Then, if you have any questions that aren't answered here, please email us. Thanks!
There are no book corrections that we know of at this time. But if you find any, please email us so we can post any corrections that affect the technical accuracy of the book right here. Thank you!
For orders and customer service:
1-800-221-5528
Weekdays, 8 to 4 Pacific Time
If you're a college instructor who would like to consider a book for a course, please visit our website for instructors to learn how to get a complimentary review copy and the full set of instructional materials.