Soil Property Scripts National Soil Survey Center.

Slides:



Advertisements
Similar presentations
What is a Database By: Cristian Dubon.
Advertisements

Introduction to Excel Formulas, Functions and References.
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.
September 16-18, 2014 NSSC, Lincoln, NE Part I.  Introductions Who What Where  Expectations  What does each bring to the table, Talents  What “one.
1 Query-by-Example (QBE). 2 v A “GUI” for expressing queries. –Based on the Domain Relational Calulus (DRC)! –Actually invented before GUIs. –Very convenient.
Database Management Systems 3ed, Online chapter, R. Ramakrishnan and J. Gehrke1 Query-by-Example (QBE) Online Chapter Example is the school of mankind,
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Query-by-Example (QBE) Chapter 6 Example is the school of mankind, and they will learn at no.
AGGREGATE FUNCTIONS Prof. Sin-Min Lee Surya Bhagvat CS 157A – Fall 2005.
Database Systems More SQL Database Design -- More SQL1.
Introduction to Structured Query Language (SQL)
Attribute databases. GIS Definition Diagram Output Query Results.
A Guide to SQL, Seventh Edition. Objectives Retrieve data from a database using SQL commands Use compound conditions Use computed columns Use the SQL.
Databases in Soil Survey. Objectives Identify databases used for population, analysis, and publication of soils data Understand NASIS correlation concepts.
Microsoft Access 2010 Chapter 7 Using SQL.
QUERIES. OPEN THE QUERY TABLE. 2 What am I looking for?
Computer Science 101 Web Access to Databases SQL – Extended Form.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
NATIONAL SOIL SURVEY CENTER LINCOLN, NE USDA-NRCS UNDERSTANDING SOIL INTERPRETATIONS.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
Relational DBs and SQL Designing Your Web Database (Ch. 8) → Creating and Working with a MySQL Database (Ch. 9, 10) 1.
Chapter 3 Single-Table Queries
SQL Unit 5 Aggregation, GROUP BY, and HAVING Kirk Scott 1.
PHP meets MySQL.
Chapter 6 PHP Interacts with Mysql Database. Introduction In PHP, there is no consolidated interface. Instead, a set of library functions are provided.
Putting SSURGO to work Developing meaningful Soil Data with ArcGIS & Microsoft Access 2005 Users Conference.
Examining data using Microsoft Access Queries Using Criteria and Calculations SESSION 3.2 This section covers specifying an exact match condition in a.
1 Single Table Queries. 2 Objectives  SELECT, WHERE  AND / OR / NOT conditions  Computed columns  LIKE, IN, BETWEEN operators  ORDER BY, GROUP BY,
1 NASIS 6.1 and WSS 2.3 Updates Jim Fortner National Soil Survey Center April 20, 2011.
 Agenda 2/20/13 o Review quiz, answer questions o Review database design exercises from 2/13 o Create relationships through “Lookup tables” o Discuss.
BY SATHISH SQL Basic. Introduction The language Structured English Query Language (SEQUEL) was developed by IBM Corporation, Inc., to use Codd's model.
Views Lesson 7.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
SQL for Data Retrieval. Running Example IST2102 Data Preparation Login to SQL server using your account Select your database – Your database name is.
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.
Microsoft ® Office Excel 2003 Training Using XML in Excel SynAppSys Educational Services presents:
DATA RETRIEVAL WITH SQL Goal: To issue a database query using the SELECT command.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Aliya Farheen October 29,2015.
Access Queries Agenda 6/16/14 Review Access Project Part 1, answer questions Discuss queries: Turning data stored in a database into information for decision.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
NSF DUE ; Wen M. Andrews J. Sargeant Reynolds Community College Richmond, Virginia.
1 Working on your NASIS data in conjunction with a standardized OSD component prepared by your SDQS (4/16/ osd dmu tutorial)
PeopleSoft Financials Advanced Query Training Financial Information Systems and Reporting Controller’s Division
Agenda for Class - 03/04/2014 Answer questions about HW#5 and HW#6 Review query syntax. Discuss group functions and summary output with the GROUP BY statement.
QUERY CONSTRUCTION CS1100: Data, Databases, and Queries CS1100Microsoft Access1.
21 Copyright © 2009, Oracle. All rights reserved. Working with Oracle Business Intelligence Answers.
Aggregator  Performs aggregate calculations  Components of the Aggregator Transformation Aggregate expression Group by port Sorted Input option Aggregate.
Database Systems, 8 th Edition SQL Performance Tuning Evaluated from client perspective –Most current relational DBMSs perform automatic query optimization.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Create Stored Procedures and Functions Database Management Fundamentals LESSON 2.4.
CHAPTER 7 LESSON B Creating Database Reports. Lesson B Objectives  Describe the components of a report  Modify report components  Modify the format.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
Analysis Manager Training Module
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
Queries.
This shows the user interface and the SQL Select for a situation with two criteria in an AND relationship.
Intro to PHP & Variables
Prof: Dr. Shu-Ching Chen TA: Yimin Yang
Database Queries.
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
REPORT QUERY BUILDER featuring: Report Query Viewer.
Sirena Hardy HRMS Trainer
Chapter 4 Summary Query.
Prof: Dr. Shu-Ching Chen TA: Haiman Tian
SQL: Structured Query Language
M1G Introduction to Database Development
Contents Preface I Introduction Lesson Objectives I-2
Projecting output in MySql
Creating complex queries using nesting
Joins and other advanced Queries
Shelly Cashman: Microsoft Access 2016
Presentation transcript:

Soil Property Scripts National Soil Survey Center

Preliminaries Refresh your local database Refresh your local database Clear your selected set Clear your selected set Use the Pangaea query called: Area/Lmap/Mapunit/ MajorComp by AreaSym, AreaType Use the Pangaea query called: Area/Lmap/Mapunit/ MajorComp by AreaSym, AreaType Target Legend against the national database Target Legend against the national database Area type nat* Area type nat* Area symbol Interps Area symbol Interps Run it Run it

Preliminaries Use the same query against your local database Use the same query against your local database Target Area, Legend mapunit, correlation, and component Target Area, Legend mapunit, correlation, and component Areatype name nat* Areatype name nat* Area symbol Interps Area symbol Interps Run it Run it

Preliminaries Use the Pangaea query Component by COKEY the national database Use the Pangaea query Component by COKEY the national database Set the Cokey to Set the Cokey to Target datamapunit Target datamapunit Run it Run it Against the local database, use same cokey against the component table Against the local database, use same cokey against the component table Run it Run it Select that component in the Component Table Select that component in the Component Table

Function of Soil Property Scripts Provide data for interpretations, a high, low, and rv, one value for each, thus a main feature of property scripts is some variety of aggregation Provide data for interpretations, a high, low, and rv, one value for each, thus a main feature of property scripts is some variety of aggregation Provide data for report scripts Provide data for report scripts Act like a subroutine Act like a subroutine Normally aggregate columns, row aggregation is performed in the main SQL Normally aggregate columns, row aggregation is performed in the main SQL Property scripts are executed for one component at a time as the report cycles. This has ramifications for map unit aggregated reports. Property scripts are executed for one component at a time as the report cycles. This has ramifications for map unit aggregated reports.

Anatomy of a Simple Script Property Name: Must be unique per NASIS Site Description: Tells user what the script is meant to do. Data Type: Tells what kind of data is being retrieved Modality: Tells how many items Default Value: We try not to use any more Character or Numeric High and Low High, Low, and RV RV

Anatomy of a simple script You have seen Base Table with Paul. It becomes very evident what Base Table does when you realize there are no tables listed above component. All the coordination is done elsewhere. Exec sql acts just as in a report. Select is the same also This property will only retrieve the representative value of frost free days from the component table. Property scripts MUST produce at least an RV, by DEFINE or alias Push the green button when a component is highlighted and the property runs

Data Aggregation in the SQL This script: Makes this output: Note aggregation of none Note a value for each layer. These are arrays of data, which we will look at more closely later.

Data Aggregation in the SQL This script: Makes this output: Note aggregation of none Note a value for each layer. These are arrays of data, which we will look at more closely later.

Data Aggregation in the SQL This script: Makes this output: Since default aggregation is unique, any repeats are combined.

Data Aggregation in the SQL This script: Makes this output: Since default aggregation is unique, any repeats are combined.

Data Aggregation in the SQL This script: Makes this output: Since default aggregation is unique, any repeats are combined. Other aggregation types are max, min, last, unique, sum, list, and a few others. Usually use none to preserve all the data for future use.

Deriving data using other properties This script: Makes this output: Since default aggregation is unique, any repeats are combined. Other aggregation types are max, min, last, unique, sum, list, and a few others. Usually use none to preserve all the data for future use. This is a called property

Derive data Advantages Script is less cluttered Reduces amount of typing Helps control aggregation problems Disadvantages Longer run time Might hide some unexpected conditions, for example might mismatch restriction kinds with the main property

Data Aggregation using Define, Array functions ARRAYMIN ARRAYMIN ARRAYMAX ARRAYMAX ARRAYMEDIAN ARRAYMEDIAN ARRAYMODE ARRAYMODE In the context of properties, these are used mainly to aggregate horizon table data to get one number for a component

Data Aggregation: DEFINE Array Functions This script: Makes this output:

Data Aggregation: Weighted Average This script: Makes this output: These arrays must be the same size!!

Data Aggregation: Lookup This script: Makes this output: arraymax finds the thickest layer, the lookup finds the pct_r that is associated with that layer

Data Aggregation below the Horizon table This script: Makes this output: arraymax finds the thickest layer, the lookup finds the pct_r that is associated with that layer If you try to aggregate this script in the SQL or by using an array function, you will get just one number for each column from the whole component, but what we want to do here is find a volumetric CEC. So we need to account for the rock fragments by layer. We would like to combine the rock fragment volumes by layer to adjust the CEC. The answer is REGROUP.

Data Aggregation below the Horizon table: REGROUP This script: Makes this output: REGROUP of fragments by layer using the SUM method of aggregation. Careful attention is needed to get the syntax correct using REGROUP. Other REGROUP options are AVERAGE, FIRST, LAST, MIN, MAX, and LIST Properties usually iterate on the base table component, so a device like regroup is needed to give an ability to aggregate at a deeper level.

Assignment WTD_AVG CLAY CONTENT cm OR ABOVE RESTRICTION WTD_AVG CLAY CONTENT cm OR ABOVE RESTRICTION Make the above script return the weighted average total sand content from 15 to 100cm. Make the above script return the weighted average total sand content from 15 to 100cm.

Reporting Property Output No mapunit aggregation No mapunit aggregation Map unit aggregation Map unit aggregation INTERP - (NAT) Single Property Script Representative Values UTIL - (NAT) MU Aggregated Property Data (Dom Comp) INTERP – (NAT) Property Script Output, Numeric, MU Aggregated

That cant be done?