This tutorial teaches you how to create and run
an SQL query. Using the SQL builder, which is a visual interface for creating
and running SQL queries, you will build a SELECT statement. The statement
will include a table alias, a column alias, a database function expression,
a CASE expression, and a grouping clause.
You will work with a database for a video store called VIDEOS. The
database holds data that is related to the store customers, inventory, video
rentals, and employees. The video store application needs a query that lets
the store employees look up the video titles that a particular customer has
rented and what day of the week the videos are due. The query involves two
joins, a query condition (WHERE clause), and a GROUP BY clause. The SQL statement
also needs a CASE expression, a function, and a host variable to substitute
the name of the customer at run time.
Learning objectives
When
you complete the exercises, you will know how to do the following tasks:
- Create a SELECT statement
- Add tables to the statement
- Add table aliases
- Specify result columns
- Add a CASE expression to the result column set
- Add a column alias
- Join tables
- Create a query condition
- Add a GROUP BY clause
- Run the SQL query and pass in a host variable for the query
This tutorial should take approximately 30 minutes to finish.
If you explore other concepts related to this tutorial, it could take longer
to complete.
Skill level
Beginner
Audience
Database application developers