SlideShare a Scribd company logo
1 of 31
Hive
Presented by : Mohammad
Mashhoood Syed
What is Hive?
• Apache Hive is a data warehouse software built on top of
Hadoop that facilitates reading, writing and managing
large datasets residing in distributed storage using SQL.
• Hive provides the necessary SQL abstraction so that SQL-
like queries can be integrated with the underlying Java
code without having to implement the queries in the
low-level Java API
• It allows structure to be projected onto data that is
already in storage.
• It can create schemas/table definitions that
point to data in Hadoop, turning unstructured
data into structured data.
• Helps to treat your data in Hadoop as Tables;
which can be partitioned and bucketed.
Hive is not
• A relational database
• A design for OnLine Transaction Processing
(OLTP)
• A language for real-time queries and row-level
updates
Features of hive
• Hive is fast and scalable.
• It provides SQL-like queries (i.e., HQL) that are
implicitly transformed to MapReduce or Spark
jobs.
• It is capable of analyzing large datasets stored in
HDFS.
• It can operate on compressed data stored in the
Hadoop ecosystem.
• It supports user-defined functions (UDFs) where
user can provide its functionality.
Hive Origination
• Hive originated as an internal project
in Facebook
• Later it was adopted in Apache as an
open source project
• Facebook deals with massive amount
of data (petabytes scale) and it needs
to perform more than 75k ad-hoc
queries on this massive amount of
data
Why Hive?
• Since the data is collected from multiple
servers and is of diverse nature, any RDBMS
system could not fit as probable solution
• Map Reduce could be a natural choice, but it
had its own limitations
Architecture
Working
1. Execute Query: The Hive interface such as Command Line or Web UI sends
query to Driver (any database driver such as JDBC, ODBC, etc.) to execute
2. Get Plan: The driver takes the help of query compiler that parses the query to
check the syntax and query plan or the requirement of query
3. Get Metadata: The compiler sends metadata request to Metastore (any
database).
4. Send Metadata : Metastore sends metadata as a response to the compiler.
5. Send Plan : The compiler checks the requirement and resends the plan to the
driver. Up to here, the parsing and compiling of a query is complete.
6. Execute Plan: The driver sends the execute plan to the execution engine.
7.Execute Job: Internally, the process of execution job is a MapReduce job.
The execution engine sends the job to JobTracker, which is in Name node and
it assigns this job to TaskTracker, which is in Data node. Here, the query
executes MapReduce job.
Data modeling
Tables
Partitions
buckets
Here tables are organized into partitions for
grouping same type of data based on partition
key
Partitions divided further into buckets based on
some other column
Tables in hive are created the same way it is
done in RDBMS
Different modes of Hive
• Hive can operate in two modes depending on
the size of data nodes in Hadoop.
• These modes are :
• Local mode
• Map reduce mode
Local Mode
• If the Hadoop installed under pseudo mode
with having one data node we use Hive in this
mode
• If the data size is smaller in term of limited to
single local machine, we can use this mode
• Processing will be very fast on smaller data
sets present in the local machine
Map Reduce mode
• If Hadoop is having multiple data nodes and
data is distributed across different node we
use Hive in this mode
• It will perform on large amount of data sets
and query going to execute in parallel way
• Processing of large data sets with better
performance can be achieved through this
mode
Advantages of hive
• Keeps queries running fast
• Takes very little time to write Hive query in
comparison to MapReduce code
• HiveQL is a declarative language like SQL
• Multiple users can simultaneously query the
data using Hive-QL.
• Very easy to write query including joins in Hive
• Simple to learn and use
Disadvantages of Hive
• It's not designed for Online transaction
processing (OLTP), it is only used for the
Online Analytical Processing (OLAP).
• Hive supports overwriting or apprehending
data, but not updates and deletes.
• Sub-queries are not supported, in Hive
Copying file from local system into
Hadoop environment
• Hdfs dfs –copyFromLocal (file path)
destination path
Creating table
Give full file path
IMDB dataset
Number of movies per year
select startyear,count(*) as count from
movies where startyear > 2000 and
startyear < 2022 group by startyear
order by count;
Comedy movies
• select primarytitle,startyear,runtimeminutes,genres from
movies where array_contains(genres,"Comedy");
• select distinct titletype from movies;
Upcoming horror movies
select * from movies where titletype = 'movie'
and startyear > 2021 and
array_contains(genres,"Horror");
Movies in 2021 with rating more than 9
select m.startyear,m.titletype,m.primarytitle,r.averagerating,m.genres from movies as
m join rating as r on m.tconst = r.tconst
where m.titletype = 'movie' and m.startyear = 2021 and r.averagerating > 9 ;
Action series with rating more than 9
select m.startyear,m.titletype,m.primarytitle,r.averagerating,m.genres from movies as
m join rating as r on m.tconst = r.tconst
where m.titletype = 'tvSeries' and r.averagerating > 9 and
array_contains(genres,"Action");
•THANK YOU !

More Related Content

Similar to Unveiling Hive: A Comprehensive Exploration of Hive in Hadoop Ecosystem

Similar to Unveiling Hive: A Comprehensive Exploration of Hive in Hadoop Ecosystem (20)

Working with Hive Analytics
Working with Hive AnalyticsWorking with Hive Analytics
Working with Hive Analytics
 
Etu Solution Day 2014 Track-D: 掌握Impala和Spark
Etu Solution Day 2014 Track-D: 掌握Impala和SparkEtu Solution Day 2014 Track-D: 掌握Impala和Spark
Etu Solution Day 2014 Track-D: 掌握Impala和Spark
 
SQL Server 2012 and Big Data
SQL Server 2012 and Big DataSQL Server 2012 and Big Data
SQL Server 2012 and Big Data
 
Apache Hive
Apache HiveApache Hive
Apache Hive
 
6.hive
6.hive6.hive
6.hive
 
Apache Hadoop Hive
Apache Hadoop HiveApache Hadoop Hive
Apache Hadoop Hive
 
Impala for PhillyDB Meetup
Impala for PhillyDB MeetupImpala for PhillyDB Meetup
Impala for PhillyDB Meetup
 
Hadoop.pptx
Hadoop.pptxHadoop.pptx
Hadoop.pptx
 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
 
Technologies for Data Analytics Platform
Technologies for Data Analytics PlatformTechnologies for Data Analytics Platform
Technologies for Data Analytics Platform
 
Big Data and Hadoop
Big Data and HadoopBig Data and Hadoop
Big Data and Hadoop
 
Big data - Online Training
Big data - Online TrainingBig data - Online Training
Big data - Online Training
 
Big Data & Analytics (CSE6005) L6.pptx
Big Data & Analytics (CSE6005) L6.pptxBig Data & Analytics (CSE6005) L6.pptx
Big Data & Analytics (CSE6005) L6.pptx
 
List of Engineering Colleges in Uttarakhand
List of Engineering Colleges in UttarakhandList of Engineering Colleges in Uttarakhand
List of Engineering Colleges in Uttarakhand
 
Hadoop.pptx
Hadoop.pptxHadoop.pptx
Hadoop.pptx
 
Hadoop.pptx
Hadoop.pptxHadoop.pptx
Hadoop.pptx
 
Hadoop ppt1
Hadoop ppt1Hadoop ppt1
Hadoop ppt1
 
Unit 5-apache hive
Unit 5-apache hiveUnit 5-apache hive
Unit 5-apache hive
 
Getting started big data
Getting started big dataGetting started big data
Getting started big data
 
Hadoop Primer
Hadoop PrimerHadoop Primer
Hadoop Primer
 

Recently uploaded

9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一F La
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理e4aez8ss
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAbdelrhman abooda
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)jennyeacort
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degreeyuu sss
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 

Recently uploaded (20)

9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 

Unveiling Hive: A Comprehensive Exploration of Hive in Hadoop Ecosystem

  • 1. Hive Presented by : Mohammad Mashhoood Syed
  • 2. What is Hive? • Apache Hive is a data warehouse software built on top of Hadoop that facilitates reading, writing and managing large datasets residing in distributed storage using SQL. • Hive provides the necessary SQL abstraction so that SQL- like queries can be integrated with the underlying Java code without having to implement the queries in the low-level Java API • It allows structure to be projected onto data that is already in storage.
  • 3. • It can create schemas/table definitions that point to data in Hadoop, turning unstructured data into structured data. • Helps to treat your data in Hadoop as Tables; which can be partitioned and bucketed.
  • 4. Hive is not • A relational database • A design for OnLine Transaction Processing (OLTP) • A language for real-time queries and row-level updates
  • 5. Features of hive • Hive is fast and scalable. • It provides SQL-like queries (i.e., HQL) that are implicitly transformed to MapReduce or Spark jobs. • It is capable of analyzing large datasets stored in HDFS. • It can operate on compressed data stored in the Hadoop ecosystem. • It supports user-defined functions (UDFs) where user can provide its functionality.
  • 6. Hive Origination • Hive originated as an internal project in Facebook • Later it was adopted in Apache as an open source project • Facebook deals with massive amount of data (petabytes scale) and it needs to perform more than 75k ad-hoc queries on this massive amount of data
  • 7. Why Hive? • Since the data is collected from multiple servers and is of diverse nature, any RDBMS system could not fit as probable solution • Map Reduce could be a natural choice, but it had its own limitations
  • 10. 1. Execute Query: The Hive interface such as Command Line or Web UI sends query to Driver (any database driver such as JDBC, ODBC, etc.) to execute 2. Get Plan: The driver takes the help of query compiler that parses the query to check the syntax and query plan or the requirement of query 3. Get Metadata: The compiler sends metadata request to Metastore (any database). 4. Send Metadata : Metastore sends metadata as a response to the compiler. 5. Send Plan : The compiler checks the requirement and resends the plan to the driver. Up to here, the parsing and compiling of a query is complete. 6. Execute Plan: The driver sends the execute plan to the execution engine. 7.Execute Job: Internally, the process of execution job is a MapReduce job. The execution engine sends the job to JobTracker, which is in Name node and it assigns this job to TaskTracker, which is in Data node. Here, the query executes MapReduce job.
  • 11. Data modeling Tables Partitions buckets Here tables are organized into partitions for grouping same type of data based on partition key Partitions divided further into buckets based on some other column Tables in hive are created the same way it is done in RDBMS
  • 12. Different modes of Hive • Hive can operate in two modes depending on the size of data nodes in Hadoop. • These modes are : • Local mode • Map reduce mode
  • 13. Local Mode • If the Hadoop installed under pseudo mode with having one data node we use Hive in this mode • If the data size is smaller in term of limited to single local machine, we can use this mode • Processing will be very fast on smaller data sets present in the local machine
  • 14. Map Reduce mode • If Hadoop is having multiple data nodes and data is distributed across different node we use Hive in this mode • It will perform on large amount of data sets and query going to execute in parallel way • Processing of large data sets with better performance can be achieved through this mode
  • 15. Advantages of hive • Keeps queries running fast • Takes very little time to write Hive query in comparison to MapReduce code • HiveQL is a declarative language like SQL • Multiple users can simultaneously query the data using Hive-QL. • Very easy to write query including joins in Hive • Simple to learn and use
  • 16. Disadvantages of Hive • It's not designed for Online transaction processing (OLTP), it is only used for the Online Analytical Processing (OLAP). • Hive supports overwriting or apprehending data, but not updates and deletes. • Sub-queries are not supported, in Hive
  • 17. Copying file from local system into Hadoop environment • Hdfs dfs –copyFromLocal (file path) destination path
  • 20.
  • 21.
  • 22.
  • 23.
  • 25. Number of movies per year select startyear,count(*) as count from movies where startyear > 2000 and startyear < 2022 group by startyear order by count;
  • 26. Comedy movies • select primarytitle,startyear,runtimeminutes,genres from movies where array_contains(genres,"Comedy");
  • 27. • select distinct titletype from movies;
  • 28. Upcoming horror movies select * from movies where titletype = 'movie' and startyear > 2021 and array_contains(genres,"Horror");
  • 29. Movies in 2021 with rating more than 9 select m.startyear,m.titletype,m.primarytitle,r.averagerating,m.genres from movies as m join rating as r on m.tconst = r.tconst where m.titletype = 'movie' and m.startyear = 2021 and r.averagerating > 9 ;
  • 30. Action series with rating more than 9 select m.startyear,m.titletype,m.primarytitle,r.averagerating,m.genres from movies as m join rating as r on m.tconst = r.tconst where m.titletype = 'tvSeries' and r.averagerating > 9 and array_contains(genres,"Action");