Download presentation
Presentation is loading. Please wait.
1
1 Pertemuan 14 Object Query Language (Lanjutan bagian 1) Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0
2
2 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Mahasiswa dapat Menghasilkan query language dalam object data model (C3)
3
3 Outline Materi Selecting objects from a collection Complex test an objects Arithmetic comparisons Tests on collections String matching
4
4 Selecting objects from a collection The general form of this type of OQL query is Select From Where
5
5 Selecting objects from a collection Selecting objects from more than one collection –Union –Intersect –Except
6
6 Complex test an objects The rules for evaluating a Boolean expression constructed using and, or, not, are: –An expression is evaluated form left to right –Sub expressions in brackets are evaluated first –Not are evaluated before “and” and “or”.
7
7 Arithmetic comparisons = (equal) != (not equal to) > (greater than) >= (greater than or equal to < (less than) <= (less than or equal to
8
8 Tests on collections OQL Boolean expressions can test the membership of collection objects as in the object algebra. The following comparison can be made: –For all –Exist –Unique –In –Some, any, all –Set inclusion
9
9 String matching String matching can be used to select objects on the basis of textual properties, such as names or decriptions ? * or % Example
10
10 String matching Accessing Object in a List or an Array –Accessing object in a list or an array can be done in the following way: First, Last Access by index List or Array addition
11
11 String matching Grouping objects Example Select * From products p Group by colour:p.colour
12
12 SUMMARY Objects are selected from a collection using the SQL-like select…from…where form of query The form clause specifies which collection is to be searched, and the where clause specifies the condition for selecting an object
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.