2 3  To get data from the database for presentation to users and customers.  Reports generally query the selected set  Permanent data can be accessed.

Slides:



Advertisements
Similar presentations
Soil Property Scripts National Soil Survey Center.
Advertisements

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Exploring Microsoft Access 2003 Chapter 3 Information From the Database: Reports and Queries.
Oracle Discoverer Desktop 4i
Exploring Microsoft Access 97 Chapter 3 Information From the Database: Reports and Queries Office graphic copyright by Microsoft Corp.
Exploring Microsoft Access
Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Chapter 5 Creating, Sorting, and Querying a Table
Managing Grades with Excel Viewing Help To view Help 1.Open Excel on your computer. 2.In the top right hand corner of the Excel Screen type in the.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
Database Systems More SQL Database Design -- More SQL1.
Chapter 2 Querying a Database
Mary K. Olson PS Reporting Instance – Query Tool 101.
Concepts of Database Management Sixth Edition
A Guide to SQL, Seventh Edition. Objectives Retrieve data from a database using SQL commands Use compound conditions Use computed columns Use the SQL.
Microsoft Access 2010 Chapter 7 Using SQL.
QUERIES. OPEN THE QUERY TABLE. 2 What am I looking for?
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Chapter 2 Querying a Database
Soil Data Access. The Soil Data Access The Soil Data Access facility is a suite of web services and applications Designed.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
Word Processing ADE100- Computer Literacy Lecture 12.
Chapter 3 Single-Table Queries
Chapter 10: Working with Large Data Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
CSE314 Database Systems More SQL: Complex Queries, Triggers, Views, and Schema Modification Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
Analyzing Data For Effective Decision Making Chapter 3.
Chapter 9 Joining Data from Multiple Tables
1 Single Table Queries. 2 Objectives  SELECT, WHERE  AND / OR / NOT conditions  Computed columns  LIKE, IN, BETWEEN operators  ORDER BY, GROUP BY,
Concepts of Database Management Seventh Edition
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
Analyzing Data Using Access. Creating a new database To create a new database 1.Start Access. In the Task Pane, click Blank Database. 2.The File New Database.
Analysing Data with Excel Viewing Help To view Help 1.On the Start menu, point to Programs, and then click Microsoft Excel. 2.On the Help menu,
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
Intro to SQL Management Studio. Please Be Sure!! Make sure that your access is read only. If it isn’t, you have the potential to change data within your.
Chapter 3 Query and Report. Agenda Report types Report contents Report creation Report design view Query and dynaset Function and grouping Action query.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
Reports and Queries Chapter 3 – Access text Reports – Page Queries – Page
O FFICE M ANAGEMENT T OOL - II B BA -V I TH. Abdus Salam2 Week-7 Introduction to Query Introduction to Query Querying from Multiple Tables Querying from.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Aliya Farheen October 29,2015.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
(SQL - Structured Query Language)
1 Chapter 3: Getting Started with Tasks 3.1 Introduction to Task Dialogs 3.2 Creating a Listing Report 3.3 Creating a Frequency Report 3.4 Creating a Two-Way.
A Guide to SQL, Eighth Edition Chapter Four Single-Table Queries.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
1 Chapter 3 Single Table Queries. 2 Simple Queries Query - a question represented in a way that the DBMS can understand Basic format SELECT-FROM Optional.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
24 Copyright © 2009, Oracle. All rights reserved. Building Views and Charts in Requests.
Chapter 4 Crystal Report Presenter: PEN PHIROM (MscIT) Phone:
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
IFS180 Intro. to Data Management Chapter 10 - Unions.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
More SQL: Complex Queries,
The Database Exercises Fall, 2009.
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
More SQL: Complex Queries, Triggers, Views, and Schema Modification
Contents Preface I Introduction Lesson Objectives I-2
Access: Queries III Participation Project
Chapter 3 Query and Report.
Tutorial 8 Sharing, Integrating, and Analyzing Data
Presentation transcript:

2

3  To get data from the database for presentation to users and customers.  Reports generally query the selected set  Permanent data can be accessed  Query portion of the report selects specified data elements to be used in generation of the output.

 Query  Data manipulation  Output 4

5  SQL required structure  EXEC SQL  SELECT columns statement  FROM table statement Example: EXEC SQL SELECT compname FROM component;.

6  Optional parts  WHERE clause  table join statements  conditional clauses  Sort statement  Aggregation statements  Data manipulation  Templates  Section and Column formatting  Page formatting

7  Data manipulation  Multiple queries  DERIVE statements  DEFINE statements  INTERPRET statements  PARAMETER statements

8  Report process flow chart  Report styles  Data transformations

9 NASIS Reports Flow Chart

10  Tabular  headings  columns  Narrative  bullets  paragraphs  Export  delimited text

11compnamecomppct_rhznamehzdept_rhzdepb_rAlpha45H1010 Alpha45H21035 Alpha45H Beta30H1015 Beta30H21542 Beta30H34265 Beta30H465150

12compnameAlpha hznameH1 H2 H3thickness

 Open the Reports Explorer  On menu or toolbar choose to open new report  Enter report name  Enter report format 13

14  Purpose: Demonstrates default report format.  Problem: List each national mapunit symbol and mapunit name.  Tables: mapunit.  References:  EXEC SQL (p. 22)  table structure report

EXEC SQL SELECT nationalmusym, muname FROM mapunit;. Report SQL begins with EXEC SQL and ends with semicolon and period Selects the columns needed for the report Identifies the table they columns reside 15

EXEC SQL SELECT nationalmusym, muname FROM mapunit WHERE muname matches ‘Harney silt loam, 0 to 1 percent slopes’;.  Adding conditions  Need to understand the data types and comparisons 16

EXEC SQL SELECT nationalmusym, muname FROM mapunit WHERE muname matches ‘Harney *’; SORT BY muname.  Notice the semicolon and period 17

EXEC SQL SELECT nationalmusym, muname, compname FROM mapunit INNER JOIN correlation by default INNER JOIN datamapunit by default INNER JOIN component by default WHERE muname matches ‘Harney *’; SORT BY nationalmusym. 18

 Based on what you know, create a default format report that shows the area symbol, map unit symbol, national mapunit symbol, mapunit name, and corresponding data mapunit description for mapunits in the survey area where you reside. Sort the report by mapunit symbol.  to 19

20  Explained in queries  INNER JOIN 1:1 join  OUTER JOIN  LEFT  RIGHT  FULL

21  Add to exercise 1 and add to the report all components in the survey area and include the component restriction records that are available.  Send me a screen shot of the results in both txt and html format

EXEC SQL SELECT areasymbol, nationalmusym, muname, compname, reskind FROM area INNER JOIN legend by default INNER JOIN lmapunit by default INNER JOIN mapunit by default INNER JOIN correlation by default INNER JOIN datamapunit by default INNER JOIN component by default LEFT OUTER JOIN corestrictions by default; SORT BY nationalmusym. 22

23  Aggregation can be done in two methods  Group by  Aggregate  Use the previous query and use the Group By to count the number of reskind for each map unit.

EXEC SQL SELECT areasymbol, nationalmusym, reskind, count(*) as rowcount FROM area INNER JOIN legend by default INNER JOIN lmapunit by default INNER JOIN mapunit by default INNER JOIN correlation by default INNER JOIN datamapunit by default INNER JOIN component by default LEFT OUTER JOIN corestrictions by default GROUP BY areasymbol, nationalmusym, reskind;. 24

25  More functionality than GROUP BY  Aggregation by column  Allows Crosstab formatting  Aggregate by ROWS and by COLUMN  Row aggregation allowed in first SQL only  Sum, Average, First, Last, Min, Max, None, Unique and List

EXEC SQL select musym, muname, areaname, lmuaoverlap.areaovacres acres from mapunit, lmapunit, lmuaoverlap, laoverlap, area where join area to laoverlap and join laoverlap to lmuaoverlap and join lmapunit to lmuaoverlap and join lmapunit to mapunit; SORT BY musym SYMBOL, areaname AGGREGATE ROWS BY musym COLUMN muname UNIQUE, acres SUM CROSSTAB areaname CELLS acres.

Using a default html report, create a report that will provide the national map unit symbol, map unit name and list of components without duplicating the national map unit symbol and map unit name 28

EXEC SQL SELECT nationalmusym, muname, compname, comppct_r, repdmu FROM mapunit LEFT OUTER JOIN correlation by default LEFT OUTER JOIN datamapunit by default LEFT OUTER JOIN component by default; SORT BY nationalmusym SYM, comppct_r DESC AGGREGATE ROWS BY nationalmusym COLUMN compname NONE.

30  Purpose: Demonstrates the use of Templates, Sections and Column formats.  Problem: Change default report output from 3a to formatted output using these features.  Tables: mapunit, correlation, datamapunit, component.  References:  TEMPLATE statement (p. 58)  SECTION statement (p. 43)  Column Layout specs (p. 53)

31  Purpose: Demonstrates the use of Aggregation.  Problem: You wish to eliminate duplicated data in columns, using script from Example 4.  Tables: mapunit, correlation, datamapunit, component.  References:  Aggregation specs (p.26)

32  Purpose: Use knowledge from previous examples.  Problem: Using 3a script, create a new report with formatted columns and headings that show mapunit symbols, mapunit names, component names and percentages.  Sort by mapunit symbol  show dominant components first  eliminate duplicate symbols and mu names

33

34  Purpose: Demonstrates the use of Section Conditional statements.  Problem: Organize previous output in different fashion.  Tables: mapunit, correlation, datamapunit, component.  References:  SECTION statement (p. 43)

35  Purpose: Demonstrates the use of multiple queries and defining variables.  Problem: The list of components and associated crops are on different db paths.  Tables: mapunit, correlation, datamapunit, component.  References:  BASE TABLE statement (p. 4)  DEFINE statement (p. 5)  NMCASE statement (p.10)

36  Purpose: Demonstrates use of Property output.  Problem: You want to produce a listing of total AWC for each component in each map unit. Sort by musym, and rep comp percent  Tables: mapunit, correlation, datamapunit, component.  References:  DERIVE statement (p. 21)

37  Purpose: to use knowledge learned to create a data export format report.  Problem: Develop a data export report in comma-delimited format showing mapunit symbol, component name, and minimum representative depth to seasonal high water table for the dominant component in each mu. Sort by mapunit symbol.

38  Purpose: Demonstrates the use of headers to improve appearance of report.  Problem: Add page header to each page and a report title. List mapunit symbols and names. Show ssa name in report title.  References:  Header (p. 32)  Line specs (p. 47)