Presentation is loading. Please wait.

Presentation is loading. Please wait.

DATA MANIPULATION LANGUAGE (Nested Query / Sub Query)

Similar presentations


Presentation on theme: "DATA MANIPULATION LANGUAGE (Nested Query / Sub Query)"— Presentation transcript:

1 DATA MANIPULATION LANGUAGE (Nested Query / Sub Query)
UNIVERSITAS BINA DARMA 2013

2 Nested Query is aliance query ( Query in Query)
Subquery mean query in query. By using subquery, result of from query will become the part of above query [of] him. Located Subquery in clause of WHERE or of HAVING. [At] clause of WHERE, subquery used to choose selected lines which is later;then used by query. While [at] clause of HAVING, subquery used to choose line group which was later;then used by query..

3 Example of 1 : comand to present data [at] tables of jenisfilm the which data at his type column written [at] film tables use IN. : Or use EXISTS

4 Explanation At above example of :
Type SELECT of FROM film referred [as] [by] subquery, while. : SELECT * FROM Jenisfilm domicile as query. Paying attention, there are type data and price [at] tables of jenisfilm un-presented. This matter is caused data type column at type column in film tables.

5 Example 2 : comand to present data from tables of jenisfilm the which data at him type column do not written at film tables use NOTE of IN : Or use NOT EXISTS

6 operator of Comparison ANY and of ALL Operator of ANY used to relate to subquery. This operator yield TRUE ( benar) if at least one of [the] comparison with result of subquery yield value of TRUE. His Illustration : Salary > ANY ( S) If S subquery yield G1, G2 ..., Gn, hence above condition [of] identik by : ( gaji > G1) OR ( salary > G2) OR ... OR ( salary > Gn) Example [of] : comand to present all datas of jenisfilm which the was price of not smallest. :

7 Operator of ALL used to [do/conduct] comparison with subquery
Operator of ALL used to [do/conduct] comparison with subquery. Condition of with ALL yield value of TRUE ( benar) if subquery [do] not yield any or if comparison yield TRUE to each;every value of query to result of subquery. Example [of] : comand to present data of jenisfilm which the was price of highest. :

8 Aggregate Functions (COUNT, SUM, AVG, MIN, MAX)
Comand used to count lines a[n column [at] tables. Example [of] : comand to count type column lines [at] tables of jenisfilm. :

9 2. SUM Comand used to count values a[n column [at] tables. Example : comand to count price column values at tables of jenisfilm :

10 3. AVG Comand used to [count/calculate] mean of value in column at tables. Example : comand to [count/calculate] mean of price column at tables of jenisfilm :

11 4. MIN Comand used to present smallest value from a[n column [at] tables. Example [of] : comand to present smallest value of price column [at] tables of jenisfilm :

12 5. MAX Comand used to present biggest value from column [at] tables. Example: comand to present biggest value of price column at tables of jenisfilm. :


Download ppt "DATA MANIPULATION LANGUAGE (Nested Query / Sub Query)"

Similar presentations


Ads by Google