Opportunity Through Data Textbook
  • Opportunity Through Data Textbook
  • Introduction
    • What is Data Science?
    • Introduction to Data Science: Exploratory Musical Analysis
  • Module 1
    • Introduction to Programming
      • The Command Line
      • Installing Programs
      • Python and the Command Line
      • Jupyter Notebook
    • Introduction to Python
      • Building Blocks of Python - Data Types and Variables
      • Functions
      • Formatting and Syntax
    • Math Review
      • Variables and Functions
      • Intro to Graphs
  • Module 2
    • Data Structures
      • Lists
      • Dictionaries
      • Tables
    • Programming Logic
      • Loops
      • Logical Operators
      • Conditionality
  • Module 3
    • Introduction to Probability
      • Probability and Sampling
    • Introduction to Statistics
      • Mean & Variance
      • Causality & Randomness
  • Module 4
    • Packages
    • Intro to NumPy
      • NumPy (continued)
  • Module 5
    • Introduction to Pandas
      • Introduction to Dataframes
      • Groupby and Join
    • Working with Data
    • Data Visualization
      • Matplotlib
      • Introduction to Data Visualization
  • Appendix
    • Table Utilities
    • Area of More Complicated Shapes
    • Introduction to Counting
    • Slope and Distance
    • Short Circuiting
    • Linear Regression
    • Glossary
  • Extension: Classification
    • Classification
    • Test Sets and Training Sets
    • Nearest Neighbors
  • Extension: Introduction to SQL
    • Introduction to SQL
    • Table Operations
      • Tables and Queries
      • Joins
  • Extension: Central Limit Theorem
    • Overview
    • Probability Distributions
      • Bernoulli Distribution
      • Uniform Distribution (Discrete)
      • Random Variables, Expectation, Variance
      • Discrete and Continuous Distributions
      • Uniform Distribution (Continuous)
      • Normal Distribution
    • Central Limit Theorem in Action
    • Confidence Intervals
  • Extension: Object-Oriented Programming
    • Object-Oriented Programming
      • Classes
      • Instantiation
      • Dot Notation
      • Mutability
  • Extension: Introduction to Excel
    • Introduction to Excel
      • Terminology and Interface
      • Getting Started with Analysis and Charts
      • Basics of Manipulating Data
    • Additional Features in Excel
      • Macros
      • The Data Tab
      • Pivot Tables
Powered by GitBook
On this page

Was this helpful?

  1. Extension: Introduction to SQL

Introduction to SQL

What is SQL? What do we used it for?

This module will provide an introduction to Structured Query Language, or SQL (pronounced "sequel"). SQL is a programming language that facilitates storing, retrieving, or manipulating specific information from databases. With its relatively simple syntax and power to access/organize great quantities of data, SQL is often one of the top languages used by business and data analysts to retrieve information.

Data is stored in tables which are identified in SQL by their names. SQL applies loops, filtering, functions, and then ordering and limiting the data to manipulate the table into the desired final output. Clauses such as "select", "from", "where", and "order by" are used to do so!

Say we have a table "dogs" that contains information about the dogs at a Berkeley animal shelter. This table contains information about the dog's name, breed, and age (in months).

Name

Breed

Age (years)

Louis

French Bulldog

13

Lucy

Yellow Lab

2

Bailey

Beagle

1

Charlie

Border Collie

4

Milo

German Shepherd

6

Joe

Beagle

15

Now, say we wanted to filter this data so that we only have the dogs whose breed is Beagle. We could use SQL to do so!

select * from dogs where breed = "Beagle";

The output of this code would be a table that looks something like the following.

Name

Breed

Age

Bailey

Beagle

1

Joe

Beagle

15

Don't worry about understanding this code yet! This page is solely meant to introduce you to this module on SQL and give you an idea about how we can use SQL in data science!

PreviousNearest NeighborsNextTable Operations

Last updated 4 years ago

Was this helpful?