Understanding SQL SELECT Statement

ViaByte.Net

SELECT first_name, last_name, email FROM employees;

This query will only return the “first_name,” “last_name,” and “email” columns from the “employees” table.

Alias Names

You can use alias names to provide a temporary name for a column or table in the query result. This can make the output more readable or when the column or table names are lengthy. Here’s an example:

SELECT first_name AS "First Name", last_name AS "Last Name" FROM employees;

 

Bagikan:

Tinggalkan komentar