Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Manipulation Language Bag. 3

Similar presentations


Presentation on theme: "Data Manipulation Language Bag. 3"— Presentation transcript:

1 Data Manipulation Language Bag. 3
Oleh: Harnan Malik Abdullah, ST., MSc. Program Pendidikan Vokasi Universitas Brawijaya 2017

2 Content Group by Having View

3 The GROUP BY Statement The GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by one or more columns. SQL GROUP BY Syntax SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name;

4 The HAVING Clause The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions. SQL HAVING Syntax SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name HAVING aggregate_function(column_name) operator value;

5 SQL CREATE VIEW Statement
In SQL, a view is a virtual table based on the result-set of an SQL statement. A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database. You can add SQL functions, WHERE, and JOIN statements to a view and present the data as if the data were coming from one single table. SQL CREATE VIEW Syntax CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition Note: A view always shows up-to-date data! The database engine recreates the data, using the view's SQL statement, every time a user queries a view.

6 Ringkasan Group by Having View

7 Terimakasih Danke ありがとう Dankjewel Grazie நன்றி Gracias спасибо Salamat
ขอบคุณ Salamat Thank you Merci شكرا 谢谢 gratias tibi 감사합니다


Download ppt "Data Manipulation Language Bag. 3"

Similar presentations


Ads by Google