Download presentation
Presentation is loading. Please wait.
1
CST221: Database Systems (II)
Dr. Zhen Jiang Computer Science Department West Chester University West Chester, PA 19383
2
Querying Creation (Query wizzard) Save Use
3
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 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
4
Exercise 2
9
Show the name and age and salary of all employees who are younger than 25.
10
Double click the items to include in the list
14
Add criteria to meet the certain requirement
16
Datasheet view Design view
18
Hidden column for criteria (not displayed in the list)
19
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 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”)
20
Show the Enum, name, salary of all employees whose names have 5 letters.
26
Show the name, Enum ,salary, and age of all employees with a salary > $40,000 AND younger than 25
32
Show the Enum of all employees sorted by salary in the ascending order
33
Hidden column for criteria (not displayed in the list)
35
List top 5 high paid employees.
38
List the LName of all employees in the department (Dnum) entered by the user.
46
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).
52
List the max, min, and average of salary for all employees.
59
Joint table (AC 105-109) Emp Dept Enum LName age salary Dnum wYears
Jones 45 $56,000.00 D25 12 E202 Anders 66 $46,000.00 D22 25 E303 Smith 34 $25,000.00 9 E404 Rivera 22 $30,000.00 1 E505 Brown $80,000.00 17 E606 Caldwell 52 $70,000.00 D28 20 E707 Stiles 44 $65,000.00 11 E808 Walker 48 $90,000.00 21 E909 Hartman E222 Carter 29 $35,000.00 3 Dept Dnum Dname City D22 Web WC D25 Databases NY D28 Software LA
60
For each employee, print out the department name.
67
Assignment 2
68
Statistics of an group Exercise 3
69
Show the average age (label as “average age”) and average salary (label as “average salary”) for all employees
75
Show the max, min and average age for all employees in Dept “Software”
79
Still incorrect!
82
Join Table (AC 105)
83
For all employees under 30, show a count of these employees and their average salary.
85
For all employees in department “D22” or “D28”, show a count of these employees, their average age, and maximum salary
88
What will be the result?
92
For each department list avg, max and min age, along with a count of employees in each department.
97
For each department find a count and average salary for all employees younger than 40.
102
For each department with an average salary of > list the dnums, employee count for these departments.
105
For each department with less than 4 employees, show the average age and number of employees.
108
For each department with more than 2 people over 40 list deptNum, and a count of these people.
111
Assignment 3
112
Maintenance Record addition, page AC 144 Search, page AC 145
Record update, page AC 147 Record deletion, page AC 148 Filter, page AC 149
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.