ตั้งค่าการอ่าน

ค่าเริ่มต้น

  • เลื่อนอัตโนมัติ
    SQL

    ลำดับตอนที่ #1 : SQL I - Getting Data

    • เนื้อหาตอนนี้เปิดให้อ่าน
    • 99
      0
      4 ม.ค. 62

    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.

     

     



    ติดตามเรื่องนี้
    เก็บเข้าคอลเล็กชัน

    นิยายที่ผู้อ่านนิยมอ่านต่อ ดูทั้งหมด

    loading
    กำลังโหลด...

    อีบุ๊ก ดูทั้งหมด

    loading
    กำลังโหลด...

    ความคิดเห็น

    ×