Coder Social home page Coder Social logo

python-p3-intro-to-sql-table-relations's Introduction

Intro to Table Relations in SQL

Learning Goals

  • Use primary and foreign keys to create the relations in a relational database.
  • Use INNER JOIN and LEFT JOIN to retrieve relevant data for members of one table in other tables.
  • Use joins to create one-to-many and many-to-many relationships between tables.

Key Vocab

  • Primary Key: a number that uniquely identifies one record in a table.
  • Foreign Key: a column or group of columns that connects one table to another.
  • Join: a query that returns related records from multiple tables in a single record.
  • One-to-Many: a type of relationship between tables where one record in table A is connected to multiple records in table B. e.g. One person ordering multiple drinks at a bar.
  • Many-to-Many: a type of relationship between tables where multiple records in table A are connected to multiple records in table B. e.g. Students have many classes and classes have many students.

Introduction

The majority of databases you'll work with as a developer will have more than one table, and those tables will be connected together in various ways to form table relationships.

In this section we'll cover:

  • The structure of a relational database as tables
  • Primary key and foreign keys
  • How to associate data tables using a foreign key column
  • How to model one-to-many and many-to-many relationships
  • How a join table is used
  • Different types of joins

Over the next several lessons, we'll discuss having multiple tables in a database, how to define relationships between different tables, and explain the different types of table relationships that can exist.


Resources

python-p3-intro-to-sql-table-relations's People

Contributors

lizbur10 avatar professor-ben avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-p3-intro-to-sql-table-relations's Issues

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.