Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer The SELECT Statement | Retrieving Data with SELECT
Practice
Projects
Quizzes & Challenges
Quizzen
Challenges
/
SQL Fundamentals: An Introductory Course

bookThe SELECT Statement

Veeg om het menu te tonen

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
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 1

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Sectie 2. Hoofdstuk 1
some-alt