คืนค่าการตั้งค่าทั้งหมด
คุณแน่ใจว่าต้องการคืนค่าการตั้งค่าทั้งหมด ?
ลำดับตอนที่ #1 : SQL I - Getting Data
Data
Analysis with SQL
What is a database?
Databases
A database
is a tool for storing strings of text and numbers. For example,
"posts" on social networking sites like Twitter and Progate
"lessons" are saved in databases.
Database
Structure
Databases manage data in tables like the one seen below on the left. Vertically,
the data is arranged in columns
and horizontally into rows.
With databases, it is possible to make many tables.
The
Table for this Lesson
For this lesson, we're going to use a table called purchases that contains data about orders made by the Progate characters while shopping online. Let's take a closer look in the exercise!
What
is SQL?
SELECT
In SQL, we use SELECT to retrieve data
from the database. Select statements are used to choose from which column you want to get data.
FROM
Usually, there are
several different tables saved in a database. For that reason, we need to use
an SQL FROM clause to
choose which table to
get columns from with a SELECT statement.
Completing SQL Statements
To
"complete" a statement in SQL, you put a semicolon at the very end. You can write SQL
statements on a single line, but to make it easier to read we'll use multiple
lines. Also, since SQL is not case-sensitive, you can use capitals or lowercase
when writing your code.
Selecting
Multiple Columns
Getting Data from Multiple Columns
When you want to get
data from multiple columns, you can use a comma to separate each column name,
as shown below.
Selecting From All Columns
When you want to get
all rows from a column of a table, you can use the *
character.
ความคิดเห็น