Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1: Getting Started

Similar presentations


Presentation on theme: "Chapter 1: Getting Started"— Presentation transcript:

1 Chapter 1: Getting Started
3 Chapter 1: Getting Started 1.1 Course Logistics 1.2 Introducing the Structured Query Language 1.3 Introducing the Business Scenario

2 Chapter 1: Getting Started
3 Chapter 1: Getting Started 1.1 Course Logistics 1.2 Introducing the Structured Query Language 1.3 Introducing the Business Scenario

3 Objectives Explain the naming convention that is used for the course files. Compare the three levels of exercises that are used in the course. Describe at a high level how data is used and stored at Orion Star Sports & Outdoors. Navigate to the SAS Help facility.

4 Filename Conventions s104d01x s104a01 s104a02 s104a02s s104d01 s104d02
course ID chapter # type item # placeholder s104a01 s104a02 s104a02s s104d01 s104d02 s104e01 s104e02 s104s01 s104s02 Example: The SAS® SQL 1: Essentials course ID is s1, so s104d01= SQL Chapter 4, Demo 1. Code Type a Activity d Demo e Exercise s Solution

5 Three Levels of Exercises
The exercise mimics an example presented in the section. Level 2 Less information and guidance are provided in the exercise instructions. Level 3 Only the task you are to perform or the results to be obtained are provided. Typically, you will need to use the Help facility.  You are not expected to complete all of the exercises in the time allotted. Choose the exercise or exercises that are at the level you are most comfortable with.

6 Orion Star Sports & Outdoors
Orion Star Sports & Outdoors is a fictitious global sports and outdoors retailer with traditional stores, an online store, and a large catalog business. The corporate headquarters is located in the United States with offices and stores in many countries throughout the world. Orion Star has about 1,000 employees and 90,000 customers, processes approximately 150,000 orders annually, and purchases products from 64 suppliers.

7 Orion Star Data As is the case with most organizations, Orion Star has a large amount of data about its customers, suppliers, products, and employees. Much of this information is stored in transactional systems in various formats. Using applications and processes such as SAS Data Integration Studio, this transactional information was extracted, transformed, and loaded into a data warehouse. Data marts were created to meet the needs of specific departments such as Marketing.

8 The SAS Help Facility

9 The SAS Help Facility Invoke the SAS Help facility by doing one of the following actions: Type Help on the command line. Select Help from the menu. Select the Help button on the toolbar. Additional help and documentation are available at

10 The SAS Help Facility

11

12 Setup for the Poll Start your SAS session. Open the SAS Help facility.

13 1.01 Poll Were you able to open the Help facility in your SAS session?  Yes  No Answers vary.

14 1.02 Multiple Choice Poll Which choice best describes your programming and SQL experience level? I have little or no programming experience. I can write programs in languages other than SQL. I can write database-specific SQL programs. I can write SAS PROC SQL programs. I can program in multiple languages, including SQL. Type answer here

15 1.03 Multiple Choice Poll What version of SAS do you use?
I do not use SAS. SAS 8.2 SAS®9 SAS 9.1 SAS 9.2 Other Type answer here

16 Chapter 1: Getting Started
3 Chapter 1: Getting Started 1.1 Course Logistics 1.2 Introducing the Structured Query Language 1.3 Introducing the Business Scenario

17 Objectives Describe the historical development of Structured Query Language (SQL). Explain how SQL is used.

18 Structured Query Language
Structured Query Language (SQL) is a standardized language originally designed as a relational database query tool. SQL is currently used in many software products to retrieve and update data.

19 Structured Query Language: Timeline
1970 1980 1990 2000 IBM develops SQL. 1970 – Dr. E. F. Codd of IBM proposes SQL. 1981 – First commercial SQL product is released. 1989 – More than 75 SQL-based systems exist. SAS 6.06 includes PROC SQL. 1999 – PROC SQL is enhanced for SAS 8. 2004 – PROC SQL is enhanced for SAS®9.

20 The SQL Procedure The SQL procedure has the following characteristics:
enables the use of SQL in SAS is part of Base SAS software follows American National Standards Institute (ANSI) standards includes enhancements for compatibility with SAS software

21 The SQL Procedure Features
With PROC SQL, you can use SQL language syntax to do the following: query SAS data sets generate reports from SAS data sets combine SAS data sets in many ways create and delete SAS data sets, views, and indexes update existing SAS data sets sometimes reproduce the results of multiple DATA and procedure steps with a single query

22 Structured Query Language
Input Output SAS Data Set Report PROC SQL PROC SQL DBMS Table SAS Data Set SAS Data View SAS Data View DBMS Table

23

24 Setup for the Poll Issue a LIBNAME statement for the orion library, which contains the course data. You can use the s101a01 program if you want. Change the data location, if necessary. Submit the program s101a02. Answer the following questions: What is the name of the input SAS data set? Do the column names appear in the SELECT statement? s101a02

25 1.04 Multiple Choice Poll What is the name of the input SAS data set?
orion.Employee_payroll SQL SELECT None of the above a. orion.Employee_payroll

26 1.04 Multiple Choice Poll – Correct Answer
What is the name of the input SAS data set? orion.Employee_payroll SQL SELECT None of the above Type answer here

27 1.05 Poll Did the names of the columns that appeared in the results appear in the SELECT statement in the code?  Yes  No No

28 1.05 Poll – Correct Answer Did the names of the columns that appeared in the results appear in the SELECT statement in the code?  Yes  No Type answer here

29 The SQL Procedure The SQL procedure is a tool for querying data
a tool for data manipulation and management an augmentation to the DATA step. The SQL procedure is not a DATA step replacement a custom reporting tool.

30 SAS Data Sets A SAS data set can be any of the following:
a SAS data file that stores data descriptions and data values together in native SAS format a DBMS table accessed via a SAS/ACCESS engine a SAS data view, using one of the following technologies: PROC SQL view – a stored SQL query that retrieves data stored in other tables DATA step view – a stored DATA step that retrieves data stored in other files SAS/ACCESS view – a stored ACCESS descriptor containing information required to retrieve data stored in a DBMS (older technology) TAG_Notes: SAS/Access descriptors are no longer recommended for accessing relational databases. SQL views enable use of the LIBNAME statement, which provides greater control over DBMS operations such as locking, spooling, and data type conversions, as well as handling long field names. In addition, SQL views are platform-independent; SAS/Access descriptors are not. If you are currently using SAS/Access descriptors, the CV2VIEW procedure in SAS 9.1 can help convert them to SQL views

31 Terminology Data Processing SAS SQL File Data Set Table Record
Observation Row Field Variable Column

32

33 Chapter 1: Getting Started
3 Chapter 1: Getting Started 1.1 Course Logistics 1.2 Introducing the Structured Query Language 1.3 Introducing the Business Scenario

34 Objectives Describe the data used in this course.
Explain the relationships between the various tables.

35 The Orion Star Company Analyze a subset of Orion Star data including the following: employees in the United States and Australia customers from Australia, Canada, Germany, Israel, South Africa, the United States, and Turkey the years 2002 through 2007 The tables and columns are related as shown on the next slide.

36 Orion Star Data Relationships
Human Resources Data Employee_ID is the key column for HR data.

37 Orion Star Data Relationships
Order Data Order_ID is the key column for Order data. Product_ID is the key column for Product data.

38 Orion Star Data Relationships
Customer Data Customer_ID is the key column for Customer data.

39 Orion Star Data Relationships
Relationships between Types of Data

40

41 1.06 Multiple Answer Poll Employee_ID?
Which of the Order data tables contain the column Employee_ID? orion.QTR1_2007 orion.QTR2_2007 orion.Order_Fact orion.Price_List orion.Product_Dim All of them b. orion.QTR2_2007 c. orion.Order_Fact

42 1.06 Multiple Answer Poll – Correct Answer
Which of the Order data tables contain the column Employee_ID? orion.QTR1_2007 orion.QTR2_2007 orion.Order_Fact orion.Price_List orion.Product_Dim All of them Type answer here

43 Orion Country Codes Code Country AU Australia CA Canada DE Germany IL
Israel TR Turkey US United States ZA South Africa

44 Individual Product Identifier
Orion Product ID Codes Codes are numeric in the form XXYYZZZZZZZZ. Product Type Individual Product Identifier XXYYZZZZZZZZ Subcategory

45 Orion Product ID Codes Code Product Type 21 Children 22
Clothes and Shoes 23 Outdoors 24 Sports

46

47 1.07 Quiz Use the data relationship charts on pages 1-16 through 1-18 to answer the following question: Which table(s) contains the column Order_Date? 1. orion.Order_Fact 2. orion.Qtr1_2007 3. orion.Qtr2_2007 s101a03

48 1.07 Quiz – Correct Answer Use the data relationship charts on pages 1-16 through 1-18 to answer the following question: Which table(s) contains the column Order_Date? orion.Order_Fact orion.Qtr1_2007 orion.Qtr2_2007 Type answer here s101a03


Download ppt "Chapter 1: Getting Started"

Similar presentations


Ads by Google