question_slug stringlengths 3 77 | title stringlengths 1 183 | slug stringlengths 12 45 | summary stringlengths 1 160 ⌀ | author stringlengths 2 30 | certification stringclasses 2
values | created_at stringdate 2013-10-25 17:32:12 2025-04-12 09:38:24 | updated_at stringdate 2013-10-25 17:32:12 2025-04-12 09:38:24 | hit_count int64 0 10.6M | has_video bool 2
classes | content stringlengths 4 576k | upvotes int64 0 11.5k | downvotes int64 0 358 | tags stringlengths 2 193 | comments int64 0 2.56k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
replace-all-s-to-avoid-consecutive-repeating-characters | C++ beats 100%. use a, b or c to fill | c-beats-100-use-a-b-or-c-to-fill-by-cind-0q5v | \nclass Solution {\npublic:\n string modifyString(string s) {\n for (int i=0;i<s.size();i++){\n if (s[i] == \'?\'){\n if (i | cindy7b | NORMAL | 2020-12-02T06:06:28.238054+00:00 | 2020-12-02T06:06:28.238098+00:00 | 97 | false | ```\nclass Solution {\npublic:\n string modifyString(string s) {\n for (int i=0;i<s.size();i++){\n if (s[i] == \'?\'){\n if (i > 0 && i < s.size()-1){\n if ((s[i+1] ==\'a\' || s[i+1] ==\'b\') && (s[i-1] ==\'a\' || s[i-1] ==\'b\')){\n s[i] = \... | 1 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MY SQL || SOLUTION | my-sql-solution-by-_himanshu_12-rw7o | GROUP BY:\n\nselect actor_id, director_id \nfrom(\nselect actor_id,director_id, \ncount(timestamp) as cooperated \nfrom ActorDirector \ngroup by actor_id,direct | _himanshu_12 | NORMAL | 2022-10-01T10:58:16.218509+00:00 | 2022-10-01T11:12:39.520904+00:00 | 25,985 | false | ***GROUP BY:***\n```\nselect actor_id, director_id \nfrom(\nselect actor_id,director_id, \ncount(timestamp) as cooperated \nfrom ActorDirector \ngroup by actor_id,director_id) \ntable1\nwhere cooperated>=3;\n```\n\n***GROUP WITH HAVING CLAUSE:***\n```\nselect actor_id,director_id\nfrom ActorDirector \ngroup by actor_id... | 266 | 0 | ['MySQL'] | 19 |
actors-and-directors-who-cooperated-at-least-three-times | Concise MySQL Solution Using HAVING Clause | concise-mysql-solution-using-having-clau-2ty8 | SQL\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(1) >= 3\n\n | zac4 | NORMAL | 2019-05-23T04:38:31.066287+00:00 | 2019-07-24T05:41:08.920158+00:00 | 17,342 | false | ```SQL\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(1) >= 3\n```\n | 58 | 2 | [] | 5 |
actors-and-directors-who-cooperated-at-least-three-times | Simple Solution with GROUP BY | simple-solution-with-group-by-by-simanti-yd04 | \nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(timestamp)>=3\n | simantiri | NORMAL | 2021-01-19T18:35:08.144298+00:00 | 2021-01-19T18:35:08.144363+00:00 | 5,536 | false | ```\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(timestamp)>=3\n``` | 31 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Pandas vs SQL | Elegant & Short | All 30 Days of Pandas solutions ✅ | pandas-vs-sql-elegant-short-all-30-days-ggdsj | Complexity\n- Time complexity: O(n)\n- Space complexity: O(n)\n\n# Code\nPython []\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n | Kyrylo-Ktl | NORMAL | 2023-08-04T14:58:02.907714+00:00 | 2023-08-06T17:21:53.154178+00:00 | 3,783 | false | # Complexity\n- Time complexity: $$O(n)$$\n- Space complexity: $$O(n)$$\n\n# Code\n```Python []\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n stats = actor_director.groupby(\n [\'actor_id\', \'director_id\'],\n ).agg(\n count=(\'director_id\', \'count\'),\n ).reset_in... | 28 | 0 | ['Python', 'Python3', 'MySQL', 'Pandas'] | 2 |
actors-and-directors-who-cooperated-at-least-three-times | [Pandas] || 2-step simple code with comments... | pandas-2-step-simple-code-with-comments-fht54 | \n\n# Code\n\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n # Group the data by actor_id and director_id, | sriganesh777 | NORMAL | 2023-08-22T18:10:26.167604+00:00 | 2023-08-22T18:10:26.167633+00:00 | 2,810 | false | \n\n# Code\n```\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n # Group the data by actor_id and director_id, and count the number of cooperations\n grouped = actor_director.groupby([\'actor_id\', \'director_id\']).size().reset_index(name=\'cooperation_count\')\n ... | 15 | 0 | ['Pandas'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Simple and fast MySQL solution in one line | simple-and-fast-mysql-solution-in-one-li-mdfy | \nselect actor_id,director_id from ActorDirector group by 1,2 having count(*)>=3;\n\n\nNote: If you find it helpful then upvote. Cheers!! | harshitdwivedi01 | NORMAL | 2022-08-15T04:43:15.744584+00:00 | 2022-08-15T04:43:15.744623+00:00 | 2,238 | false | ```\nselect actor_id,director_id from ActorDirector group by 1,2 having count(*)>=3;\n```\n\nNote: If you find it helpful then upvote. Cheers!! | 14 | 0 | ['MySQL'] | 2 |
actors-and-directors-who-cooperated-at-least-three-times | Easy and Simple Approach😊 | easy-and-simple-approach-by-professional-clhg | \n# Code\n\nselect actor_id , director_id\nfrom ActorDirector\ngroup by actor_id,director_id\nhaving count(timestamp)>=3\n\n\n | ProfessionalMonk | NORMAL | 2023-08-02T02:56:49.741096+00:00 | 2023-08-02T02:56:49.741113+00:00 | 873 | false | \n# Code\n```\nselect actor_id , director_id\nfrom ActorDirector\ngroup by actor_id,director_id\nhaving count(timestamp)>=3\n```\n\n | 12 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Another Solution Using Window Function | another-solution-using-window-function-b-yttj | SELECT DISTINCT(actor_id), director_id\nFROM(\nSELECT actor_id, director_id , COUNT(timestamp) OVER (Partition by actor_id, director_id) as number_of_times\nFRO | joyjiang | NORMAL | 2022-04-11T00:56:14.044735+00:00 | 2022-04-11T00:56:14.044765+00:00 | 644 | false | SELECT DISTINCT(actor_id), director_id\nFROM(\nSELECT actor_id, director_id , COUNT(timestamp) OVER (Partition by actor_id, director_id) as number_of_times\nFROM ActorDirector) AS temp\nWHERE number_of_times >= 3 | 9 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Solution Using MySQL GROUP BY and HAVING | solution-using-mysql-group-by-and-having-18uu | \nSELECT ACTOR_ID, DIRECTOR_ID\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(*) > 2\n | huangguoxin0512 | NORMAL | 2019-05-25T21:43:14.910879+00:00 | 2019-05-25T21:43:54.902710+00:00 | 5,317 | false | ```\nSELECT ACTOR_ID, DIRECTOR_ID\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(*) > 2\n``` | 9 | 0 | [] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | MYSQL SOLN. | mysql-soln-by-hemant_1451-wbta | \n# Code\n\n# Write your MySQL query statement below\nSELECT ACTOR_ID, DIRECTOR_ID FROM ACTORDIRECTOR GROUP BY ACTOR_ID,DIRECTOR_ID HAVING COUNT(TIMESTAMP)>2;\n | Hemant_1451 | NORMAL | 2023-01-10T01:41:53.888213+00:00 | 2023-01-10T01:41:53.888250+00:00 | 3,152 | false | \n# Code\n```\n# Write your MySQL query statement below\nSELECT ACTOR_ID, DIRECTOR_ID FROM ACTORDIRECTOR GROUP BY ACTOR_ID,DIRECTOR_ID HAVING COUNT(TIMESTAMP)>2;\n``` | 8 | 0 | ['Database', 'MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | [MySQL] || GROUP BY || Beginner Friendly | mysql-group-by-beginner-friendly-by-coma-49uc | Write your MySQL query statement below\n\n\nSELECT actor_id , director_id\nFROM ActorDirector \nGROUP BY actor_id , director_id\nHAVING COUNT(timestamp)>=3;\n | comauro7511 | NORMAL | 2022-10-13T18:17:46.437931+00:00 | 2022-10-14T15:56:48.604253+00:00 | 2,506 | false | # Write your MySQL query statement below\n```\n\nSELECT actor_id , director_id\nFROM ActorDirector \nGROUP BY actor_id , director_id\nHAVING COUNT(timestamp)>=3;\n``` | 7 | 0 | ['MySQL'] | 2 |
actors-and-directors-who-cooperated-at-least-three-times | 1050. Actors and Directors Who Cooperated At Least Three Times | 1050-actors-and-directors-who-cooperated-5csm | ```\nSELECT actor_id, director_id FROM ActorDirector\nGROUP BY actor_id, director_id HAVING COUNT(timestamp)>2;\n | Spaulding_ | NORMAL | 2022-09-07T18:33:52.999003+00:00 | 2022-09-07T18:33:52.999045+00:00 | 979 | false | ```\nSELECT actor_id, director_id FROM ActorDirector\nGROUP BY actor_id, director_id HAVING COUNT(timestamp)>2;\n | 7 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Easy solution with HAVING COUNT(a =b) | easy-solution-with-having-counta-b-by-mm-3d4b | SELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(actor_id = director_id) >= 3; | mma4 | NORMAL | 2020-07-15T18:07:18.291568+00:00 | 2020-07-15T18:07:18.291599+00:00 | 1,207 | false | SELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(actor_id = director_id) >= 3; | 7 | 2 | [] | 2 |
actors-and-directors-who-cooperated-at-least-three-times | Easy my~SQL sol || think of group by / having / count | easy-mysql-sol-think-of-group-by-having-1p5gm | \nselect actor_id , director_id \nfrom actordirector \ngroup by actor_id ,director_id\nhaving count(*)>=3 ; \n\nThanks | abhi-kuks | NORMAL | 2022-09-12T11:12:59.749406+00:00 | 2022-09-12T11:12:59.749443+00:00 | 1,132 | false | ```\nselect actor_id , director_id \nfrom actordirector \ngroup by actor_id ,director_id\nhaving count(*)>=3 ; \n```\n***Thanks*** | 6 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL - Slightly Optimized Solution | mysql-slightly-optimized-solution-by-xor-ls5y | \nSELECT actor_id as ACTOR_ID, director_id as DIRECTOR_ID\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING(COUNT(DISTINCT ActorDirector.timestamp) >= | xorobotxo | NORMAL | 2019-09-08T19:38:33.938459+00:00 | 2019-09-08T19:38:33.938528+00:00 | 2,184 | false | ```\nSELECT actor_id as ACTOR_ID, director_id as DIRECTOR_ID\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING(COUNT(DISTINCT ActorDirector.timestamp) >= 3);\n```\n\nMy original solution included a ```COUNT(*)``` which produced a result faster than only 5% of other submissions.\nAfter switching to counting on... | 6 | 0 | [] | 3 |
actors-and-directors-who-cooperated-at-least-three-times | ✅ 100% EASY || FAST 🔥|| CLEAN SOLUTION 🌟 | 100-easy-fast-clean-solution-by-kartik_k-l6f6 | \n\n# Code\n\n/* Write your PL/SQL query statement below */\nSELECT actor_id, director_id FROM ActorDirector GROUP BY \n\nactor_id, director_id HAVING COUNT(dir | kartik_ksk7 | NORMAL | 2024-06-03T09:51:10.211090+00:00 | 2024-06-03T09:51:10.211108+00:00 | 522 | false | \n\n# Code\n```\n/* Write your PL/SQL query statement below */\nSELECT actor_id, director_id FROM ActorDirector GROUP BY \n\nactor_id, director_id HAVING COUNT(director_id) >=3 ;\n```\n\n | 5 | 0 | ['Database', 'Oracle'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Easy solution || MySQL || Pandas || Beats 100% !! | easy-solution-mysql-pandas-beats-100-by-t83dk | Code\n\n# Write your MySQL query statement below\nSELECT actor_id,director_id\nFROM ActorDirector \nGROUP BY actor_id,director_id\nHAVING count(timestamp)>=3;\n | prathams29 | NORMAL | 2023-08-01T17:02:50.362654+00:00 | 2023-08-01T17:02:50.362681+00:00 | 1,245 | false | # Code\n```\n# Write your MySQL query statement below\nSELECT actor_id,director_id\nFROM ActorDirector \nGROUP BY actor_id,director_id\nHAVING count(timestamp)>=3;\n```\n```\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n df = actor_director.groupby([\'actor_id\',\'d... | 5 | 0 | ['MySQL', 'Pandas'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | Easy to understand || SQL | easy-to-understand-sql-by-yashwardhan24_-7x3y | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | yashwardhan24_sharma | NORMAL | 2023-03-09T05:59:41.122335+00:00 | 2023-03-09T05:59:41.122368+00:00 | 2,421 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 5 | 0 | ['Database', 'MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | 📌📌 easy solution :D || MySql ⚡ | easy-solution-d-mysql-by-maary-h51x | \nSELECT actor_id, director_id \nFROM\n (SELECT actor_id, director_id, COUNT(*) AS cnt\n FROM ActorDirector\n GROUP BY actor_id, director_id\n ) A | maary_ | NORMAL | 2023-03-05T00:49:07.037819+00:00 | 2023-03-05T22:43:15.245222+00:00 | 1,170 | false | ```\nSELECT actor_id, director_id \nFROM\n (SELECT actor_id, director_id, COUNT(*) AS cnt\n FROM ActorDirector\n GROUP BY actor_id, director_id\n ) AS t\nWHERE cnt >= 3;\n``` | 5 | 0 | ['MySQL', 'MS SQL Server'] | 2 |
actors-and-directors-who-cooperated-at-least-three-times | mysql, group by, having count(*) | mysql-group-by-having-count-by-nov05-riww | https://leetcode.com/submissions/detail/865539807/\n\n# Write your MySQL query statement below\nselect actor_id, director_id\nfrom ActorDirector\ngroup by actor | nov05 | NORMAL | 2022-12-26T03:56:19.670910+00:00 | 2022-12-26T03:56:19.670935+00:00 | 1,200 | false | https://leetcode.com/submissions/detail/865539807/\n```\n# Write your MySQL query statement below\nselect actor_id, director_id\nfrom ActorDirector\ngroup by actor_id, director_id\nhaving count(*) >= 3\n``` | 5 | 0 | [] | 2 |
actors-and-directors-who-cooperated-at-least-three-times | Simple Group By | simple-group-by-by-shivamleet07-55z0 | \nSELECT ACTOR_ID, DIRECTOR_ID\n\tFROM ActorDirector\nGROUP BY ACTOR_ID, DIRECTOR_ID\n\tHAVING COUNT(*) >= 3\n | shivamleet07 | NORMAL | 2022-07-30T17:57:13.344340+00:00 | 2022-07-30T17:57:13.344382+00:00 | 331 | false | ```\nSELECT ACTOR_ID, DIRECTOR_ID\n\tFROM ActorDirector\nGROUP BY ACTOR_ID, DIRECTOR_ID\n\tHAVING COUNT(*) >= 3\n``` | 5 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Optimised Approach || Group By | optimised-approach-group-by-by-vipul_05_-m7b1 | 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 | Vipul_05_Jain | NORMAL | 2025-01-23T07:37:44.224225+00:00 | 2025-01-23T07:37:44.224225+00:00 | 401 | false | # 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 ac... | 4 | 0 | ['MySQL'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL Different Solution | With & Row_Number() Functions | | mysql-different-solution-with-row_number-do5g | \n# Code\nmysql []\nwith cte as (select *, row_number() over(partition by actor_id, director_id) as r from actordirector)\n\nselect distinct actor_id, director_ | Kamal_Kumar123 | NORMAL | 2024-09-08T05:28:43.517651+00:00 | 2024-09-08T05:28:43.517672+00:00 | 196 | false | \n# Code\n```mysql []\nwith cte as (select *, row_number() over(partition by actor_id, director_id) as r from actordirector)\n\nselect distinct actor_id, director_id from cte where r >= 3\n\n``` | 4 | 0 | ['MySQL'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | easy, clean pandas solution | easy-clean-pandas-solution-by-pooya_rost-4yjj | Intuition\neasy, clean pandas solution\n\n# Approach\ngroupby the data by combination of \'actor_id\' and \'director_id\' and count their occurance.\nnext, take | pooya_rostami_m | NORMAL | 2023-11-20T14:14:01.682892+00:00 | 2023-11-20T14:14:01.682926+00:00 | 452 | false | # Intuition\neasy, clean pandas solution\n\n# Approach\ngroupby the data by combination of \'actor_id\' and \'director_id\' and count their occurance.\nnext, take the ones that happen at least three times and show the \'actor_id\' and \'director_id\'\n\n# Complexity\n- Time complexity:\nnot sure\n\n- Space complexity:\... | 4 | 0 | ['Pandas'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | 🔥 Pandas Easy and Concise Solution For Beginners 💯 | pandas-easy-and-concise-solution-for-beg-i6xl | \uD83D\uDD3C IF YOU FIND THIS POST HELPFUL PLEASE UPVOTE \uD83D\uDC4D\n\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.Dat | pniraj657 | NORMAL | 2023-08-28T11:39:15.827313+00:00 | 2023-08-28T11:39:15.827336+00:00 | 284 | false | **\uD83D\uDD3C IF YOU FIND THIS POST HELPFUL PLEASE UPVOTE \uD83D\uDC4D**\n```\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n \n result = actor_director.groupby([\'actor_id\', \'director_id\']).count().reset_index()\n \n return result[result[\'timestamp\']>... | 4 | 0 | ['Python', 'Python3'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL Solution for Actors and Directors Who Cooperated At Least Three Times Problem | mysql-solution-for-actors-and-directors-et5q2 | Intuition\n Describe your first thoughts on how to solve this problem. \nThe intuition behind the given solution is to find actor-director pairs that have worke | Aman_Raj_Sinha | NORMAL | 2023-05-18T03:30:40.877203+00:00 | 2023-05-18T03:30:40.877302+00:00 | 966 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe intuition behind the given solution is to find actor-director pairs that have worked together in at least three movies. The approach involves grouping the rows in the ActorDirector table by actor_id and director_id, and then applying ... | 4 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | concise mysql solution using concat | concise-mysql-solution-using-concat-by-9-h0gs | \nselect actor_id, director_id from actordirector group by actor_id, director_id having count(concat(actor_id, director_id)) >= 3;\n | 96sayak | NORMAL | 2022-11-27T07:08:42.190316+00:00 | 2022-11-27T07:08:42.190342+00:00 | 434 | false | ```\nselect actor_id, director_id from actordirector group by actor_id, director_id having count(concat(actor_id, director_id)) >= 3;\n``` | 4 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MS SQL Server 99.5% | ms-sql-server-995-by-guseowhtjs-bkc3 | \n/* Write your T-SQL query statement below */\nselect actor_id, director_id\n from actordirector\n group by actor_id, director_id\n having count(timestamp) > | guseowhtjs | NORMAL | 2022-07-28T12:48:49.545463+00:00 | 2022-07-28T12:48:49.545507+00:00 | 703 | false | ```\n/* Write your T-SQL query statement below */\nselect actor_id, director_id\n from actordirector\n group by actor_id, director_id\n having count(timestamp) > 2\n``` | 4 | 0 | ['MS SQL Server'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | ✅MySQL using "timestamp" | mysql-using-timestamp-by-ranbeer_singh-o1uj | \nSELECT\n actor_id,\n director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(timestamp) > 2\n | Ranbeer_Singh | NORMAL | 2022-07-16T03:38:19.911703+00:00 | 2022-07-16T03:38:19.911748+00:00 | 563 | false | ```\nSELECT\n actor_id,\n director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(timestamp) > 2\n``` | 4 | 0 | ['MySQL'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | Simple and Clean | simple-and-clean-by-nkalash-82e7 | SELECT ACTOR_ID, DIRECTOR_ID FROM ACTORDIRECTOR \nGROUP BY ACTOR_ID, DIRECTOR_ID \nHAVING COUNT(*) >= 3 | nkalash | NORMAL | 2022-05-24T07:45:02.931582+00:00 | 2022-05-24T07:45:02.931611+00:00 | 667 | false | SELECT ACTOR_ID, DIRECTOR_ID FROM ACTORDIRECTOR \nGROUP BY ACTOR_ID, DIRECTOR_ID \nHAVING COUNT(*) >= 3 | 4 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MS SQL, MySQL and Oracle solution with GROUP BY and HAVING | ms-sql-mysql-and-oracle-solution-with-gr-1uiw | \nSELECT\n actor_id,\n director_id\nFROM\n ActorDirector\nGROUP BY\n actor_id,\n director_id\nHAVING \n COUNT(1) > 2\n | vazhev | NORMAL | 2022-04-23T20:40:09.170419+00:00 | 2022-04-23T20:40:09.170447+00:00 | 535 | false | ```\nSELECT\n actor_id,\n director_id\nFROM\n ActorDirector\nGROUP BY\n actor_id,\n director_id\nHAVING \n COUNT(1) > 2\n``` | 4 | 0 | ['MySQL', 'Oracle', 'MS SQL Server'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | Simple Query ✅ | With Proper Explanation 🤝 | simple-query-with-proper-explanation-by-r0not | IntuitionThe problem requires us to find all pairs of actors and directors who have worked together on at least three movies. This means we need to identify fre | NadeemMohammed | NORMAL | 2025-03-06T04:32:12.495492+00:00 | 2025-03-06T04:32:12.495492+00:00 | 212 | false | # Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The problem requires us to find all pairs of actors and directors who have worked together on at least three movies. This means we need to identify frequent collaborations between actors and directors by counting how many times each pair ap... | 3 | 0 | ['PostgreSQL'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | sql solution using case | sql-solution-using-case-by-sachin_kumar_-70iz | IntuitionApproachComplexity
Time complexity:
Space complexity:
Code | Sachin_Kumar_Sharma | NORMAL | 2025-01-19T10:15:55.177903+00:00 | 2025-01-19T10:15:55.177903+00:00 | 84 | false | # Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
# Approach
<!-- Describe your approach to solving the problem. -->
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
# Code
`... | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Simple solution beats 99.9% | simple-solution-beats-999-by-rshikharev-49hw | Intuition\nThe task requires us to find pairs of actor_id and director_id who have collaborated at least three times. The initial thought is to group the data b | rshikharev | NORMAL | 2024-11-05T15:56:06.347046+00:00 | 2024-11-05T15:57:26.636779+00:00 | 485 | false | # Intuition\nThe task requires us to find pairs of `actor_id` and `director_id` who have collaborated at least three times. The initial thought is to group the data by each unique actor-director pair and then filter out the pairs that meet the collaboration threshold.\n\n# Approach\n1. **GROUP BY**: Use `GROUP BY actor... | 3 | 0 | ['Database', 'MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Beginner Friendly Solution🌻 | beginner-friendly-solution-by-ravithemor-x4hr | Intuition:\nThe SQL query retrieves pairs of actor and director IDs from the ActorDirector table where the same actor has worked with the same director at least | ravithemore | NORMAL | 2023-11-17T06:33:45.050843+00:00 | 2023-11-17T06:33:45.050895+00:00 | 286 | false | **Intuition:**\nThe SQL query retrieves pairs of actor and director IDs from the `ActorDirector` table where the same actor has worked with the same director at least three times, based on the count of timestamps.\n\n**Approach:**\n1. The query groups the records in the `ActorDirector` table by pairs of `actor_id` and ... | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Pandas | SQL | | Easy | Explained Step by Step | Actors & Directors Cooperated min Three Times | pandas-sql-easy-explained-step-by-step-a-f24v | see the successfully Accepted Submission\n\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n # Initially, we | Khosiyat | NORMAL | 2023-09-19T17:42:56.711696+00:00 | 2023-10-01T17:37:52.725957+00:00 | 135 | false | [see the successfully Accepted Submission](https://leetcode.com/submissions/detail/1053805243/)\n```\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n # Initially, we group \'actor_id\' and \'director_id\'.\n grouped_actor_director = actor_director.groupby([\'actor_... | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Pandas returning index (columns not duplicated for grouping and selecting items) | pandas-returning-index-columns-not-dupli-5due | Pandas returning index\nI like Panda\'s possibility to avoid repeating listing actor_id, director_id both for grouping and then final selecting items to return | garncarz | NORMAL | 2023-08-16T04:17:22.828501+00:00 | 2023-08-16T04:19:02.342820+00:00 | 327 | false | # Pandas returning index\nI like Panda\'s possibility to avoid repeating listing `actor_id`, `director_id` both for grouping and then final selecting items to return (as seen in the solution below).\n\n```\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n return (actor_d... | 3 | 0 | ['MySQL', 'Pandas'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Simple MySQL Solution | simple-mysql-solution-by-abhradip_360-1d7y | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | abhradip_360 | NORMAL | 2023-06-07T12:47:30.591544+00:00 | 2023-06-07T12:47:30.591593+00:00 | 213 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL Easy Solution ✅✅ | mysql-easy-solution-by-shubhamjain287-rwbd | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Shubhamjain287 | NORMAL | 2023-03-08T05:40:25.132064+00:00 | 2023-03-08T05:40:25.132108+00:00 | 946 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL Solution | mysql-solution-by-pranto1209-wknp | Code\n\n# Write your MySQL query statement below\nselect actor_id, director_id from ActorDirector \ngroup by actor_id, director_id having count(timestamp) >= 3; | pranto1209 | NORMAL | 2023-03-07T18:20:12.564667+00:00 | 2023-03-13T16:00:09.303804+00:00 | 848 | false | # Code\n```\n# Write your MySQL query statement below\nselect actor_id, director_id from ActorDirector \ngroup by actor_id, director_id having count(timestamp) >= 3;\n``` | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Using Group by and Having Clause || Actors and Directors Who Cooperated At Least Three Times | using-group-by-and-having-clause-actors-232cs | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | himshrivas | NORMAL | 2023-01-26T08:44:53.468558+00:00 | 2023-01-26T08:44:53.468595+00:00 | 1,085 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | ✅✅Easy C++ Solution || Simple to Understand | easy-c-solution-simple-to-understand-by-0iv2f | \tselect actor_id, director_id\n\tfrom ActorDirector\n\tgroup by actor_id, director_id\n\thaving count(timestamp) >= 3;\nI hope that you\'ve found the solution | debav2 | NORMAL | 2022-10-07T19:25:07.181578+00:00 | 2022-10-08T06:59:20.637152+00:00 | 466 | false | \tselect actor_id, director_id\n\tfrom ActorDirector\n\tgroup by actor_id, director_id\n\thaving count(timestamp) >= 3;\nI hope that you\'ve found the solution useful.\nIn that case, please do upvote. Happy Coding :) | 3 | 0 | ['MySQL'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | Simple solution | Fast and easy | simple-solution-fast-and-easy-by-max_tar-40ae | \nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY 1, 2\nHAVING COUNT(1) > 2\n | max_tar | NORMAL | 2022-09-06T23:19:37.440725+00:00 | 2022-09-06T23:19:37.440756+00:00 | 1,003 | false | ```\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY 1, 2\nHAVING COUNT(1) > 2\n``` | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Simple 3 line code | mysql | simple-3-line-code-mysql-by-rohan_fasale-iwpp | select actor_id,director_id from actordirector\ngroup by director_id,actor_id\nhaving count(director_id)>=3 | Rohan_Fasale | NORMAL | 2022-09-02T18:07:20.865359+00:00 | 2022-09-02T18:07:20.865406+00:00 | 629 | false | select actor_id,director_id from actordirector\ngroup by director_id,actor_id\nhaving count(director_id)>=3 | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | ✅MySQL || Beginner level || Faster than 98%||Simple-Short -Solution✅ | mysql-beginner-level-faster-than-98simpl-jqdv | Please upvote to motivate me in my quest of documenting all leetcode solutions. HAPPY CODING:)\nAny suggestions and improvements are always welcome.\n========== | Anos | NORMAL | 2022-08-31T19:48:06.760521+00:00 | 2022-08-31T19:48:27.152623+00:00 | 276 | false | **Please upvote to motivate me in my quest of documenting all leetcode solutions. HAPPY CODING:)\nAny suggestions and improvements are always welcome.***\n*====================================================================*\n\u2705 **MySQL Code :**\n Your runtime beats 98.12 % of mysql submissions.\n```\nSELECT actor... | 3 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MSSQL | mssql-by-lavinamall-feeb | \nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(actor_id) > 2\n | lavinamall | NORMAL | 2022-07-22T01:08:35.155701+00:00 | 2022-07-22T01:08:35.155742+00:00 | 704 | false | ```\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(actor_id) > 2\n``` | 3 | 0 | ['MS SQL Server'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | Group by the pair | group-by-the-pair-by-user5091-94d7 | \nselect actor_id, director_id\nfrom ActorDirector\ngroup by actor_id, director_id\nhaving count(timestamp)>2;\n | user5091 | NORMAL | 2021-11-13T18:05:58.729504+00:00 | 2021-11-13T18:05:58.729534+00:00 | 408 | false | ```\nselect actor_id, director_id\nfrom ActorDirector\ngroup by actor_id, director_id\nhaving count(timestamp)>2;\n``` | 3 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Fast MS SQL solution | fast-ms-sql-solution-by-momo1621-ikzi | \nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHaving count(distinct timestamp) >= 3\n | Momo1621 | NORMAL | 2019-11-22T07:01:19.206096+00:00 | 2020-01-18T07:01:42.519627+00:00 | 784 | false | ```\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHaving count(distinct timestamp) >= 3\n``` | 3 | 2 | [] | 2 |
actors-and-directors-who-cooperated-at-least-three-times | SELECT actor_id, director_id FROM ActorDirector GROUP BY actor_id, director_id HAVING COUNT(*)>=3; | select-actor_id-director_id-from-actordi-rqqv | null | Vishal1431 | NORMAL | 2025-02-04T19:09:39.811050+00:00 | 2025-02-04T19:09:39.811050+00:00 | 161 | false |
```mysql []
SELECT actor_id, director_id FROM ActorDirector
GROUP BY actor_id, director_id
HAVING COUNT(*)>=3;
``` | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Group by clause in Postgres | group-by-clause-in-postgres-by-amoghamai-av1h | Code | AmoghaMayya | NORMAL | 2025-01-21T07:02:56.021501+00:00 | 2025-01-21T07:02:56.021501+00:00 | 162 | false |
# Code
```postgresql []
-- Write your PostgreSQL query statement below
select actor_id , director_id
from actordirector
group by actor_id , director_id
having count(*) > 2;
``` | 2 | 0 | ['PostgreSQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | SQL | sql-by-kanvapuri_sai_praneetha-bss9 | Code\n\nSELECT actor_id, director_id \nFROM ActorDirector \nGROUP BY actor_id, director_id \nHAVING count(*)>= 3;\n | kanvapuri_sai_praneetha | NORMAL | 2024-08-10T02:59:19.129511+00:00 | 2024-08-10T02:59:19.129549+00:00 | 486 | false | # Code\n```\nSELECT actor_id, director_id \nFROM ActorDirector \nGROUP BY actor_id, director_id \nHAVING count(*)>= 3;\n``` | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | (Pandas) 1-line | pandas-1-line-by-qeetcode-id63 | \ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n return actor_director.groupby(by=["actor_id", "director_id"], as_index=False).siz | qeetcode | NORMAL | 2023-08-17T20:19:20.000460+00:00 | 2023-08-17T20:19:20.000511+00:00 | 321 | false | ```\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n return actor_director.groupby(by=["actor_id", "director_id"], as_index=False).size().query("size >= 3").drop(labels="size", axis=1); \n``` | 2 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Explained | Group By With Having | SQL and Pandas | explained-group-by-with-having-sql-and-p-vy3w | My SQL\nYou can add conditions to group by clause by using having clause.\nAdd actor_id, director_id to group by because they are being selected for showing. An | hridoy100 | NORMAL | 2023-08-12T06:58:21.816075+00:00 | 2023-08-12T06:58:21.816098+00:00 | 1,311 | false | # My SQL\nYou can add conditions to `group by` clause by using `having` clause.\nAdd `actor_id, director_id` to group by because they are being selected for showing. Anything that\'s not inside an aggregate function (`count()`, `avg()`, `max()`, etc.) and needs to be shown as output must be written inside `GROUP BY` cl... | 2 | 0 | ['MySQL', 'Pandas'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL Solution | mysql-solution-by-triyambkeshtiwari-f3v1 | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | triyambkeshtiwari | NORMAL | 2023-08-10T15:55:55.331508+00:00 | 2023-08-10T15:55:55.331536+00:00 | 423 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | ✔MySQL Simple Solution✔ | mysql-simple-solution-by-arth_anaya-oal2 | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | Arth_Anaya | NORMAL | 2023-04-20T14:17:14.471908+00:00 | 2023-04-20T14:17:14.471940+00:00 | 373 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 2 | 0 | ['MySQL'] | 2 |
actors-and-directors-who-cooperated-at-least-three-times | Easy Solution | MySQL👀🥷 | easy-solution-mysql-by-dipesh_12-0pnc | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | dipesh_12 | NORMAL | 2023-04-12T15:32:16.944482+00:00 | 2023-04-12T15:32:16.944516+00:00 | 4,202 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 2 | 0 | ['MySQL'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | SQL Server CLEAN & EASY | sql-server-clean-easy-by-rhazem13-29oq | \nSELECT ad.actor_id, ad.director_id\nFROM ActorDirector ad\nJOIN (\n SELECT actor_id, director_id\n FROM ActorDirector\n GROUP BY actor_id, director_id\n H | rhazem13 | NORMAL | 2023-03-17T08:37:18.457507+00:00 | 2023-03-17T08:37:18.457540+00:00 | 1,845 | false | ```\nSELECT ad.actor_id, ad.director_id\nFROM ActorDirector ad\nJOIN (\n SELECT actor_id, director_id\n FROM ActorDirector\n GROUP BY actor_id, director_id\n HAVING COUNT(*) >= 3\n) ad2 ON ad.actor_id = ad2.actor_id AND ad.director_id = ad2.director_id\nGROUP BY ad.actor_id, ad.director_id\n\n``` | 2 | 0 | [] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | MYSQL || Easy approach | mysql-easy-approach-by-mrigank_2003-pga0 | \n# Code\n\n# Write your MySQL query statement below\nselect actor_id, director_id from ActorDirector group by actor_id, director_id having count(timestamp)>=3; | mrigank_2003 | NORMAL | 2023-03-14T04:20:37.121636+00:00 | 2023-03-14T04:20:37.121682+00:00 | 3,207 | false | \n# Code\n```\n# Write your MySQL query statement below\nselect actor_id, director_id from ActorDirector group by actor_id, director_id having count(timestamp)>=3;\n``` | 2 | 0 | ['MySQL'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL Solution | mysql-solution-by-abstractconnoisseurs-tc7h | Code\n\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(1) >= 3\n | abstractConnoisseurs | NORMAL | 2023-01-27T09:07:51.616774+00:00 | 2023-01-27T09:07:51.616806+00:00 | 702 | false | # Code\n```\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(1) >= 3\n``` | 2 | 0 | ['Database', 'MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Group by & Having | group-by-having-by-bejoysekhar-5edb | \nselect actor_id, director_id from actordirector group by actor_id, director_id having count(*) >= 3 \n | bejoysekhar | NORMAL | 2022-10-07T02:08:26.106611+00:00 | 2022-10-07T02:08:26.106657+00:00 | 483 | false | ```\nselect actor_id, director_id from actordirector group by actor_id, director_id having count(*) >= 3 \n``` | 2 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Easy & Concise MySQL Solution using HAVING Clause | easy-concise-mysql-solution-using-having-4z9p | Do upvote the solution to keep me motivated , incase you liked it ;)\n\n\nSELECT actor_id,director_id \nFROM ActorDirector \nGROUP BY actor_id,director_id\nHAVI | vartika23_02 | NORMAL | 2022-09-01T05:38:48.754473+00:00 | 2022-09-01T05:39:01.563709+00:00 | 58 | false | **Do upvote the solution to keep me motivated , incase you liked it ;)**\n\n```\nSELECT actor_id,director_id \nFROM ActorDirector \nGROUP BY actor_id,director_id\nHAVING count(actor_id=director_id)>=3;\n``` | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MS SQL | Easy | ms-sql-easy-by-nikhil_katoch-6v02 | \nselect actor_id, director_id\nfrom ActorDirector\ngroup by director_id,actor_id\nhaving count(director_id)>=3\n | nikhil_katoch | NORMAL | 2022-08-28T13:17:01.522615+00:00 | 2022-08-28T13:17:01.522645+00:00 | 577 | false | ```\nselect actor_id, director_id\nfrom ActorDirector\ngroup by director_id,actor_id\nhaving count(director_id)>=3\n``` | 2 | 0 | ['MS SQL Server'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | Easy To Understand Solution | easy-to-understand-solution-by-inferno08-r113 | \nSELECT DISTINCT t.actor_id, t.director_id FROM ActorDirector t\nGROUP BY t.actor_id , t.director_id\nHAVING COUNT(t.timestamp) >= 3\n | inferno080 | NORMAL | 2022-08-08T07:18:27.292902+00:00 | 2022-08-08T07:18:27.292940+00:00 | 169 | false | ```\nSELECT DISTINCT t.actor_id, t.director_id FROM ActorDirector t\nGROUP BY t.actor_id , t.director_id\nHAVING COUNT(t.timestamp) >= 3\n``` | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | 2 MySQL Solutions: GROUP BY & RANK() | 2-mysql-solutions-group-by-rank-by-farya-1h5t | 1. Using GROUP BY and HAVING clause (the simplest one)\n\nSELECT a.actor_id, a.director_id\nFROM ActorDirector a\nGROUP BY a.actor_id, a.director_id\nHAVING COU | faryar251 | NORMAL | 2022-07-26T10:52:19.452540+00:00 | 2022-07-26T10:54:12.445453+00:00 | 125 | false | ### 1. Using `GROUP BY` and `HAVING` clause (the simplest one)\n```\nSELECT a.actor_id, a.director_id\nFROM ActorDirector a\nGROUP BY a.actor_id, a.director_id\nHAVING COUNT(timestamp) > 2\n```\n\n### 2. Using `RANK() OVER` clause\n```\nSELECT a1.actor_id, a1.director_id\nFROM (\n SELECT \n a.actor_id, \n ... | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | [ MYSQL ] ✅✅ Simple MYSQL Solution Using Having Count Clause || Group By 🥳✌👍 | mysql-simple-mysql-solution-using-having-1lmv | If You like the Solution, Don\'t Forget To UpVote Me, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 376 ms, faster than 69.66% of MySQL online submissions | ashok_kumar_meghvanshi | NORMAL | 2022-07-16T18:25:20.836308+00:00 | 2022-07-16T18:25:20.836345+00:00 | 227 | false | # If You like the Solution, Don\'t Forget To UpVote Me, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 376 ms, faster than 69.66% of MySQL online submissions for Actors and Directors Who Cooperated At Least Three Times.\n# Memory Usage: 0B, less than 100.00% of MySQL online submissions for Actors and Directors Who... | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Simplest | simplest-by-suraj21193-cf09 | ```\n/ Write your T-SQL query statement below /\nSELECT actor_id, director_id\nFROM ActorDirector \n GROUP BY actor_id, director_id\n Having COUNT(ti | suraj21193 | NORMAL | 2022-06-23T14:21:29.311327+00:00 | 2022-06-23T14:23:18.940728+00:00 | 163 | false | ```\n/* Write your T-SQL query statement below */\nSELECT actor_id, director_id\nFROM ActorDirector \n GROUP BY actor_id, director_id\n Having COUNT(timestamp) >=3 | 2 | 0 | [] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | Using GROUP BY and HAVING | using-group-by-and-having-by-supratim_co-trpi | \nSELECT actor_id, director_id from ActorDirector GROUP BY actor_id, director_id HAVING COUNT(*)>2;\n | supratim_code | NORMAL | 2022-05-29T16:17:28.563434+00:00 | 2022-05-29T16:17:28.563472+00:00 | 305 | false | ```\nSELECT actor_id, director_id from ActorDirector GROUP BY actor_id, director_id HAVING COUNT(*)>2;\n``` | 2 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | GROUP BY and HAVING | Very Easy Solution | group-by-and-having-very-easy-solution-b-crq0 | \nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(*) >= 3;\n | ajinkya2000 | NORMAL | 2022-05-18T10:23:18.321399+00:00 | 2022-05-18T10:23:18.321439+00:00 | 178 | false | ```\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(*) >= 3;\n``` | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | mysql groupby and having | mysql-groupby-and-having-by-sulaymon-dev-xodz | \nselect actor_id,director_id from ActorDirector group by actor_id,director_id having count(*)>=3\n | Sulaymon-Dev20 | NORMAL | 2022-04-21T18:47:17.152177+00:00 | 2022-04-21T18:47:17.152219+00:00 | 107 | false | ```\nselect actor_id,director_id from ActorDirector group by actor_id,director_id having count(*)>=3\n``` | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | simple | simple-by-du0118-wimp | select actor_id, director_id\nfrom actordirector\ngroup by actor_id, director_id\nhaving count(actor_id = director_id) >= 3\n; | DU0118 | NORMAL | 2022-03-05T20:51:42.484594+00:00 | 2022-03-05T20:51:42.484626+00:00 | 184 | false | select actor_id, director_id\nfrom actordirector\ngroup by actor_id, director_id\nhaving count(actor_id = director_id) >= 3\n; | 2 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | mySQL | having, group by | explained | mysql-having-group-by-explained-by-anhtr-7919 | `\nselect actor_id, director_id\nfrom ActorDirector \n#return pair of (actor_id, director_id) \ngroup by actor_id, director_id\nhaving count(*) >= 3\n#having: c | anhtran114 | NORMAL | 2022-01-12T21:12:03.739409+00:00 | 2022-01-12T21:12:20.804532+00:00 | 468 | false | ```\nselect actor_id, director_id\nfrom ActorDirector \n#return pair of (actor_id, director_id) \ngroup by actor_id, director_id\nhaving count(*) >= 3\n#having: condition \n#count(*) means count all include NULL cases\n;\n``\n | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Group By and Having () | group-by-and-having-by-yzhou2018-knnj | select actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nhaving count(timestamp)>=3; | yzhou2018 | NORMAL | 2021-11-29T02:31:26.671563+00:00 | 2021-11-29T02:31:26.671595+00:00 | 348 | false | select actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nhaving count(timestamp)>=3; | 2 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Simple MySql Solution ,faster than 93.77% of MySQL online submissions | simple-mysql-solution-faster-than-9377-o-ij4n | \nSelect actor_id,director_id from actordirector\ngroup by actor_id,director_id\nhaving count(director_id)>=3\n | user8447f | NORMAL | 2021-10-20T12:55:34.160217+00:00 | 2021-10-20T12:55:34.160246+00:00 | 384 | false | ```\nSelect actor_id,director_id from actordirector\ngroup by actor_id,director_id\nhaving count(director_id)>=3\n``` | 2 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL | mysql-by-vincentt126-6xc0 | run time 342s\nselect actor_id, director_id\nfrom actordirector\ngroup by actor_id, director_id\nhaving count(*)>=3\n\nrun time 448s\n\nselect actor_id, directo | vincentt126 | NORMAL | 2021-06-18T18:08:35.769363+00:00 | 2021-06-18T18:09:22.743008+00:00 | 218 | false | run time 342s\n```select actor_id, director_id\nfrom actordirector\ngroup by actor_id, director_id\nhaving count(*)>=3\n```\nrun time 448s\n```\nselect actor_id, director_id\nfrom actordirector\ngroup by actor_id, director_id\nhaving count(timestamp)>=3\n```\n | 2 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | EASIEST SOLUTION IN MySQL | easiest-solution-in-mysql-by-hitarthshah-q1zt | IntuitionUPVOTE IF YOU FIND IT HELPFUL.ApproachComplexity
Time complexity:
Space complexity:
Code | HITARTHSHAH2211 | NORMAL | 2025-04-01T04:29:57.633519+00:00 | 2025-04-01T04:29:57.633519+00:00 | 115 | false | # Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
UPVOTE IF YOU FIND IT HELPFUL.
# Approach
<!-- Describe your approach to solving the problem. -->
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
- Space complexity:
<!-- Add your space complexity her... | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Easy Solution | Using Group by and Having | easy-solution-using-group-by-and-having-83lhc | Code | Aminour_Islam | NORMAL | 2025-01-15T13:44:20.830085+00:00 | 2025-01-15T13:44:20.830085+00:00 | 33 | false |
# Code
```mysql []
# Write your MySQL query statement below
select actor_id, director_id
from ActorDirector
group by actor_id, director_id
having count(*) >= 3;
``` | 1 | 0 | ['Database', 'MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | 👉🏻FAST AND EASY TO UNDERSTAND SOLUTION || MySQL | fast-and-easy-to-understand-solution-mys-3je0 | IntuitionApproachComplexity
Time complexity:
Space complexity:
Code | djain7700 | NORMAL | 2025-01-08T18:05:14.577196+00:00 | 2025-01-08T18:05:14.577196+00:00 | 111 | false | # Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
# Approach
<!-- Describe your approach to solving the problem. -->
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
# Code
`... | 1 | 0 | ['Database', 'MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Easy Solution | easy-solution-by-vittalnesaragi-a3dw | \n\n# Code\noraclesql []\n/* Write your PL/SQL query statement below */\nSELECT ACTOR_ID,DIRECTOR_ID FROM ACTORDIRECTOR GROUP BY ACTOR_ID,DIRECTOR_ID HAVING COU | VittalNesaragi | NORMAL | 2024-12-02T09:16:30.070593+00:00 | 2024-12-02T09:16:30.070621+00:00 | 219 | false | \n\n# Code\n```oraclesql []\n/* Write your PL/SQL query statement below */\nSELECT ACTOR_ID,DIRECTOR_ID FROM ACTORDIRECTOR GROUP BY ACTOR_ID,DIRECTOR_ID HAVING COUNT(*)>=3;\n``` | 1 | 0 | ['MySQL', 'Oracle'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Beginner-Friendly Solution Using SQL Server || Clear | beginner-friendly-solution-using-sql-ser-43ao | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | truongtamthanh2004 | NORMAL | 2024-06-03T14:48:50.375640+00:00 | 2024-06-03T14:48:50.375669+00:00 | 331 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 1 | 0 | ['MS SQL Server'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Ezzy Pzzy ✌️ 🤞|| Oracle Solution || BEGINNER FRIENDLY ||Complete Explanation|| Group by with count | ezzy-pzzy-oracle-solution-beginner-frien-sm0r | Intuition\nAs the problem requires pair of two column and its count. Therefore,my first thought is to use Group by. \n\n# Approach\nTo use group by on two colum | Ninja_ | NORMAL | 2023-09-07T11:03:56.178979+00:00 | 2023-09-07T11:03:56.179004+00:00 | 63 | false | # Intuition\nAs the problem requires pair of two column and its count. Therefore,my first thought is to use Group by. \n\n# Approach\nTo use group by on two columns with count we can use:\ngroup by(col1, col2) having count(1)>2\nThis will first collect all the pairs of actors and directors and then count their frequenc... | 1 | 0 | ['Oracle'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | PLSQL solution using having count() | plsql-solution-using-having-count-by-dib-rsnd | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time | DibyaJyoti_Sarmah | NORMAL | 2023-06-06T07:50:20.039113+00:00 | 2023-06-06T07:50:20.039151+00:00 | 263 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --... | 1 | 0 | ['Oracle'] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | Simple Code using HAVING : Actors and Directors Who Cooperated At Least Three Times | simple-code-using-having-actors-and-dire-6zy1 | Code\n\n# Write your MySQL query statement below\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(timestamp) >=3; | kchheda97 | NORMAL | 2023-05-24T18:06:12.912909+00:00 | 2023-05-24T18:07:06.198097+00:00 | 34 | false | # Code\n```\n# Write your MySQL query statement below\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(timestamp) >=3;\n``` | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Simple solution with GROUP BY | simple-solution-with-group-by-by-iliaavd-2i4f | Approach\nGROUP BY + HAVING\n\n# Code\n\nSELECT actor_id, director_id FROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(*) >= 3\n | IliaAvdeev | NORMAL | 2023-04-30T17:42:16.922351+00:00 | 2023-04-30T17:42:16.922411+00:00 | 5 | false | # Approach\nGROUP BY + HAVING\n\n# Code\n```\nSELECT actor_id, director_id FROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(*) >= 3\n``` | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | 1050. Actors and Directors Who Cooperated At Least Three Times | MySQL | 1050-actors-and-directors-who-cooperated-1i4l | \n Add your space complexity here, e.g. O(n) \n\n# Code\n\n# Write your MySQL query statement below\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY | codewithusama | NORMAL | 2023-03-26T13:05:13.176331+00:00 | 2023-03-26T13:05:13.176366+00:00 | 77 | false | \n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n# Write your MySQL query statement below\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(*) >= 3;\n``` | 1 | 0 | ['C++', 'Java', 'MySQL', 'Oracle', 'MS SQL Server'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL || GROUP BY || BEGINNER FRIENDLY || EASY SOLUTION | mysql-group-by-beginner-friendly-easy-so-qq2c | \nSELECT actor_id,director_id FROM ActorDirector \nGROUP BY actor_id,director_id \nhaving count(*) >= 3\n | mohitsatija | NORMAL | 2022-10-18T19:16:59.079059+00:00 | 2022-10-18T19:16:59.079100+00:00 | 51 | false | ```\nSELECT actor_id,director_id FROM ActorDirector \nGROUP BY actor_id,director_id \nhaving count(*) >= 3\n``` | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL solution in 4 lines | mysql-solution-in-4-lines-by-shubhamyada-2aar | \nselect actor_id, director_id\nfrom actordirector\ngroup by actor_id, director_id\nhaving count(1)>= 3\n | shubhamyadav32100 | NORMAL | 2022-10-14T16:25:48.187449+00:00 | 2022-10-14T16:25:48.187478+00:00 | 277 | false | ```\nselect actor_id, director_id\nfrom actordirector\ngroup by actor_id, director_id\nhaving count(1)>= 3\n``` | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Can't be more simple than this one | cant-be-more-simple-than-this-one-by-div-lrag | Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \ngrup by and count\n\n# | Diving_in_Ocean | NORMAL | 2022-10-01T18:43:54.288709+00:00 | 2022-10-01T18:43:54.288749+00:00 | 162 | false | # Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\ngrup by and count\n\n# Code\n```\n# Write your MySQL query statement below\n\nselect actor_id,director_id from (select actor_id , director_id , count(director_id) as t... | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | GROUP BY HAVING | group-by-having-by-kajal_shukla124-cd35 | SELECT actor_id,director_id FROM ActorDirector\nGROUP BY actor_id,director_id HAVING count(timestamp)>2; | kajal_shukla124 | NORMAL | 2022-09-25T07:28:41.181319+00:00 | 2022-09-25T07:28:41.181353+00:00 | 52 | false | SELECT actor_id,director_id FROM ActorDirector\nGROUP BY actor_id,director_id HAVING count(timestamp)>2; | 1 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | mysql soln | mysql-soln-by-quater_nion-xlbo | \nselect actor_id, director_id from ActorDirector\ngroup by actor_id, director_id \nhaving count(actor_id)>=3\n | quater_nion | NORMAL | 2022-09-16T15:46:11.068570+00:00 | 2022-09-16T15:46:11.068616+00:00 | 262 | false | ```\nselect actor_id, director_id from ActorDirector\ngroup by actor_id, director_id \nhaving count(actor_id)>=3\n``` | 1 | 0 | [] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | Actors and Directors who cooperated at least three times. Efficient solution | actors-and-directors-who-cooperated-at-l-ejks | select actor_id,director_id from ActorDirector group by actor_id,director_id\nhaving count(*)>=3; | Vinay_Ghildiyal | NORMAL | 2022-09-11T07:15:08.683728+00:00 | 2022-09-11T07:15:08.683761+00:00 | 174 | false | select actor_id,director_id from ActorDirector group by actor_id,director_id\nhaving count(*)>=3; | 1 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | easy mysql solution | easy-mysql-solution-by-invincible2511-nmsa | \nselect distinct actor_id, director_id from ActorDirector \ngroup by actor_id, director_id\nhaving count(*)>2\n | Invincible2511 | NORMAL | 2022-09-09T13:57:25.790842+00:00 | 2022-09-09T13:57:25.790884+00:00 | 148 | false | ```\nselect distinct actor_id, director_id from ActorDirector \ngroup by actor_id, director_id\nhaving count(*)>2\n``` | 1 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Easy | easy-by-naomi_tqf-gnrz | select actor_id, director_id from ActorDirector \ngroup by actor_id, director_id\nhaving count(*) > 2 | Naomi_TQF | NORMAL | 2022-09-04T03:41:02.719187+00:00 | 2022-09-04T03:41:02.719210+00:00 | 76 | false | select actor_id, director_id from ActorDirector \ngroup by actor_id, director_id\nhaving count(*) > 2 | 1 | 0 | [] | 1 |
actors-and-directors-who-cooperated-at-least-three-times | MySQL solution using [HAVING] | Easy Step-by-Step Explanation | mysql-solution-using-having-easy-step-by-vks1 | \n# Write your MySQL query statement below\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(director_id)>=3;\n\n\ | MohammedHamza | NORMAL | 2022-09-01T18:07:09.533179+00:00 | 2022-09-01T18:07:37.334226+00:00 | 86 | false | ```\n# Write your MySQL query statement below\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(director_id)>=3;\n```\n\n**Explanation:**\n```\nSELECT actor_id, director_id\nFROM ActorDirector\n```\n* First I have selected **actor_id and director_id**.\n\n```\nGROUP BY acto... | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | SQL! 📸📸 | sql-by-sc0d3r-jhcn | \nselect actor_id,\ndirector_id\nfrom ActorDirector\ngroup by actor_id,director_id\nhaving count(*) >= 3\n | SC0d3r | NORMAL | 2022-08-30T12:36:22.903419+00:00 | 2022-08-30T12:36:22.903483+00:00 | 52 | false | ```\nselect actor_id,\ndirector_id\nfrom ActorDirector\ngroup by actor_id,director_id\nhaving count(*) >= 3\n``` | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | MYSQL SOLUTION | GROUPBY && HAVING STATMENT | EASY UNDERSTANDING | mysql-solution-groupby-having-statment-e-d83g | \nSELECT a.actor_id , a.director_id \nFROM ActorDirector a\nGROUP BY a.actor_id , a.director_id \nHAVING COUNT(*) >= 3\n\n\n### kindly vote up if it usefull | gom3a98 | NORMAL | 2022-08-25T09:39:33.716397+00:00 | 2022-08-25T09:39:33.716438+00:00 | 136 | false | ```\nSELECT a.actor_id , a.director_id \nFROM ActorDirector a\nGROUP BY a.actor_id , a.director_id \nHAVING COUNT(*) >= 3\n```\n\n### **kindly vote up if it usefull** | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Faster than 72.91% | MySQL Solution | Easy to Understand | faster-than-7291-mysql-solution-easy-to-blc2k | ```\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(*)>=3; | arghapaul002 | NORMAL | 2022-08-21T00:58:43.158909+00:00 | 2022-08-21T00:58:43.158956+00:00 | 131 | false | ```\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(*)>=3; | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | mysql faster solution | mysql-faster-solution-by-anshika_soni-et8w | ```# Write your MySQL query statement below\nselect actor_id,director_id from ActorDirector group by actor_id,director_id having count(*)>=3 | anshika_soni | NORMAL | 2022-08-14T14:24:55.597240+00:00 | 2022-08-14T14:24:55.597267+00:00 | 107 | false | ```# Write your MySQL query statement below\nselect actor_id,director_id from ActorDirector group by actor_id,director_id having count(*)>=3 | 1 | 0 | ['MySQL'] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Faster than 97% of solutions with CONCAT, GROUP BY and HAVING | faster-than-97-of-solutions-with-concat-hwhwo | select A.actor_id , A.director_id\nfrom ActorDirector A\nGROUP BY CONCAT(A.actor_id ,"_", A.director_id)\nHAVING COUNT(*) >= 3 | sourabh_python | NORMAL | 2022-08-13T12:57:54.821440+00:00 | 2022-08-13T12:57:54.821486+00:00 | 61 | false | select A.actor_id , A.director_id\nfrom ActorDirector A\nGROUP BY CONCAT(A.actor_id ,"_", A.director_id)\nHAVING COUNT(*) >= 3 | 1 | 0 | [] | 0 |
actors-and-directors-who-cooperated-at-least-three-times | Simple Solution faster than 98.77% | simple-solution-faster-than-9877-by-user-g4eh | \n/* Write your T-SQL query statement below */\n\nselect actor_id , director_id FROM ActorDirector \nGROUP BY actor_id , director_id\nHAVING COUNT(*) > 2\n | user6736jw | NORMAL | 2022-08-07T09:37:25.253221+00:00 | 2022-08-07T09:37:45.564346+00:00 | 100 | false | ```\n/* Write your T-SQL query statement below */\n\nselect actor_id , director_id FROM ActorDirector \nGROUP BY actor_id , director_id\nHAVING COUNT(*) > 2\n``` | 1 | 0 | [] | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.