![]() If someone adds more columns, your application may work but it gets more data than needed, which creates more I/O overhead between the database and application. What if someone removes a column, your application would not be working properly, because it assumes that there are three columns returned and the logic to process those three columns would be broken. Suppose, a table has 3 columns, and you use the asterisk (*) to retrieve the data from all three columns. When you develop an application, you should control what SQLite returns to your application. You should use the asterisk (*) for the testing purpose only, not in the real application development. #SQLPRO SET ATTRIBUTE SHOW VALUE CODE#To avoid this, you can use the asterisk (*), which is the shorthand for all columns of the table as follows: SELECT * FROM tracks Code language: SQL (Structured Query Language) ( sql ) To get data from all columns, you specify the columns of the tracks table in the SELECT clause as follows: SELECTįor a table with many columns, the query would be so long that time-consuming to type. You specify a list column names, which you want to get data, in the SELECT clause and the tracks table in the FROM clause. Tracks Code language: SQL (Structured Query Language) ( sql ) To get data from the tracks table such as trackid, track name, composer, and unit price, you use the following statement: SELECT The tracks table contains columns and rows. Let’s take a look at the tracks table in the sample database. You use the semicolon ( ) to terminate the statement.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |