Importing Data (Database Control)
This example will walk you through how to get data that already exists into SQLite.
- Download the main table for the Portal Project mammal database. It’s kind of large so it might take a few seconds. The full database is available on GitHub and updated monthly. We’ll use a simplified version in class.
- Create a new database by clicking on
New Databasein theDatabasedrop down menu. Typeportal_mammalsfor the name, clickOKand choose where to save the file. - Click on the
Importicon. - Click on
Select Fileand navigate to where you saved the data file and select it. - Select
CSV. You can also import from SQL databases or modify theFields separatedorenclosed by. Make sure to selectFirst row contains column names. - Click
OKwhen it asks if you want to modify the data. - Name the table that you are importing into
surveys. - Identify the type for each field, using the
Data Typedrop-down menus. If it is not obvious if the data type is anINTEGERorVARCHARfor each variable, check the metadata. Important: if you specify the wrong data type it can cause some data to not be imported and/or prevent you from doing some kinds of data manipulations. - Select
recordIDas thePrimary Keyand clickOK. - Click
OKwhen asked if you are sure you want to import the data. - Now import the plots, and species tables.