Example 1 on GROUP BY and HAVING in SQL || Lesson 83 || DBMS || Learning Monkey ||
Автор: Wisdomers - Computer Science and Engineering
Загружено: 2021-12-29
Просмотров: 551
Описание:
Example 1 of GROUP BY and HAVING in SQL
We will try to understand Example 1 of GROUP BY and HAVING in SQL in this class.
GROUP BY and HAVING concepts are already discussed in our previous class.
Example 1 of GROUP BY and HAVING in SQL
Let’s consider the question below.
Question: Write a Query to find the Count of Employees in each project location.
To understand this concept, we should know the cartesian product in SQL.
To get the output for this query, we need two tables, works_on and project table of the company database, as shown below.
After the FROM clause, works_on and project tables are used. So, the cartesian product of both the tables will be made.
On the cartesian product table, we have to apply the condition where p.pnumber = w.pno.
Based on the above condition, we have to use the GROUP BY clause to get the count of the employees on the resultant table.
The query and the output of the query are as shown below.
#learningmonkey #dbms #placements #gatecse #gatedbms #campusplacements
Link for playlists:
/ @wisdomerscse
Link for our website: https://learningmonkey.in
Follow us on Facebook @ / learningmonkey
Follow us on Instagram @ / learningmonkey1
Follow us on Twitter @ / _learningmonkey
Mail us @ [email protected]
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: