The result of that "query" is simply the number 100, returned as a single column (with a header of 100) and a single row. We asked the database to "select the number 100" and it obliged. Also, text is a lot easier to produce for these tutorials. This is partly to emphasize that whatever graphical client we use is merely a user-friendly shell for the code we execute. The result should look something like this (note that I've left off the semi-colon, which is optional here but is generally used to denote the end of a command):įrom this point on, I’ll be displaying the input and output of these examples as just text, rather than screenshotting the GUI. Then hit the Play button (or better yet, the keyboard shortcut: Ctrl + Return). If you are using the client, DB Browser for SQLite, select the Execute SQL tab and type the following into the first input box: SELECT 100 Open a database file – I'm assuming you've downloaded and unzipped the following file: As a corollary – if you read the excerpt above – this means most what we generally do with SQL databases does not alter the data, i.e. There's not many kinds of statements in SQL, and 95% of our queries will involve using the SELECT statement. A SELECT statement does not make any changes to the database. The result of a SELECT is zero or more rows of data where each row has a fixed number of columns. You can guess what the SELECT statement does: it's what we use to query the database for data. Trying to select from a non-existent table.Trying to select columns without a table.Using the FROM clause to select data from tables.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |