Advanced Queries in MS Access Hele-Mai Haav: CSC230-Spring*03 Advanced Queries in MS Access
Criteria This is a constraint based on Boolean Algebra Truth Table A B A and B A or B T T T T T F F T F T F T F F F F
Boolean Algebra The Database System uses Boolean algebra to evaluate conditions that consist of multiple clauses. The clauses are connected by these operators: AND, OR, NOT
Examples a= 3, b=-1,c=2 (a > 4) and (b < 0) (a > 4) or (b < 0) F T F T F T Not (b < 0) T F
QBE (Category= “Dog”) AND (Color Like “*Yellow*”) AND (DateBorn>#6/1/98#)
Complex Queries All dogs that are yellow or white and born after June 1 ? (dogs AND yellow) OR (white AND born after June 1) (dogs) AND (yellow OR white) AND (born after June 1)
Totals and subtotals Aggregation functions (Sum, Avg; Min..) They operate across several rows of data and return one value
Totals and subtotals Combining row-by-row calculations with aggregation Use Where to limit the rows used for the total (e.g. Sum). Only the final total will be displayed in the result Subtotals for each category can be created using Group By
Cross Tabulation Crosstab (in MS Access) is Group By operation that works with two groups