Module 2: Creating and running SQL script files
In this module, you will explore some of the basic Db2® Big SQL queries and begin to understand the Sample Outdoor Company data.
Now that you have loaded the data from the Sample Outdoor Company, you are ready to explore the sales figures and product activity. This module teaches you some of the basic Db2 Big SQL statements, how to create Db2 Big SQL objects, and how to run queries.
Learning objectivesAfter completing the lessons in this module, you will know how to complete the following tasks:
- Run queries from the JSqsh command-line interface.
- Create scripts to run Db2 Big SQL statements.
- Create a view.
- Create queries that help you to analyze financial data from the Sample Outdoor Company.
Time requiredThis module should take approximately 45 minutes to complete.
PrerequisitesYou must complete the tasks to set up your environment.
- Lesson 2.1: Creating an SQL script file
The SQL script file is a container for SQL statements or commands. When you run SQL statements from a client such as JSqsh, the script file is a convenient way of managing large numbers of statements.
- Lesson 2.2: Creating and running a simple query to begin data analysis
In this lesson, you will explore some basic Db2 Big SQL queries. The goal is to learn how to query data for analysis.
- Lesson 2.3: Creating a view that represents inventory shipped by branch
In this lesson, you will create a view that is the result of a query that joins two tables.
- Lesson 2.4: Analyzing products and market trends with Db2 Big SQL joins and predicates
In this lesson, you will create and run Db2 Big SQL queries that analyze the market and financial data in the GOSALESDW schema.
- Lesson 2.5: Creating advanced Db2 Big SQL queries that include common table expressions, aggregate functions, and ranking
In this lesson, you will create Db2 Big SQL queries with common table expressions, aggregate functions, and ranking to identify the Sample Outdoor Company's best-selling products.