If you're seeing this message, it means we're having trouble loading external resources on our website.

如果你被网页过滤器挡住,请确保域名*.kastatic.org*.kasandbox.org 没有被阻止.

主要内容
当前时间:0:00总时长:2:05

视频字幕

the world is full of data every app that you use is full of data on Khan Academy we store data about users and badges and progress on Facebook they store data about who you are who your friends are what they're posting on Bank of America they store data about how much money you have and what account sets in how do these apps store data will they use a database which is a program that helps store data and provides functionality for adding modifying and querying that data and doing that all fast database is common many forms but a really popular type of database is called a relational database it stores each kind of data in a table which is kind of like storing data in a spreadsheet a row represents an item and a column represents properties about that item for example to store data about Khan Academy users we'd have a user's table with a row for each user and columns for properties like their nickname and location relational databases make it particularly easy to form relationships between tables for example in order to store Khan Academy users and their badges we might have a user's table and a badges table and then a user badges table to remember which users earned which badges just by mapping user IDs to badge IDs that's a more efficient form of storage than having to repeat everything about the user and everything about the badge in the user badges table most databases come with a query language to interact with the database SQL is a language designed entirely for accessing databases and is the most popular of them with SQL we can create tables change data get back today that we're interested in like we've want to find out which users joined in last week or which users have a particular badge that's what we're going to teach here and you'll actually get to try out SQL here in the browser using SQL Lite a particular implementation of it you won't be able to write the whole app here but when you're done learning SQL you'll have a much better understanding of how data is stored in the apps that you use and be able to use SQL if you ever built an app