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 93
    backtracking 20
    bfs 24
    bible 1
    binarysearch 27
    binarysearchtree 14
    binarytree 25
    bit 17
    china 5
    christian 5
    design 8
    dfs 30
    docker 2
    documentary 2
    dostoevsky 1
    dp 41
    dynalist 3
    flask 1
    graph 11
    greedy 16
    hashtable 22
    health 1
    heap 15
    hugo 3
    intellij 2
    java 8
    javascript 1
    leetcode-summary 13
    linkedlist 33
    linux 2
    math 33
    poetry 4
    psychology 4
    python 3
    queue 7
    recursion 6
    remix 1
    segmenttree 1
    slidingwindow 6
    sorting 11
    spring 8
    spring-in-action 4
    sql 12
    stack 23
    string 36
    tool 12
    topological 3
    travel 1
    tree 12
    trie 10
    twopointers 10
    unionfind 9
    vscode 2
    warwick 5
    wittgenstein 3