Add query for the productive directors
Show the movies from directors that appear more than once in the list.
This commit is contained in:
		
							parent
							
								
									6ca531116f
								
							
						
					
					
						commit
						32e9f7f56d
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		|  | @ -48,3 +48,18 @@ WHERE isCartoon = true; | ||||||
| SELECT * | SELECT * | ||||||
| FROM Movies | FROM Movies | ||||||
| WHERE isCartoon = true AND requiresSubtitles = false; | WHERE isCartoon = true AND requiresSubtitles = false; | ||||||
|  | 
 | ||||||
|  | -- show the movies from the directors that show up on the list more than once. | ||||||
|  | SELECT * | ||||||
|  | FROM Movies | ||||||
|  | WHERE director in ( | ||||||
|  |   SELECT director | ||||||
|  |   FROM ( | ||||||
|  |     SELECT director, COUNT(*) as num | ||||||
|  |     FROM Movies | ||||||
|  |     GROUP BY director | ||||||
|  |     HAVING num > 1 | ||||||
|  |     ORDER BY num DESC | ||||||
|  |   ) | ||||||
|  | ) | ||||||
|  | ORDER BY director, rating DESC, year DESC; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue