Question 17

GROUCHO WILLIAMS’ actor_id

Instruction
  • Write a query to return GROUCHO WILLIAMS' actor_id.
  • Actor's first_name and last_name are all stored as UPPER case in our database, and the database is case sensitive.

Table: actor

  col_name   | col_type
-------------+--------------------------
 actor_id    | integer
 first_name  | text
 last_name   | text

Sample results

 actor_id
----------
      1

Solution

postgres
SELECT actor_id 
FROM actor 
WHERE first_name = 'GROUCHO' 
AND last_name = 'WILLIAMS';

Explanation

This query is selecting the actor_id from the actor table where the first name is 'GROUCHO' and the last name is 'WILLIAMS'. It is likely trying to find a specific actor with those exact names.

Copied

Last Submission

postgres

No submission yet for this engine. Run and submit your query to save it here.

Copied
Expected results

Submit a query to compare against expected output.