Monday, January 24, 2011

The Frog Database

The AmphibiaWeb website shows the different amphibians in different regions of the world. The link will show you the amphibians in the United States, organized by U.S. states.

We are going to create a simple database that uses some of the data from this website. This post will use the data from Wyoming, located here.

The website contains the following columns from their database:
  • Scientific Name
  • Photo
  • Map
  • Sound
  • IUCN Red List Status
  • Vernacular Name
  • Family
Our database table will only utilize four of the columns:
  • Scientific Name
  • IUCN Red List Status
  • Vernacular Name
  • Family
Here will be our database structure:

Database: Amphibians
Table(s): Wyoming

First, lets create the database and table. We will only insert a few of the records:

  1. CREATE DATABASE Amphibians;
  2. GO
  3. USE Amphibians;
  4. GO
  5. CREATE TABLE Wyoming
  6. (
  7.     amph_ID INT IDENTITY(1,1) PRIMARY KEY
  8.     , scientific_Name VARCHAR(100)
  9.     , rl_Status VARCHAR(75)
  10.     , vernacular_Name VARCHAR(100)
  11.     , family VARCHAR(100)
  12. );
  13. INSERT INTO Wyoming
  14. (
  15.     scientific_Name
  16.     , rl_Status
  17.     , vernacular_Name
  18.     , family
  19. )
  20. VALUES
  21. (
  22.     'Bufo baxteri'
  23.     , 'Extinct in the Wild (EW)'
  24.     , 'Wyoming Toad'
  25.     , 'Bufonidae'
  26. );
  27. INSERT INTO Wyoming
  28. (
  29.     scientific_Name
  30.     , rl_Status
  31.     , vernacular_Name
  32.     , family
  33. )
  34. VALUES
  35. (
  36.     'Bufo boreas'
  37.     , 'Near Threatened (NT)'
  38.     , 'Western Toad'
  39.     , 'Bufonidae'
  40. );
  41. INSERT INTO Wyoming
  42. (
  43.     scientific_Name
  44.     , rl_Status
  45.     , vernacular_Name
  46.     , family
  47. )
  48. VALUES
  49. (
  50.     'Bufo cognatus'
  51.     , 'Least Concern (LC)'
  52.     , 'Great Plains Toad'
  53.     , 'Bufonidae'
  54. );
  55. INSERT INTO Wyoming
  56. (
  57.     scientific_Name
  58.     , rl_Status
  59.     , vernacular_Name
  60.     , family
  61. )
  62. VALUES
  63. (
  64.     'Bufo hemiophrys'
  65.     , 'Least Concern (LC)'
  66.     , 'Canadian Toad'
  67.     , 'Bufonidae'
  68. );

If you run a select all query on the new Amphibians table, you should get this result:

---------------------------------------------------------------------------------------

amph_ID scientific_Name rl_Status vernacular_Name family
1 Bufo baxteri Extinct in the Wild (EW) Wyoming Toad Bufonidae
2 Bufo boreas Near Threatened (NT) Western Toad Bufonidae
3 Bufo cognatus Least Concern (LC) Great Plains Toad Bufonidae
4 Bufo hemiophrys Least Concern (LC) Canadian Toad Bufonidae


I Break Code Where code gets done.
ASP.NET | HTML | SQL Server | VB.NET | Request A Topic |