Estimated reading time: 2 minutes
Building on how to select all records with SQL , you may want to learn how to get specific columns of data from your table.
Using SQLite again , we will now look to select two columns from the table below, namely name and iso_code.
The purpose of completing this, is to allow the user to start to only choose the data they want.
As a database becomes bigger and more complex, so does the ability to retrieve the data.
Furthermore the speed and turnaround time becomes more critical.
What is more if these queries are been used for real time applications:
- These results need to be precise to what is needed.
- Additionally the speed of them returning back the records needs to be quick.
Subsequently below is the query run off the above table that we will use:
As you can see it has returned the two columns we asked for, excluding the description column.
To conclude, one thing to note this returns all records, that currently exist on the table for those two columns.
To see a video tutorial on this, watch the full video below: