To 🔥 celebrate the holiday season, Also check out our NEWLY launched Annual plan (Up to 50% off). Use coupon code THANKSGIVING15 and enjoy additional 15% off all paid plans. Coupon expires at 2020/11/30 .
57. Total number of actors (with UNION) easy

Instruction

  • Write a query to return the total number of actors using UNION.
  • Actor who appeared in both tv and movie has the same value of actor_id in both actor_tv and actor_movie tables.

Table 1: actor_movie

Actors who appeared in a movie.

  col_name  | col_type
------------+-------------------
 actor_id   | integer
 first_name | character varying
 last_name  | character varying

  

Table 2: actor_tv

Actors who appeared in a TV show.

  col_name  | col_type
------------+-------------------
 actor_id   | integer
 first_name | character varying
 last_name  | character varying

  

Sample results

 count
-------
   123

Subscribe for solution