Learn

Nice work! In one line of code, you returned information from a relational database.

SELECT * FROM celebs;

We’ll take a look at what this code means soon, for now, let’s focus on what relational databases are and how they are organized.

A relational database is a database that organizes information into one or more tables. Here, the relational database contains one table.

A table is a collection of data organized into rows and columns. Tables are sometimes referred to as relations. Here the table is celebs.

A column is a set of data values of a particular type. Here, id, name, and age are the columns.

A row is a single record in a table. The first row in the celebs table has:

  • An id of 1
  • A name of Justin Bieber
  • An age of 22

All data stored in a relational database is of a certain data type. Some of the most common data types are:

  • INTEGER, a positive or negative whole number
  • TEXT, a text string
  • DATE, the date formatted as YYYY-MM-DD
  • REAL, a decimal value

Instructions

Now that you have an understanding of what relational databases are, let’s take a closer look at SQL syntax.

Click Next to continue.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?