CO-80174 Oracle Database 12c: Introduction to SQL Summary Duration 5.00 Days Delivery Method Instructor-led (Classroom) Audience End Users, Developers, Technical Consultants and Support Staff Training Credits Yes Level Professional Technology Oracle Database 12c Introduction This five-day instructor-led course consists of Fundamentals I (3 days) and Fundamentals II (2 days) and introduces participants to the fundamentals of SQL using Oracle Database 11g database technology. In this course participants learn the concepts of relational databases and the powerful SQL programming language. This course provides the essential SQL skills that allow consumers and developers to write queries against relational database tables, manipulate data in tables, create database objects, and use built-in functions to customize output, convert data, use conditional expressions, perform aggregate calculations, manipulate large data sets, manage data in different time zones and make use of the powerful regular expressions. This course will teach participants how to make use of Oracle SQL Developer as the main tool (with SQL*Plus optionally available) for hands-on practice to reinforce the fundamental concepts and new skills acquired. Prerequisites Before attending this course, students must have: A familiarity with data processing concepts and techniques Master basic application features such as Open, Save, Close A proficiency with the use of a keyboard and mouse Target Audience End Users, Developers, Technical Consultants and Support Staff Course Content SQL FUNDAMENTALS I Lesson 1: Introduction This lesson provides an overview of Relational Database Management Systems and the development environments used for creating and executing SQL statements. Course objectives, agenda, and appendixes used in the course Overview of Oracle Database 12c and related products Overview of relational database management concepts and terminologies Introduction to SQL and its development environments The Human Resource(HR) Schema and the tables used in the Course Oracle database 12c SQL Documentation and Additional Resources
Start Oracle SQL Developer and create a new connection to the ora1 account. Use Oracle SQL Developer to examine the data objects in the ora1 account. The ora1 account contains the HR schema tables. Lesson 2: Retrieving Data Using the SQL SELECT Statement This lesson describes the capabilities of the SQL SELECT statement, and how to execute a basic SELECT statement. Basic SELECT statement Arithmetic expressions and NULL values in the SELECT statement Column Aliases Use of concatenation and alternative quote operators, literal character strings and the DISTINCT keyword Using the DESCRIBE command Selecting all data from different tables Describing the structure of tables Performing arithmetic calculations and specifying column names Lesson 3: Restricting and Sorting Data This lesson explains the use of operators to limit and sort the rows returned by a query. It also describes the use of ampersand substitution variables to restrict and sort output at run time. Limiting rows with the WHERE clause, comparison conditions, the NULL and logical operators Rules of precedence for operators in an expression Sorting rows using the ORDER BY clause Using Substitution Variables Using the DEFINE and VERIFY commands Selecting data and changing the order of the rows that are displayed Restricting rows by using the WHERE clause Sorting rows by using the ORDER BY clause Using substitution variables to add flexibility to your SQL SELECT statements Lesson 4: Using Single-Row Functions to Customize Output This lesson describes the nature of various types of functions available in the SQL language. It also demonstrates the use of character, number and date functions in SELECT statements. Single-row SQL functions Character functions Number functions Working with dates Date functions Writing a query that displays the current date Creating queries that require the use of numeric, character, and date functions Performing calculations of years and months of service for an employee Lesson 5: Using Conversion Functions and Conditional Expressions This lesson describes the use of various types of conversion functions available in SQL. It also demonstrates the use of the TO_CHAR, TO_NUMBER and TO_DATE functions and how to apply conditional expressions in a SELECT statement. Implicit and explicit data type conversion TO_CHAR, TO_DATE, TO_NUMBER functions Nesting functions General functions: NVL NVL2 NULLIF COALESCE Conditional expressions CASE DECODE Creating queries that use TO_CHAR, TO_DATE, and other DATE functions
Creating queries that use conditional expressions such as DECODE and CASE Lesson 6: Reporting Aggregated Data Using the Group Functions This lesson explains the use of group functions in obtaining summary information for groups of rows. It also discusses how to group rows into smaller sets and how to specify search criteria for groups of rows. Group functions Types and syntax Use AVG, SUM, MIN, MAX, COUNT Use the DISTINCT keyword within group functions NULL values in a group function Grouping rows GROUP BY clause HAVING clause Nesting group functions Writing queries that use the group functions Grouping by rows to achieve more than one result Restricting groups by using the HAVING clause Lesson 7: Displaying Data from Multiple Tables Using Joins This lesson explains how to obtain data from multiple tables through the use of joins. It demonstrates the use of equijoins, nonequijoins, self-joins, outer joins in SELECT statements as well as the generation of Cartesian products with a cross join. Types of JOINS and its syntax Natural join USING clause ON clause Self-join Nonequijoins OUTER join LEFT OUTER join RIGHT OUTER join FULL OUTER join Cartesian product Cross join Joining tables using an equijoin Performing outer and self-joins Adding conditions Lesson 8: Using Subqueries to Solve Queries This lesson describes the use of subqueries in SQL statements as well as the different types and the types of problems that can be solved. Subquery types, syntax, and guidelines Single-row subqueries Group functions in a subquery HAVING clause with subqueries Multiple-row subqueries Use ALL or ANY operator Using the EXISTS operator Null values in a subquery Creating subqueries to query values based on unknown criteria Using subqueries to find out the values that exist in one set of data and not in another Lesson 9: Using the Set Operators This lesson demonstrates the use of set operators to combine or compare the results of many individual queries into a single result. Set Operators: Types and guidelines UNION and UNION ALL operator
INTERSECT operator MINUS operator Matching the SELECT statements Using the ORDER BY clause in set operations Create reports by making us of: The UNION operator The INTERSECT operator The MINUS operator Lesson 10: Manipulating Data This lesson describes the use of each of the data manipulation statements. It also demonstrates how to insert, update and delete table data and how to control database transactions. Adding new rows in a table INSERT statement Changing data in a table UPDATE statement Removing rows from a table DELETE statement TRUNCATE statement Database transactions control using COMMIT, ROLLBACK and SAVEPOINT Read consistency FOR UPDATE clause in a SELECT statement Inserting rows into the tables Updating and deleting rows in the table Controlling transactions Lesson 11: Using DDL Statements to Create and Manage Tables This lesson explains the use of data definition language (DDL) statements to create, alter and remove simple tables. It also shows the column data types available in DDL and introduces database schema concepts as well as table and column constraints. Database objects Naming rules CREATE TABLE statement Access another user s tables DEFAULT option Data types Overview of the NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY and CHECK constraints Creating a table using a subquery ALTER TABLE Read-only tables DROP TABLE statement Creating new tables Creating a new table by using the CREATE TABLE AS syntax Verifying that tables exist Altering tables Adding columns Dropping columns Setting a table to read-only status Dropping tables SQL FUNDAMENTALS II Lesson 1: Introduction This lesson provides an overview of the database schema and tables used in the course as well as a review of the basic concepts of the SQL language. Course objectives and course agenda The database schema, the appendixes and practices, and development environments used in this course Review of some basic SQL concepts Oracle Database 12c documentation and additional resources
Lesson 2: Introduction to Data Dictionary Views In this lesson, you are introduced to the data dictionary views. You learn that the dictionary views can be used to retrieve metadata and create reports about your schema objects. Introduction to data dictionary Querying the dictionary views for the following: Table information Column information Constraint information Adding a comment to a table and querying the dictionary views for comment information Query the dictionary views to find information about objects in your schema Lesson 3: Creating Sequences, Synonyms and Indexes This lesson describes additional techniques for creating and using indexes, sequences and synonyms. Overview of sequences Creating, using, and modifying a sequence Cache sequence values NEXTVAL and CURRVAL pseudocolumns SQL column defaulting using a sequence Overview of synonyms Creating a synonym Dropping a synonym Overview of indexes Creating indexes Using the CREATE TABLE statement Creating function-based indexes Creating multiple indexes on the same set of columns Removing indexes Creating sequences Using sequences Querying the dictionary views for sequence information Creating synonyms Querying the dictionary views for synonyms information Creating indexes Querying the dictionary views for indexes information Lesson 4: Creating Views This lesson describes the techniques associated with creating and using views. Overview of views Creating, modifying, and retrieving data from a view Querying the dictionary views for view information Data manipulation language (DML) operations on a view Dropping a view Creating a simple view Creating a complex view Creating a view with a check constraint Attempting to modify data in the view Querying the dictionary views for view information Removing views Lesson 5: Managing Schema Objects This lesson contains information about constraints and altering existing objects. You also learn about external tables and the provision to name the index at the time of creating a PRIMARY KEY constraint. Managing constraints Adding and dropping a constraint Enabling and disabling a constraint Deferring constraints
Creating and using temporary tables Creating and using external tables Adding and dropping constraints Deferring constraints Creating external tables Lesson 6: Retrieving Data by Using Subqueries This lesson demonstrates the need for and creation of multiple-column subqueries, how to include subqueries in the FROM clause of a SELECT statement and how to solve problems through the user of scalar and multi-value subqueries. It also explains and demonstrates the features of correlated subqueries, and the use of the EXISTS and NOT EXISTS operators and the WITH clause. Write a multiple-column subquery Use scalar subqueries in SQL Solve problems with correlated subqueries Update and delete rows by using correlated subqueries Use the EXISTS and NOT EXISTS operators Use the WITH clause Creating multiple-column subqueries Writing correlated subqueries Using the EXISTS operator Using scalar subqueries Using the WITH clause Lesson 7: Manipulating Data by using Subqueries In this lesson, you learn how to manipulate data in the Oracle database by using subqueries. You also learn how to solve problems by using correlated subqueries. Using subqueries to manipulate data Inserting by using a subquery as a target Using the WITH CHECK OPTION keyword on DML statements Using correlated subqueries to update and delete rows Using subqueries to manipulate data Inserting by using a subquery as a target Using the WITH CHECK OPTION keyword on DML statements Using correlated subqueries to update and delete rows Lesson 8: Controlling User Access In this lesson, you learn how to control database access to specific objects and add new users with different levels of access privileges. System privileges Creating a role Object privileges Revoking object privileges Granting other users privileges to your table Modifying another user s table through the privileges granted to you Lesson 9: Manipulating Data In this lesson, you learn how to use the DEFAULT keyword in INSERT and UPDATE statements to identify a default column value. You also learn about multitable INSERT statements, the MERGE statement, performing flashback operations, and tracking changes in the database. Specifying explicit default values in the INSERT and UPDATE statements Using the following types of multitable INSERTs: Unconditional INSERT Conditional INSERT ALL Conditional INSERT FIRST Pivoting INSERT
Merging rows in a table Performing flashback operations Tracking the changes to data over a period of time Performing multitable INSERTs Performing MERGE operations Performing flashback operations Tracking row versions Lesson 10: Managing Data in Different Time Zones In this lesson, you learn how to use data types similar to DATE that store fractional seconds and track time zones. This lesson addresses some of the datetime functions available in the Oracle database. CURRENT_DATE, CURRENT_TIMESTAMP, and LOCALTIMESTAMP INTERVAL data types Using the following functions: EXTRACT TZ_OFFSET FROM_TZ TO_TIMESTAMP TO_YMINTERVAL TO_DSINTERVAL Using different datetime functions Associated Certifications & Exam This course prepares students to write Exam(s): 1Z0-047 Oracle Database SQL Expert 1Z0-051 Oracle Database 11g SQL Fundamentals 1Z0-061 Oracle Database 12c SQL Fundamentals Accredited to certification(s): Oracle Database 10g Administrator Certified Associate Oracle Database 11g Administrator Certified Associate Oracle Database 12c Administrator Certified Associate Oracle PL/SQL Developer Certified Associate