Git Product home page Git Product logo

sql-examples's Introduction

SQL Examples

This repository uses the CITES Trade Dataset to create example SQL queries. These queries show how to perform all of the basic SQL operations. More advanced (or possibly intermediate) queries are performed in extra examples to explain how to perform certain tasks or to tell a specific story found within the data.

Basic Examples

  • SELECT
  • DISTINCT
  • WHERE
  • ORDER BY
  • NULL Values
  • GROUP BY
  • Aggregate Functions (MIN, MAX, SUM, etc.)
  • INNER JOIN
  • LEFT JOIN
  • RIGHT JOIN
  • OUTER JOIN
  • UNION
  • HAVING
  • EXISTS
  • CASE

Advanced Examples

Falcons

The Falcons examples explore records which involve the Falco genus. Results can be directly piped into Matplotlib functions to plot different graphs to visually show SQL data.

  • Extracting Data For Bar and Line Graphs
  • Inner Joins
  • Casting Values To Data Types

Nations

The Nations examples look at differences between European territories in the CITES table such as how much they import and export, as well as what species are popular. One single query is created at the end which collates all of the data explored.

  • Creating and Dropping Tables
  • Inserting Values Into Tables
  • RANK() OVER() Function
  • Subqueries
  • The IN Operator

Time Series

The Time Series examples look at several different time series problems in SQL, including:

  • Moving Averages
  • Running Totals
  • Percentage Growth

Data

The main data used in this repository relates to animal trades tracked by CITES, and can be obtained from the CITES website. This corresponds to the cites table in the database, which has been prefiltered to only include species in the class "Aves".

Supplementary data has been obtained from Leicestershire and Rutland Ornithology Society, and corresponds to the LeicestershireBirds table in the database.

sql-examples's People

Contributors

curtisthompson avatar

Watchers

 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.