Jiyu
  • Blog
  • Dev
  • Leetcode
  • |
  • 中文

1050. Actors and Directors Who Cooperated At Least Three Times

April 28, 2022
sql

Actors and Directors Who Cooperated At Least Three Times - LeetCode

Write a SQL query for a report that provides the pairs (actor_id, director_id) where the actor has cooperated with the director at least three times. Return the result table in any order. The query result format is in the following example.


  • code
SELECT actor_id, director_id
FROM ActorDirector
GROUP BY actor_id, director_id
HAVING COUNT(*)>=3
« 785. Is Graph Bipartite?
586. Customer Placing the Largest Number of Orders »
    array 87
    backtracking 19
    bfs 21
    bible 1
    binarysearch 24
    binarysearchtree 13
    binarytree 17
    bit 18
    china 4
    christian 10
    design 8
    dfs 26
    docker 1
    documentary 2
    dostoevsky 1
    dp 36
    dynalist 3
    flask 1
    graph 12
    greedy 15
    hashtable 18
    health 3
    heap 15
    hugo 3
    intellij 2
    java 6
    leetcode-summary 11
    linkedlist 30
    linux 2
    math 29
    poetry 2
    psychology 3
    python 3
    queue 7
    recursion 6
    slidingwindow 3
    sorting 11
    spring 5
    spring-in-action 4
    sql 12
    stack 23
    string 30
    tool 11
    topological 3
    tree 17
    trie 10
    twopointers 8
    unionfind 9
    vscode 2
    warwick 5
    wittgenstein 3