Lesson 1 of 0
In Progress

Retrieving Data with SELECT statements

Kedeisha June 16, 2023

In this lesson, we will explore the SELECT statement, which is the fundamental SQL statement used to retrieve data from one or more tables in a database. We will cover the basics of constructing SELECT statements, selecting specific columns, and retrieving data from tables.

Overview of SELECT Statements

The SELECT statement is used to query and retrieve data from a database. It allows you to specify the columns you want to retrieve and filter the data based on specific criteria. The basic syntax of a SELECT statement is as follows:

				
					SELECT 
    column1, 
    column2, 
FROM table_name;

				
			

Selecting All Columns 

You can retrieve all columns from a table or select specific columns by specifying them in the SELECT clause. Please note that selective all columns is not general good practice. In the real world, you would rarely select every column, but we will show you the functionality. 

				
					SELECT *
FROM table_name;

				
			

Selecting Specific Columns

A table can have too many rows to select all at once. You can communicate to the database to retrieve the specific columns you need. 

				
					SELECT 
    column1,
    column2, ...
FROM table_name;