E. Data Query Language (DQL)
By using DQL we can fetch data from the database.
1. SELECT
You use the SELECT command almost every time you query data with SQL. It allows you to define what data you want your query to return. By using the SELECT command with an asterisk () all of the columns in the table airbnb_listings* are returned.
TEXT/X-SQL
1SELECT * FROM airbnb_listings;
Using the following command we can find out all the neighborhoods we have listings in.
TEXT/X-SQL
1SELECT neighbourhood_group
2FROM airbnb_listings;
However you will notice there are duplicate results. To overcome this we use the SELECT DISTINCT command which will eliminate duplicates and only return distinct data.
TEXT/X-SQL
1SELECT DISTINCT neighbourhood_group
2FROM airbnb_listings;