Databases Intro Prep
Overview
It’s finally time to start thinking about organizing your data better than just a giant list or dictionary! Today we’ll be getting started with putting your data into a database and using a model to access it.
Basic Learning Objectives
Before class, you should be able to:
- Identify basic SQL commands
- Identify how to create a database table using postgres
Advanced Learning Objectives
After class, you should be able to:
- Create a postgres database and load data into it
- Execute basic SQL commands on your database
Readings
To achieve the basic learning objectives, you should read the following:
- The following sections of the SQLBolt tutorial:
- Intro to SQL
- Lesson 1: SELECT queries 101
- Lesson 2: Queries with constraints
- Lesson 3: Queries with constraints part 2
- Lesson 4: Filtering and Sorting
- Lesson 16: Creating tables
- SQL Create Table, note that Postgres has some small differences, so here is the Postgres Data Types for future reference
- Other sections of the tutorial may be useful reference depending on what you want to do for your project
Checks
Submit your answer to the following on Moodle:
- What does the following command (likely) do?
SELECT * FROM dragons WHERE age>6 ORDER BY age DESC; - You have many exisiting functions that access your data in your team project. Identify one that you can turn into a SQL query. What is the function currently doing (at a high level) and what would the query be?
You should also be able to answer the relevant exercises on W3Schools