
Retrieving data with SELECT - Assignments
1. Retrieving all data of all actors
Complete the following query to obtain all data from the actors table.

- Use the
SELECTandFROMstatements.
| id | first_name | last_name | gender | film_count |
|---|---|---|---|---|
| 933 | Lewis | Abernathy | M | 1 |
| 2547 | Andrew | Adamson | M | 1 |
| 2700 | William | Addy | M | 1 |
| ... | ... | ... | ... | ... |
2. Retrieving the number of actors
Complete the following query to calculate the number of rows (number of actors) in the actors table.
You should see a number as a result.
- Use the
SELECTandFROMstatements. - Use the
COUNT()function.
| count |
|---|
| 1907 |
3. Retrieving first and last names of actors
Complete the following query to obtain data from the first_name and last_name columns from the actors table.
- Use the
SELECTandFROMstatements.
| first_name | last_name |
|---|---|
| Lewis | Abernathy |
| Andrew | Adamson |
| William | Addy |
| ... | ... |
4. Retrieving unique first names
Complete the following query to obtain unique values from the first_name column from the actors table.
- Use the
SELECTandFROMstatements. - Use the
DISTINCTstatement.
| first_name |
|---|
| Giovanni |
| Carly |
| Ewan (I) |
| ... |
5. (Extra) Retrieving the number of unique first names
Create a query to calculate the number of unique first names in the actors table.
| count |
|---|
| 1198 |