Placeholder Image

字幕列表 影片播放

由 AI 自動生成
  • Hey there, future data wizards!

    嘿,未來的數據奇才們!

  • Let's look at the SELECT statement.

    讓我們看看 SELECT 語句。

  • Think of it as your trusty tool for picking data out of a database, like choosing your favorite candies from a jar. So let's get started.

    把它想象成你從數據庫中挑選數據的可靠工具,就像從罐子裡挑選你最喜歡的糖果一樣。讓我們開始吧。

  • The SELECT statement is used to grab data from a database.

    SELECT 語句用於從數據庫中抓取數據。

  • Here's a simple example to warm up.

    下面是一個簡單的熱身例子。

  • This code tells the database, "Hey, give me the customer name and city columns from the customers table." But how do we write this in a general form?

    這段代碼告訴數據庫:"嘿,給我客戶表中的客戶名稱和城市列"。但我們該如何以一般形式編寫呢?

  • Here's the syntax.

    文法如下

  • Column 1, column 2, etc. are the columns you want, and table name is the table you're getting them from. Now let's look at our demo database, the customers table.

    列 1、列 2 等是你想要的列,表名是從表中獲取的。現在讓我們看看演示數據庫中的客戶表。

  • Here's a sneak peek.

    讓我們先睹為快。

  • Let's do our SELECT statement from earlier: "SELECT customer name and city from customers." Pretty cool, right? But what if we want to see everything in the table?

    讓我們執行之前的 SELECT 語句:"SELECT customer name and city from customers"。很酷吧?但如果我們想查看錶中的所有內容呢?

  • We use the star wildcard, like this.

    我們使用星形通配符,就像這樣。

  • This tells the database, "Show me all the columns," and you get the whole shebang! And that's the basics of the SQL SELECT statement.

    這會告訴數據庫:"給我顯示所有列",然後你就能得到全部內容!這就是 SQL SELECT 語句的基本原理。

  • Easy peasy, right?

    輕而易舉,對吧?

  • Thanks for watching!

    感謝觀看!

  • Like and subscribe to get notified about our latest videos.

    點贊和訂閱可獲得我們的最新視頻通知。

  • For more coding tips and tricks, keep it locked right here on w3schools.com.

    更多編碼技巧和竅門,請鎖定 w3schools.com。

  • Don't forget to try out what you've learned in our interactive editor.

    別忘了在我們的互動編輯器中嘗試您所學到的知識。

  • Happy coding!

    快樂編碼

Hey there, future data wizards!

嘿,未來的數據奇才們!

字幕與單字
由 AI 自動生成

單字即點即查 點擊單字可以查詢單字解釋