Tải bản đầy đủ (.pptx) (36 trang)

Thuyết trình môn cơ sở dữ liệu FLEXIBLE QUERY ANSWERING SYSTEM

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (382.45 KB, 36 trang )

FLEXIBLE QUERY ANSWERING SYSTEM

NHÓM 3:

LÊ HỒNG DŨNG – 7140819
LÊ NGUYÊN DŨNG – 7140224
NGÔ ĐÌNH DŨNG – 1570203
ÂU MẬU DƯƠNG – 7140820

e

b

Price

GVHD: PGS.TS. ĐẶNG TRẦN KHÁNH

c

a
g
i

d

l

m
k
Distance



NỘI DUNG
1.Skyline Queries
2.SQLf Queries
3.So sánh Skyline vs. SQLf
4.Kết luận


Skyline Queries
 Definition of the Skyline:
Cho 2 vector hi, hj ϵ Rn với hi = <xi1,…,xin>, hj = <xj1,…,xjn>.
Ta nói hi DOMINATES hj , kí hiệu hi > hj (hi >> hj ) nếu và chỉ nếu:
ít nhất một xil > xjl
 Ví dụ:

tất cả xik >= xjk


Skyline Queries
 Cú pháp:

SELECT . . . FROM . . . WHERE . . .
GROUP BY . . . HAVING . . .
SKYLINE OF [ DISTINCT ] d1 [ MIN | MAX | DIFF ],
. . . , dm [ MIN | MAX | DIFF ]
ORDER BY . . .


Skyline Queries
 Ví dụ: Xét bảng dữ liệu trong nhà hàng như sau


 S= Service, F: food, D: décor
Restaurant
Summer Moon
Zakopane
Brearton Grill
Yamanote
Fenton & Pickle
Briar Patch BBQ
 Query: Tìm S,F,D max và price là min

S
21
24
15
22
16
14

F
25
20
18
22
14
13

D
19
21

20
17
10
3

Price
47.50
56.00
62.00
51.50
17.50
22.50


Skyline Queries
Result
Restaurant

S

F

D

Price

Summer Moon

21


25

19

47.50

Zakopane

24

20

21

56.00

Yamanote

22

22

17

51.50

Fenton & Pickle

16


14

10

17.50

Skyline Query

Restaurants in the Skyline

SELECT * FROM FoodGuide
SKYLINE OF S MAX , F MAX , D MAX, Price MIN


Hiện thực Skyline Queries
Data set

Window









Temporary file



Hiện thực Skyline Queries
Data set








Window
t = 1
Time stamp t to do not compare two
tuples are never compared twice

Temporary file


Hiện thực Skyline Queries
Window

Data set
compare










t = 1

Temporary file


Hiện thực Skyline Queries
Data set

dominated






Window
t = 1

Temporary file


Hiện thực Skyline Queries
Window

Data set









t = 1
dominated

Temporary file


Hiện thực Skyline Queries
Window

Data set








t = 1

incomparable

Temporary file



Hiện thực Skyline Queries
Window

Data set








t = 1
t = 2
incomparable

Temporary file


Hiện thực Skyline Queries
Window

Data set









t = 1
t = 2
incomparable

Temporary file


Hiện thực Skyline Queries
Data set








Window
t = 1
t = 2

Temporary file
t = 3


Hiện thực Skyline Queries
Window

Data set









t = 1
t = 2
dominated
compare

Temporary file
t = 3


Hiện thực Skyline Queries
Data set








Window
t = 1
t = 2

removed

Temporary file
t = 3


Hiện thực Skyline Queries
Window

Data set








t = 1
t = 4
replace

Temporary file
t = 3


Hiện thực Skyline Queries
Data set








iterate until OEF

Window

output window at the
end of the iteration

t = 1
t = 4

Temporary file
t = 3



Hiện thực Skyline Queries
Window

Data set









next
iteration

Temporary file
t = 3



SQLf Queries
 SQLf (SQLfuzzy) là mở rộng của SQL
 Tập mờ (Fuzzy Set): Cho tập vũ trụ Ω. Tập mờ A trên Ω được định nghĩa như sau:
A ={(x,μA(x))|x∈Ω}. Hàm μA(x): Ω→[0,1] lượng hóa mức độ mà các phần tử x thuộc về A


SQLf Queries
 Ví dụ: Một tập mờ B của các số tự nhiên nhỏ hơn 5 với hàm thuộc μB(x) có
dạng như Hình dưới định nghĩa trên tập vũ trụ X sẽ chứa các phần tử sau:
B = {(1,1),(2,1),(3,0.95),(4,0.7) ,(5,0)}


SQLf Queries
 Lát cắt α (α-cut)


SQLf Queries
 Ví dụ:



SQLf Queries
Cú pháp ngôn ngữ SQLf:

SELECT <attributes>
FROM <relations>
WHERE <fuzzy_conditions>
WITH CALIBRATION [n|α|n, α]
 n: số lượng tuple trả về
 α: giá trị α-cut


×