5.%20Aggregation%20and%20Negation - PowerPoint PPT Presentation

About This Presentation
Title:

5.%20Aggregation%20and%20Negation

Description:

1. 5. Aggregation and Negation. 5.1 Set grouping. R0(y1,...,ym) : R(x1,...xn) where each yi is either xj or xj . is similar to GROUP BY in SQL. Example: ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 6
Provided by: Syed90
Learn more at: http://cse.unl.edu
Category:

less

Transcript and Presenter's Notes

Title: 5.%20Aggregation%20and%20Negation


1
5. Aggregation and Negation
  • 5.1 Set grouping
  • R0(y1,,ym) R(x1,xn)
  • where each yi is either xj or ltxjgt.
  • lt gt is similar to GROUP BY in SQL.
  • Example
  • Reach(x, ltygt) Can_Send_Message(x, y).

2
  • 5.2 Average, Count, Sum
  • These require the aggregated attribute(s) to be
  • constants in each constraint tuple.
  • Example
  • Reach(x, countltygt) Can_Send_Message(x, y).

3
  • 5.3 Area and Volume
  • Example
  • Town_Area(t, arealtx,ygt) Town(t, x, y).
  • 5.4 Minimum and Maximum
  • Aggregation argument a linear function
  • Example
  • Profit(maxlt30x125x28x315x4gt) Crops(x1, x2,
    x3, x4).

4
  • 5.5 Negation
  • R0(x1,,xk) not R(x1,,xk).
  • Example
  • Not_Covered(x, y) not Covered(x, y).

5
  • 5.6 Stratified Datalog Queries
  • A query is evaluated and its output (semantics)
  • will be an input to another query.
  • Example
  • Faster(x, y, minlttgt) Travel(x, y, t).
  • Travel is the output of a query Qtravel. Now it
    is also
  • the input to the above query Qfastest.
  • The entire query is written Qfastest(Qtravel()).
Write a Comment
User Comments (0)
About PowerShow.com