Git Product home page Git Product logo

dsc-sql-recap-nyc-ds-082619's Introduction

SQL and Relational Databases - Recap

Introduction

In this section, you learned how to construct different SELECT queries in SQL.

SELECT

The first part that you saw with SQL is how to select data from tables. You saw how to connect to a database and query basic data from a table using column names or the wildcard parameter *.

Filters

After looking at basic SELECT statements, you then saw how to filter your selections using the WHERE clause.

Ordering

Along with filtering, you also saw how to order your query selections. To do this, you use the ORDER BY clause. Remember that the default behavior there is to return results in ascending order. You can verbosely specify this with the ASC keyword, or modify the behavior to sort in descending order with the DESC keyword.

Grouping

Next up, you saw how to create aggregates with your data. This involved using the GROUP BY statement. You saw that you can both explicitly state the column names that you wish to group by or that you can use aliases for the columns using numbers such as 1,2,3. You also got to investigate some aggregate functions such as COUNT(), MAX(), MIN(), and AVG(). Finally, you also saw that you can filter based on the results of aggregate functions using the HAVING clause.

Joins

After taking a look at more complex queries for a single table, you started to investigate how you could combine data from multiple tables. You did this using the JOIN clause. Remember that you can specify the links between tables with the USING() clause if the column name is identical between the tables or the ON clause if you must specify the link more manually. You also saw how to alias table names during your joins.

Subqueries

With some of the more complicated join and aggregate scenarios that began to arise, you also saw how to use subqueries to break down complex queries into parts. You also saw how you could potentially create aggregates of aggregates using subqueries.

Database Administration

Wrapping up the section, you saw how to create databases, tables, and subsequently populate those containers with data. You also saw how to delete or modify information. Database administration is a complex topic that has a lot more considerations including user permissions and improving query execution time, but this was a solid introduction to get you up and running.

Summary

Congratulations! You should have a good amount of SQL skills to harness in your data adventures going forward! While you are apt to use other tools such as Pandas to do a lot of your exploratory analysis and data manipulation, databases provide a much more powerful data storage option then flat files like csv or excel workbooks.

dsc-sql-recap-nyc-ds-082619's People

Contributors

mas16 avatar loredirick avatar fpolchow avatar mathymitchell avatar

Watchers

James Cloos avatar Kevin McAlear avatar  avatar Mohawk Greene avatar Victoria Thevenot avatar Belinda Black avatar Bernard Mordan avatar raza jafri avatar  avatar Joe Cardarelli avatar The Learn Team avatar Sophie DeBenedetto avatar  avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Nicole Kroese  avatar Kaeland Chatman avatar Lisa Jiang avatar Vicki Aubin avatar Maxwell Benton avatar  avatar  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.