Introduction to SQL

This course introduces the most popular database query language, Structured Query Language (SQL). The ANSI syntax for SQL is illustrated through examples. Oracle and SQL Server extensions are also discussed. The basics of querying, modifying, and adding data are practiced through activities.

Familiarity with basic operating system commands is required.

Course Objectives
After completing this course, participants should be able to:
  • Describe the history and use of SQL
  • Query selected data
  • Format result sets
  • Evaluate queried data using functions and expressions
  • Join data from multiple tables
  • Develop queries to answer business questions
  • Insert, update, and delete data

Intended Audience
This course may prove useful to people such as application developers, business managers, and users who need to develop SQL statements.

Next Steps
Students completing this course may wish to further their knowledge with or some of the vendor-specific courses listed in the catalogue.

2 days

Instructor-led course, with many practical computer-based exercises.

Course Outline

  • Introduction to SQL
    • The relational model
    • Why SQL?
    • Queries and results
    • Inputting SQL commands
    • The Cars database example
  • Single Table Queries
    • Projecting data with SELECT
      • Writing queries with SELECT
      • Selecting distinct data
      • Modifying results with expressions
      • Controlling column headings
      • Incorporating functions
      • Working with NULL data
      • Grouping related rows
      • Using COMPUTE
    • Restricting data with SELECT
      • Comparing expressions
      • Comparisons with NULL data
      • Comparisons with LIKE, BETWEEN, and IN
      • Conjunctive operators
      • Restricting aggregate result sets with HAVING
    • Sorting results with ORDER BY
  • Multiple Table Queries
    • Joining data
      • Joining data from multiple tables
      • Using table aliases
      • Join examples
    • Advanced joins and multiple-table operations
      • Self-join statements
      • Outer joins
      • Set operations
      • Subqueries
  • Modifying Data
    • The INSERT statement
    • Using SELECT INTO in SQL Server
    • The DELETE statement
    • The UPDATE statement
Hardware and Software Requirements
Either Oracle8 or Microsoft SQL Server 7 is recommended. Personal Oracle or Sybase SQL Anywhere can also be used.

Note to Oracle licensees
Your Oracle license may not allow the use of the software for providing training to people outside your organisation. Contact Oracle if you are planning to provide third-party training and have any doubts about your license in this regard.

Go to course catalogue