Today’s Goals Yesterday we talked about different types of relationships in the IFRI database, the importance of keys, and how to interpret results of.

Slides:



Advertisements
Similar presentations
Build a database I: Design tables for a new Access database
Advertisements

Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
GCSE Computing#BristolMet Session Objectives# 21 MUST describe methods of validating data as it is input. SHOULD explain the use of key fields to connect.
Exploring Microsoft Access 2003 Chapter 6 Many-to-Many Relationships: A More Complex System.
M.S. Access Module CAS 133 Russ Erdman. M.S. Access Module Assignment Overview Two options for the unit: All students complete Units A, B and C In class.
Chapter 14 Getting to First Base: Introduction to Database Concepts.
3-1 Chapter 3 Data and Knowledge Management
1 The Information School of the University of Washington Nov 29fit forms © 2006 University of Washington More Forms INFO/CSE 100, Fall 2006 Fluency.
QUERYING A DATABASE By: Dr.Ennis-Cole. OBJECTIVES: Learn how to use the Query window in Design view Create, run and Save queries Define a relationship.
Database Software Application
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Database Relationships Objective 5.01 Understand database tables used in business.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Module 3: Table Selection
Database Design Concepts
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
1 Microsoft Access 2002 Tutorial 3 – Querying a Database.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Access Primer UoN workshop Naivasha, 30 July – 4 August 2006.
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
Access Primer Africamuseum 5 June MS Access  Relational Database Management System Data/information resides in series of related tables Principle.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
Microsoft ® Office Access ® 2007 Training Build a database I: Design tables for a new Access database ICT Staff Development presents:
CTFS Workshop Shameema Esufali Suzanne Lao Data coordinators and technical resources for the network
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
ISM 4212 Lab Creating DB Tables 02 copyright Lars Paul Linden 2007.
Databases. Not All Tables Are Created Equal Spreadsheets use tables to store data and formulas associated with that data The “meaning” of data is implicit.
1 Outline  What is a Primary Key?  AutoNumber primary keys  Single-field primary keys  Composite-field primary key  About Foreign Keys  Database.
Integrating field data and remote sensing to study secondary forests in Amazonian rural settlements Mateus Batistella Embrapa Satellite.
1 Entity-Relationship Diagram. 2 Components of ERD: –Entity –Relationship –Cardinality –Attributes.
Exploring Microsoft Access Chapter 6 Many-to-Many Relationships: A More Complex System.
1 Database & DBMS The data that goes into transaction processing systems (TPS), also goes to a database to be stored and processed later by decision support.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
1 The Information School of the University of Washington Dec 1fit advdatabases © 2006 University of Washington Advanced Database Concepts INFO/CSE.
Database revision.
ENTITY RELATIONSHIP DIAGRAM ENTITY RELATIONSHIP DIAGRAM IS A SPECIALIZED GRAPHIC THAT ILLUSTRATES THE INTERRELATIONSHIPS BETWEEN ENTITIES IN A DATABASE.
Relational Theory and Design
GIS Data Models GEOG 370 Christine Erlien, Instructor.
DataSet Your Database student test score Database Connection Your program needs to establish a connection to the database. Click on “Add New Data Source.”
Today’s Goals Answer questions about homework and lecture 2 Understand what a query is Understand how to create simple queries using Microsoft Access 2007.
Lesson 2: Designing a Database and Creating Tables.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
CTFS Workshop Shameema Esufali Asian data coordinator and technical resource for the network
A table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows.
Microsoft Access Database Creation and Management.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 25 I’m Suffering from Information Overload.
The Rent-A-Dress Database
DAY 18: ACCESS CHAPTER 3 Tazin Afrin October 22,
Introduction to Databases Angela Clark University of South Alabama.
Howard Paul. Sequential Access Index Files and Data File Random Access.
DAY 17: ACCESS CHAPTER 1-2 Rahul Kavi October 15,
COMPREHENSIVE Access Tutorial 1 Creating a Database.
Teanna Clarke 6aQ What is a Entity-Relationship Diagram?  An Entity-Relationship Diagram (ERD) is a tool that graphically shows the connections among.
ACCESS LESSON 1 DATABASE BASICS VOCABULARY. BACKSTAGE VIEW A menu of options and commands that allows you to access various screens to perform common.
Lecture 5 Data Model Design Jeffery S. Horsburgh Hydroinformatics Fall 2012 This work was funded by National Science Foundation Grant EPS
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
Starter Draw a mind map for topic 6 Databases. Objectives Revise topic CG3.6 Databases using various activities and ensure that topics covered are understood.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Databases: What they are and how they work
5.02 Understand database queries, forms, and reports used in business.
Database Design Chapters 17 and 18.
Use of SQL – The Patricia database
Presentation transcript:

Today’s Goals Yesterday we talked about different types of relationships in the IFRI database, the importance of keys, and how to interpret results of queries involving multiple tables Today we are going to talk about why there are 24 tables, how the tables are related to the paper forms, and how the tables are related to each other 1R. Kornak, AIT Training, July 2009

One-to-Many Relationship 1 Many 2 R. Kornak, AIT Training, July 2009

Many-to-Many Relationship Many SpeciesMany Trees 3R. Kornak, AIT Training, July 2009

IFRI Primary Keys A primary key is a unique number assigned to every record in a table The primary key of every IFRI table is named “ID” 4 R. Kornak, AIT Training, July 2009

IFRI Foreign Keys A foreign key specifies how records in one table are related to records in another table A foreign key displays the primary key of the record it is related to in another table The foreign keys of every IFRI table begin with “FK_” followed by the name of the table they link with 5 R. Kornak, AIT Training, July 2009

6

3 Types of IFRI Database Tables 7R. Kornak, AIT Training, July 2009

3 Types of Tables 1 Paper Form = 1 Database Table 1 Paper Form = Many Database Tables Tables necessary to link together forms that have many-to-many relationships –A forest can have many user groups –A user group can use many forests –The relationship between forests and user groups is many to many 8R. Kornak, AIT Training, July 2009

Why Do Some Forms Have Multiple Tables? 9R. Kornak, AIT Training, July 2009

Repeating Information Database tables do not contain repetitive information Database tables only contain information about 1 topic and level of detail at a time –Information about sites and forests is stored in two different tables You only see information repeated or about two different topics in the same table after you combine two or more tables in a query 10R. Kornak, AIT Training, July 2009

Translating Forms to Tables Most IFRI forms contain questions asking you to describe one object at a time – (a site, a settlement) Answers to all questions on the form apply to the whole object –All questions on the site form refer to the entire site –All questions on the settlement form refer to the entire settlement 11R. Kornak, AIT Training, July 2009

Translating Forms to Tables IFRI forms in which all questions refer to the same topic/level of detail have one table in the IFRI database. 12 Form LetterForm NameNumber of Tables Table Name OSite Overview1OVERSITE SSettlement1SETTLE AAssociation1ASSOC GForest-User Group Relationship1GRPTOFOR VForest Governance1GOVERN I (Part 1)Organization Inventory1ORGINVEN I (Part 2)Interorganizational Arrangements1INTERORG R. Kornak, AIT Training, July 2009

Forms with More than 1 Table Some forms contain questions about multiple levels of detail at the same time Why? Mostly to save paper and time! What if there were 1 paper form for every plant you measured or for every species in the forest? –You would have to write out the Top of Form information several hundred times! 13R. Kornak, AIT Training, July 2009

Repeating Information What happens when an IFRI form contains questions about more than one topic or level of detail at the same time? You need to store the information about each topic/level of detail in a separate table 14R. Kornak, AIT Training, July 2009

Translating Forms to Tables Four IFRI forms contain questions asking you to describe more than one object at the same time –Forest, Plot, User Groups, and Product Forms Answers to some questions on these forms DO NOT apply to the whole form 15R. Kornak, AIT Training, July 2009

The Forest form contains questions about two levels of detail at the same time –Level 1: The entire forest Has this forest been divided into forest management units? –Level 2: Individual species in the forest e.g. Biological name, local name, whether they are abundant, have they decreased over time, etc. Answers to these questions do not apply to the entire forest, only to the particular species 16 Example 1: Forest Form R. Kornak, AIT Training, July 2009

The Plot form contains questions referring to three levels of detail at the same time –Level 1: The entire plot: Is there evidence of livestock use within the forest plot? –Level 2: Individual species: What is the biological name; what is the local name? –Level 3: Individual plants: Plant type, DBH, height, % cover, stem count Answers to Level 2 and Level 3 questions do not apply to the entire plot 17 Example 2: Plot Form R. Kornak, AIT Training, July 2009

Example 3 Plot Form Let’s look at the Plot form and try to find questions with species level and plant level detail 18R. Kornak, AIT Training, July 2009

Plot Form Sections B,C, D 19 R. Kornak, AIT Training, July 2009

20R. Kornak, AIT Training, July 2009

Divide Tables by Topic Sections B, C, and D of the plot form contains questions about two different topics/levels of detail: species level and plant level We can store all of the species level information in one table because all three sections repeat the same questions –The table that contains species information found on the plot form is called F_ORGAN 21R. Kornak, AIT Training, July 2009

22R. Kornak, AIT Training, July 2009

23R. Kornak, AIT Training, July 2009

Plant Level Detail Let’s take a closer look at the questions about individual plants Notice that the questions about saplings, shrubs, and trees are the same –P_TYPE, P_DBH, P_HEIGHT While questions about ground cover are different –P_TYPE, P_PERCENT, P_STMCNT 24R. Kornak, AIT Training, July 2009

25 R. Kornak, AIT Training, July 2009

26R. Kornak, AIT Training, July 2009

Divide Tables by Topic Section B of the Plot Form contains questions about groundcover We can store all of the groundcover level information in one table –The table that contains groundcover information found on the plot form is called P_GCOVER 27R. Kornak, AIT Training, July 2009

28 Every row in the P_GCOVER table = 1 species For herbaceous plants (H), only percent cover recorded For Seedlings (S), only stem count recorded R. Kornak, AIT Training, July 2009

Divide Tables by Topic Sections C & D contain questions about plant types other than groundcover We can store all of this information in one table because both sections repeat the same questions –The table that contains plant information other than groundcover is called P_INFO 29R. Kornak, AIT Training, July 2009

Every row in the P_INFO table = 1 plant 30R. Kornak, AIT Training, July 2009

Queries with Plot Data If we want to create a query to study plot data, we will want to add several tables to our query Remember that the plot table itself does not specify the forest or site identification information 31R. Kornak, AIT Training, July 2009

Database Tables Related to Plot Information 32 Table NameDetail LevelImportance: OVERSITESiteUse to identify the site the plots belong to. FORESTForestUse to link to OVERSITE; identify forest that plots belong to PLOTPlotUse to link to FOREST; Questions referring to the entire plot (P Form, Section A, E) F_ORGANSpeciesContains species information from 1m, 3m, and 10 m plots (P Form, Section B,C,D) P_INFONon- Groundcover Contains plant type, DBH and height from 3m and 10 m plots (P Form, Section C,D) P_GCOVERGroundcoverContains plant type, % cover and stem counts from 1 m plot (P Form, Section B) R. Kornak, AIT Training, July 2009

Sample Query Designs 33 Every row in the P_INFO table = 1 tree Every row in the P_GCOVER table = 1 species R. Kornak, AIT Training, July 2009

Tips and Tricks When working with forms that have multiple database tables, it helps to think about each database table as its own form; one for each topic/level of detail 34R. Kornak, AIT Training, July 2009

Tips and Tricks For example, instead of a forest form and a plot form, we can think of these as five different forms 1. Forest Form 2. Plot Form –3. Species Sub-Form –4. Groundcover Plants Sub-Form –5. Other Plants Sub-Form 35R. Kornak, AIT Training, July 2009

Table Types & Relationships 36R. Kornak, AIT Training, July 2009

Review We talked about: –Why most forms have only 1 database table –Why some forms have many database tables –Why linking tables are needed to link tables with many-to-many relationships But how do these different types of tables relate to the Relationships Map? How does the Relationships Map relate to the paper forms? 37R. Kornak, AIT Training, July 2009

38 V A O S I -1I-2 G Forms w/ 1 Table R. Kornak, AIT Training, July 2009

39 Linking Tables for Many- to-Many Relationships R. Kornak, AIT Training, July 2009

40 P F U U U F F R R P F P P Forms w/ Many Tables R. Kornak, AIT Training, July 2009

Planning A Query Now that we know how to read the Relationships map, we can use it to figure out which tables we need to add to a query involving multiple tables 1.Locate all of the tables you are interested in on the relationships map 2.Notice how they link together. 3.Do you need to add any intermediate tables to your query? 41R. Kornak, AIT Training, July 2009

What We Know Now How to open the relationships map in Access How the paper forms relate to the relationships map How tables are related to each other by looking at the relationships map How to use the paper forms to figure out what the column names and data mean within each table How to connect tables together using queries 42R. Kornak, AIT Training, July 2009

What’s Next? With this knowledge we should be able to pick questions from the IFRI forms and extract the data for only these questions from the database! 43R. Kornak, AIT Training, July 2009

1.Choose the questions you are interested in using the IFRI manual 2.Write down the form names and field names corresponding to your chosen information 3.Figure out which tables contain the data 4.Locate those tables on the IFRI relationships map 5.You may want to draw a diagram showing your chosen tables and the relationships between them before attempting to do the actual query 6.Add all of the tables to a new query 7.Choose the attributes from each table 8.Run the query Steps to Design an Access Query 44R. Kornak, AIT Training, July 2009

Homework 1 Which tables do you need to link the following tables in a query? –Oversite and Usergroup –Oversite and Interorg –Oversite to Plot –Forest to Association –Settlement to Usergroup 45R. Kornak, AIT Training, July 2009

Homework 2 Which tables do you need to add to a query to find species information and DBH measurements of non-groundcover plants? Add them all to a query, select all fields from every table (* at the top of each table), and run your select query 46R. Kornak, AIT Training, July 2009

Homework 3 Which table stores species information (e.g. “the species form”)? Which table stores groundcover measurements (“the groundcover form”)? Which table stores non-groundcover plant measurements (“the non-groundcover form”)? 47R. Kornak, AIT Training, July 2009

Homework 4 If I’m interested in the site name, forest name, and plot latitude and longitude, do I need to add P_INFO, P_GCOVER, and F_ORGAN to my query? What does 1 row in the P_GCOVER represent? What does 1 row in the P_INFO table represent? 48R. Kornak, AIT Training, July 2009