Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Retrieving Individual Columns | Retrieving Data
Introduction to SQL
course content

Course Content

Introduction to SQL

Introduction to SQL

1. Retrieving Data
2. Sorting Retrieved Data
3. Filtering Data
4. Advanced Data Filtering
5. Aggregate Functions

bookRetrieving Individual Columns

What is SQL?

Database

Why SQL Matters

SQL is essential for managing and querying databases efficiently. It is widely used due to its standardization, scalability, and ability to ensure data integrity. SQL's integration with other technologies makes it a versatile tool in various applications, supporting real-time data processing and decision-making.

Let's get started! In this course, we will work with a country database containing a country table. Let's look at this table.

SQL Syntax Explanation

To retrieve data from a database, SQL uses the SELECT statement. Here's the basic syntax:

  • SELECT: Specifies the columns to retrieve;
  • FROM: Specifies the table from which to retrieve the data.

For example, to get the sample column from the sample_table table, the syntax is:

The following query will return all entries in the continent column from the country table:

1
SELECT continent FROM country;
copy

In our previous query, we utilized the SELECT to retrieve a single continent column from the country table. It's important to note that you must specify the column name immediately after the SELECT keyword, and the FROM keyword specifies the name of the table from which we wish to retrieve data.

Task
test

Swipe to show code editor

Write an SQL query to retrieve a capital column from the country table.

Once you've completed this task, click the button below the code to check your solution.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 1
toggle bottom row

bookRetrieving Individual Columns

What is SQL?

Database

Why SQL Matters

SQL is essential for managing and querying databases efficiently. It is widely used due to its standardization, scalability, and ability to ensure data integrity. SQL's integration with other technologies makes it a versatile tool in various applications, supporting real-time data processing and decision-making.

Let's get started! In this course, we will work with a country database containing a country table. Let's look at this table.

SQL Syntax Explanation

To retrieve data from a database, SQL uses the SELECT statement. Here's the basic syntax:

  • SELECT: Specifies the columns to retrieve;
  • FROM: Specifies the table from which to retrieve the data.

For example, to get the sample column from the sample_table table, the syntax is:

The following query will return all entries in the continent column from the country table:

1
SELECT continent FROM country;
copy

In our previous query, we utilized the SELECT to retrieve a single continent column from the country table. It's important to note that you must specify the column name immediately after the SELECT keyword, and the FROM keyword specifies the name of the table from which we wish to retrieve data.

Task
test

Swipe to show code editor

Write an SQL query to retrieve a capital column from the country table.

Once you've completed this task, click the button below the code to check your solution.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 1
toggle bottom row

bookRetrieving Individual Columns

What is SQL?

Database

Why SQL Matters

SQL is essential for managing and querying databases efficiently. It is widely used due to its standardization, scalability, and ability to ensure data integrity. SQL's integration with other technologies makes it a versatile tool in various applications, supporting real-time data processing and decision-making.

Let's get started! In this course, we will work with a country database containing a country table. Let's look at this table.

SQL Syntax Explanation

To retrieve data from a database, SQL uses the SELECT statement. Here's the basic syntax:

  • SELECT: Specifies the columns to retrieve;
  • FROM: Specifies the table from which to retrieve the data.

For example, to get the sample column from the sample_table table, the syntax is:

The following query will return all entries in the continent column from the country table:

1
SELECT continent FROM country;
copy

In our previous query, we utilized the SELECT to retrieve a single continent column from the country table. It's important to note that you must specify the column name immediately after the SELECT keyword, and the FROM keyword specifies the name of the table from which we wish to retrieve data.

Task
test

Swipe to show code editor

Write an SQL query to retrieve a capital column from the country table.

Once you've completed this task, click the button below the code to check your solution.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

What is SQL?

Database

Why SQL Matters

SQL is essential for managing and querying databases efficiently. It is widely used due to its standardization, scalability, and ability to ensure data integrity. SQL's integration with other technologies makes it a versatile tool in various applications, supporting real-time data processing and decision-making.

Let's get started! In this course, we will work with a country database containing a country table. Let's look at this table.

SQL Syntax Explanation

To retrieve data from a database, SQL uses the SELECT statement. Here's the basic syntax:

  • SELECT: Specifies the columns to retrieve;
  • FROM: Specifies the table from which to retrieve the data.

For example, to get the sample column from the sample_table table, the syntax is:

The following query will return all entries in the continent column from the country table:

1
SELECT continent FROM country;
copy

In our previous query, we utilized the SELECT to retrieve a single continent column from the country table. It's important to note that you must specify the column name immediately after the SELECT keyword, and the FROM keyword specifies the name of the table from which we wish to retrieve data.

Task
test

Swipe to show code editor

Write an SQL query to retrieve a capital column from the country table.

Once you've completed this task, click the button below the code to check your solution.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 1. Chapter 1
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt