Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте The SELECT Statement | Retrieving Data with SELECT
Practice
Projects
Quizzes & Challenges
Вікторини
Challenges
/
SQL Fundamentals: An Introductory Course

bookThe SELECT Statement

Свайпніть щоб показати меню

When you want to retrieve information from a database, you use the SELECT statement. This is the most fundamental SQL command for querying data. The SELECT statement allows you to specify exactly which data you want to see from one or more tables in your database. Whether you need all the data or just a few specific pieces of information, SELECT is your main tool for asking questions and getting answers from your tables.

1
SELECT * FROM students;
copy

Often, you do not need every column from a table. You can tailor your results by specifying which columns you want to see. To do this, list the column names you are interested in after the SELECT keyword, separated by commas. For example, if you only want to see the first names and enrollment years of students, you can write a query that selects just those columns.

1
SELECT first_name, enrollment_year FROM students;
copy

Sometimes, you may want to make your output easier to read or better reflect the meaning of your data by renaming columns in your query results. You can do this using a column alias with the AS keyword. An alias gives a temporary name to a column in your result set, making it more descriptive or suitable for your needs.

1
SELECT first_name AS "Student Name", enrollment_year AS "Year Enrolled" FROM students;
copy
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 1

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Секція 2. Розділ 1
some-alt