Actors and Directors Who Cooperated At Least Three Times
<p>Table: <code>ActorDirector</code></p>

<pre>
+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| actor_id    | int     |
| director_id | int     |
| timestamp   | int     |
+-------------+---------+
timestamp is the primary key (column with unique values) for this table.
</pre>

<p>&nbsp;</p>

<p>Write a solution to find all the pairs <code>(actor_id, director_id)</code> where the actor has cooperated with the director at least three times.</p>

<p>Return the result table in <strong>any order</strong>.</p>

<p>The result format is in the following example.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> 
ActorDirector table:
+-------------+-------------+-------------+
| actor_id    | director_id | timestamp   |
+-------------+-------------+-------------+
| 1           | 1           | 0           |
| 1           | 1           | 1           |
| 1           | 1           | 2           |
| 1           | 2           | 3           |
| 1           | 2           | 4           |
| 2           | 1           | 5           |
| 2           | 1           | 6           |
+-------------+-------------+-------------+
<strong>Output:</strong> 
+-------------+-------------+
| actor_id    | director_id |
+-------------+-------------+
| 1           | 1           |
+-------------+-------------+
<strong>Explanation:</strong> The only pair is (1, 1) where they cooperated exactly 3 times.
</pre>

[]
['Create table If Not Exists ActorDirector (actor_id int, director_id int, timestamp int)', 'Truncate table ActorDirector', "insert into ActorDirector (actor_id, director_id, timestamp) values ('1', '1', '0')", "insert into ActorDirector (actor_id, director_id, timestamp) values ('1', '1', '1')", "insert into ActorDirector (actor_id, director_id, timestamp) values ('1', '1', '2')", "insert into ActorDirector (actor_id, director_id, timestamp) values ('1', '2', '3')", "insert into ActorDirector (actor_id, director_id, timestamp) values ('1', '2', '4')", "insert into ActorDirector (actor_id, director_id, timestamp) values ('2', '1', '5')", "insert into ActorDirector (actor_id, director_id, timestamp) values ('2', '1', '6')"]
[{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"value": "pythondata", "text": "Pandas", "defaultCode": "import pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n    "}, {"value": "postgresql", "text": "PostgreSQL", "defaultCode": "-- Write your PostgreSQL query statement below\n"}]
{"mysql": ["Create table If Not Exists ActorDirector (actor_id int, director_id int, timestamp int)"], "mssql": ["Create table ActorDirector (actor_id int, director_id int, timestamp int)"], "oraclesql": ["Create table ActorDirector (actor_id int, director_id int, timestamp int)"], "database": true, "name": "actors_and_directors", "pythondata": ["ActorDirector = pd.DataFrame([], columns=['actor_id', 'director_id', 'timestamp']).astype({'actor_id':'int64', 'director_id':'int64', 'timestamp':'int64'})"], "manual": false, "postgresql": ["Create table If Not Exists ActorDirector (actor_id int, director_id int, timestamp int)"], "database_schema": {"ActorDirector": {"actor_id": "INT", "director_id": "INT", "timestamp": "INT"}}}
{"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16</p>"]}
['Database']