Designing Databases for Biological Research
-
Upload
anjolie-duran -
Category
Documents
-
view
36 -
download
2
description
Transcript of Designing Databases for Biological Research
![Page 1: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/1.jpg)
Designing Databases for Biological Research
Brian R. Mitchell
Fall 2006
![Page 2: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/2.jpg)
Introduction
• Participants
• Syllabus• Website:
http://www.uvm.edu/~bmitchel/databases.html
• Database options at UVM
![Page 3: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/3.jpg)
What is a Database?
• Definition
• Keys
• Structured Query Language (SQL)
• Relationships
![Page 4: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/4.jpg)
Relationships
• One-to-one
Technicians Contact_Info
Amy Amy’s address
Joe Joe’s Address
Fred Fred’s Address
![Page 5: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/5.jpg)
Relationships
• One-to-many
Site Count_Data
286 (+ site fields) 286 (species 1)
286 (species 2)
286 (species 3)
![Page 6: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/6.jpg)
Relationships
• Many-to-many
Students Classes
Ralph BIO 165
Susan NR 385?
![Page 7: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/7.jpg)
Relationships
• Many-to-many
Students Classes
Ralph BIO 165
Susan NR 385
Schedule
Student & Class
![Page 8: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/8.jpg)
Why Use a Database?
![Page 9: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/9.jpg)
![Page 10: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/10.jpg)
Naming Conventions
• Keep it short
• Make it meaningful
• No spaces – use underscores “_”
• Avoid @#%$*& special characters
• Be consistent
![Page 11: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/11.jpg)
Naming Fields
• Be specific
• One piece of information per field
• No calculated fields
• Identify your keys
![Page 12: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/12.jpg)
Naming Objects
• Conventional abbreviations for objects:• Tables
– tbl = data table– tlu = lookup table– xref = linking table
• Queries = qry• Forms
– frm = form– frm_sub or fsub = subform
• Reports– rpt = report– rpt_sub or rsub = subreport
• Pages = pag (not widely used)• Macros = mac (not widely used)• Modules = mod
![Page 13: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/13.jpg)
Avoid Reserved Words
avg key propertycount max sectioncurrency memo setdate min sumdesc name time exists number typegroup order valueindex percent year
![Page 14: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/14.jpg)
Data Types
• AutoNumber• Currency• Date/Time• Hyperlink• Memo• Number• OLE• Text• Yes/No
![Page 15: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/15.jpg)
Database Design
• Single Database or Front End / Back End?
• Normalization
![Page 16: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/16.jpg)
Database Design
• Non-normalized
Spreadsheet-style
Site Date Observer Bird24 7/1/04 BRM BTBW24 7/1/04 BRM OVEN24 7/1/04 BRM YBSA
![Page 17: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/17.jpg)
Database Design
• First Normal Form (1NF)
Each field contains one value
NO YES
Coordinates UTM_E & UTM_N
Birds seen Separate table
![Page 18: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/18.jpg)
Database Design
• Second Normal Form (2NF)
If you have a composite key, no data relates to one of the keys
Example from Northwind database
![Page 19: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/19.jpg)
Database Design
• Third Normal Form (3NF)
Information in the table must not be related to a non-key field
Example from Northwind database
![Page 20: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/20.jpg)
Database Design
• Plan your database– Why bother?– Iterative process– Tables– Relationships– Fields– Rules
![Page 21: Designing Databases for Biological Research](https://reader036.fdocuments.us/reader036/viewer/2022062321/568132cd550346895d9993e4/html5/thumbnails/21.jpg)
Exercise
Tables FieldsSpecies Species_ID, Common, SciLocation Habitat, CoordinateVisit Time, Weather, DateSurvey Minute, species, vis/aud
Multiple visits to each location10 minute count during each visit: listens for each individual
of each species that can see or hear, records species, minute during count, visual/auditory