Optimised Approach || Group By
IntuitionWe need to find actor-director pairs who have collaborated on 3 or more movies. By grouping by both actor_id and director_id, we can count the number o
# Intuition
We need to find actor-director pairs who have collaborated on 3 or more movies. By grouping by both actor_id and director_id, we can count the number of times each pair has worked together. Using HAVING COUNT(timestamp) >= 3, we filter the pairs with 3 or more collaborations.

# Approach
1. Group by both actor_id and director_id to aggregate data by actor-director pairs.

2. Count the number of collaborations (using timestamp or any other field that indicates a collaboration).

3. Filter the pairs where the count of collaborations is 3 or more using HAVING.

# Please upvote guys...!!

# Code
```mysql []
# Write your MySQL query statement below
SELECT actor_id, director_id
FROM ActorDirector
GROUP BY actor_id, director_id
HAVING COUNT(timestamp)>=3
```
['MySQL']