SQL > SQL Commands >
The SELECT keyword allows us to grab all information from a column (or columns) on a table. This, of course, necessarily means that there will be redundancies. What if we only want to select each DISTINCT element? This is easy to accomplish in SQL. All we need to do is to add DISTINCT after SELECT. The syntax is as follows:
SELECT DISTINCT "column_name"
For example, to select all distinct stores in Table Store_Information,
we key in,
SELECT DISTINCT Store_Name FROM Store_Information;
For these exercises, assume we have a table called Users with the following data:
1. Which of the following SQL statement is valid?
2. What's the result of the following query?
3. What's the result of the following query?