Tables

Introduction to SQL

Jasmin Ludolf

Senior Data Science Content Developer, DataCamp

Table naming

 

Table names:

  • Clear
  • Refer the data it contains(plural)
  • Lowercase
  • Use underscores—no spaces

the patrons table with incorrect table names crossed out in red

Introduction to SQL

Records and fields

  • Table rows are records
  • Table columns are fields

the patrons table with records and fields identified

Introduction to SQL

Records

  • A specific data observation

the patrons table with a single record highlighted

Introduction to SQL

Fields

  • One piece of a record the patrons table with a single field highlighted
Introduction to SQL

Field naming

 

Field names:

  • Lowercase
  • Use underscores—no spaces
  • Singular
  • Different from the table name
Introduction to SQL

Unique identifiers

  • Keys identify unique records

the patrons table with the id field indicated as a unique identifier

Introduction to SQL

Multiple tables

the patrons table and the checkouts table from the library database

patroncheckouts.png

Introduction to SQL

Let's practice!

Introduction to SQL

Preparing Video For Download...