Giter Site home page Giter Site logo

060324-ph3-05-intro-to-sql's Introduction

Intro to SQL

While you're encouraged to code along with this lecture, it'll be more important that you're able to READ the SQL queries rather than write them.

Learning Goals

  • Create and destroy tables in a database

  • Create a new row in a table

  • Read rows in a table

  • The WHERE keyword

  • Update rows or a row in a table

  • Delete rows or a row in a table

  • Ordering rows

Getting Started

First please download the sqlite3 utility if you haven't already.

Mac:

brew install sqlite

Ubuntu:

sudo apt install sqlite3

Next clone this repository. You'll be able to open it in sqlite3 with sqlite3 main.db.

Exercises

  1. Create a new table cats with these attributes: name, age, cuteness. You determine the data types. You'll also need one more required column. Hint: what is always a required column for our databases?

  2. Within the table insert three cats of your choice.

  3. Confirm the cats exist by reading the table.

  4. Update one of the cats by updating all of its attributes.

  5. Delete the last cat from the database.

  6. When reading the table, order the cats by age in ascending order.

  7. BONUS: Use an aggregate query to get the average age for all cats. You'll have to look up how to do this.

060324-ph3-05-intro-to-sql's People

Contributors

brewchetta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.