Introduction to SQL
Course Description
Learning the SQL language is one of the key tasks required for the use of a relational database. SQL proficiency is essential for business users, database developers, database administrators and any other database professional. This course introduces the basics of the SQL language Participants become acquainted with the differences in the working environment between a traditional on-premises database installation and the database services of cloud-computing platforms. This course incorporates data modeling theory, relational database theory, graphical depictions of theoretical concepts and numerous examples of actual SQL syntax into one course.
Duration: 3 days
Prerequisites
The target audience for this course is all IT professionals, both business and systems professionals. Among the specific groups for whom this course will be helpful are: • Business and non-IT professionals • Application designers and database developers • Business Intelligence (BI) analysts and consumers • Database administrators • Web server administrators
Objectives
The first portion of this course considers the logical models upon which a relational database is based and the various configurations and environments in which you may work with a database. The next segment focuses on the actual SQL syntax for writing database queries. You will begin with the simplest of queries and then proceed onto moderately complex query scenarios. Finally, the course covers the DDL, DML and transaction control portions of the SQL language that allow one to create, maintain and manipulate application database objects and application data. Since SQL is an industry standard language, many of the topics presented and many of the skills you will acquire will be applicable to other database platforms, such as Microsoft SQL Server, Ingres SQL, IBM DB2, the open-source databases MySQL and PostgreSQL, and others.
COURSE SETUP
UNLESS OTHERWISE REQUIRED BY CLIENTS, THE COURSE IS RUN USING THE AZURE DATA STUDIO ON A TRAINING DATABASE WE PROVIDE. PARTICIPANTS WILL NEED TO INSTALL THE FREE AZURE DATA STUDIO APP.
RELATIONAL DATABASES & DATA MODELS
• ABOUT DATA MODELS
• ABOUT THE RELATIONAL MODEL
• THE ELECTRONICS DATA MODEL
• ABOUT THE RELATIONAL DBMS
SELECTION & SETUP OF THE DATABASE INTERFACE
• CONSIDERING AVAILABLE TOOLS • SELECTING THE APPROPRIATE TOOL • DATABASE CONNECTIONS • SETUP QUERYING TOOLS
USING THE DATABASE INTERFACE
• ABOUT BIND AND SUBSTITUTION VARIABLES • USING AZURE STUDIO, SQL DEVELOPER AND OTHER INTERFACES
INTRODUCTION TO THE SQL LANGUAGE
• ABOUT THE SQL LANGUAGE • CHARACTERISTICS OF SQL • INTRODUCING SQL USING SELECT • SQL RULES THEORY
THE SELECT STATEMEENT
• THE SELECT STATEMENT • DISTINCT / UNIQUE KEYWORD • USING ALIAS NAMES
RESTRICTING RESULTS WITH THE WHERE
• ABOUT LOGICAL OPERATORS
• EQUALITY OPERATOR
• BOOLEAN OPERATORS
• REGEXP_LIKE()
• IN OPERATOR
SORTING DATA WITH THE ORDER BY CLAUSE
• ABOUT THE ORDER BY CLAUSE
• MULTIPLE COLUMN SORTS
• SPECIFY THE SORT SEQUENCE
• ABOUT NULL VALUES WITHIN SORTS
• USING COLUMN ALIASES
PSEUDO COLUMNS, FUNCTIONS & TOP-N QUERIES
• ROWID PSEUDO COLUMN
• ORA_ROWSCN PSEUDO COLUMN
• ROWNUM PSEUDO COLUMN
• ABOUT THE BUILT-IN FUNCTIONS
• SYSDATE
• USER & UID
• SESSIONTIMEZONE Function
• USING THE DUAL TABLE
• ROW LIMITING & TOP-N QUERIES
• FETCH FIRST x ROWS ONLY Clause
• OFFSET x ROWS Clause
• FETCH ... PERCENT Clause
• The WITH TIES Option
JOINING TABLES
• ABOUT JOINS
• INNER JOIN
• REFLEXIVE JOIN
• NON-KEY JOIN
• OUTER JOIN
USING THE SET OPERATORS
• ABOUT THE SET OPERATORS
• SQL SET OPERATOR EXAMPLES
• UNION Example
• INTERSECT Example
• MINUS Example
• UNION ALL
USING SUB- QUERIES
• FINDING DATA WITH SUB-QUERIES
• STANDARD SUB-QUERIES
• CORRELATED SUB-QUERIES
• The EXISTS Operator
AGGREGATING DATA WITHIN GROUPS
• ABOUT SUMMARY GROUPS
• FIND GROUPS WITHIN THE TABLES
• SELECT DATA FROM THE BASE TABLES
• SELECT GROUPS FROM THE RESULTS
USE DDL TO CREATE & MANAGE TABLES
• CREATE TABLE STATEMENT
• COLUMN DATA TYPES
• NOT NULL
• DEFAULT
• DESCRIBE
• ALTER TABLE STATEMENT
• DROP TABLE STATEMENT
• TABLE DDL USING SQL DEVELOPER
• ALTER USER STATEMENT
• ALTER SESSION STATEMENT
• NLS_LANGUAGE
• NLS_DATE
USE DML TO MANIPULATE DATA
• THE INSERT STATEMENT • THE DELETE STATEMENT • THE UPDATE STATEMENT • ABOUT TRANSACTIONS • TRANSACTION ROLLBACK • TRANSACTION COMMIT • TRANSACTION SAVEPOINT • THE SET TRANSACTION STATEMENT • SET TRANSACTION READ ONLY STATEMENT RULES