1.16k likes | 1.27k Views
CST221: Database Systems (II). Dr. Zhen Jiang Computer Science Department West Chester University West Chester, PA 19383. Querying. Creation (Query wizzard ) Save Use. Wildcard (*, ?), page AC87 Use criteria for a field not included in the result list, page AC88
E N D
CST221: Database Systems (II) Dr. Zhen Jiang Computer Science Department West Chester University West Chester, PA 19383
Querying • Creation (Query wizzard) • Save • Use
Wildcard (*, ?), page AC87 • Use criteria for a field not included in the result list, page AC88 • Parameter Query, page AC89 • Join table, page AC103 • Comparison Operator, page AC94 • Compound criterion (AND, OR), page AC 95 • Sorting, page AC97 • Omitting duplicates, page AC 100 • Multiple keys (high priority from left to right), page AC101 • Top-value query, page AC 102 • Calculated field, page AC 113 • Calculating Statistics (built-in statistics, group), page AC 117
Show the name and age and salary of all employees who are younger than 25.
Datasheet view • Design view
Wildcard (*, ?), such as “Ber*” in City field • Use criteria for a field not included in the result list, disabled show property • One table, decide it early and add all fields at the beginning • Comparison Operator, such as >10000 in amount paid field • Compound criterion (AND => 1 row, OR => another row) • Sorting • Omitting duplicates, “unique record” in property sheet • Multiple keys (high priority from left to right) • Top-value query, “return” in top design view (very early stage) • Calculated field, “zoom” in shortcut menu (e.g., type “Total Amount:[Amount Paid]+[Current Due]”) • Calculating Statistics (built-in statistics, “group by”)
Show the Enum, name, salary of all employees whose names have 5 letters.
Show the name, Enum ,salary, and age of all employees with a salary > $40,000ANDyounger than 25
Show the Enumof all employees sorted by salary in the ascending order
List the LName of all employees in the department (Dnum) entered by the user.
List the LName of all employees with a new column labeled “hiring age”, which has a value by subtracting the years of working (wYears) from the current age (age).