Presentation is loading. Please wait.

Presentation is loading. Please wait.

CST221: Database Systems (II) Dr. Zhen Jiang Computer Science Department West Chester University West Chester, PA 19383.

Similar presentations


Presentation on theme: "CST221: Database Systems (II) Dr. Zhen Jiang Computer Science Department West Chester University West Chester, PA 19383."— Presentation transcript:

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 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

4 Exercise 2

5

6

7

8

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

11

12

13

14 Add criteria to meet the certain requirement

15

16 Datasheet view Design view

17

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 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)

20 Show the Enum, name, salary of all employees whose names have 5 letters.

21

22

23

24

25

26 Show the name, Enum,salary, and age of all employees with a salary > $40,000 AND younger than 25

27

28

29

30

31

32 Show the Enum of all employees sorted by salary in the ascending order

33 Hidden column for criteria (not displayed in the list)

34

35 List all different Dnum, without duplicates.

36

37

38

39 List top 5 high paid employees.

40

41

42 List the LName of all employees in the department (Dnum) entered by the user.

43

44

45

46

47

48

49

50 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).

51

52

53

54

55

56 List the max, min, and average of salary for all employees.

57

58

59

60

61

62

63 Joint table (AC 105-109) Dept DnumDnameCity D22Web WC D25Databases NY D28Software LA Emp EnumLNameagesalaryDnumwYears E101Jones45$56,000.00D2512 E202Anders66$46,000.00D2225 E303Smith34$25,000.00D229 E404Rivera22$30,000.00D251 E505Brown45$80,000.00D2517 E606Caldwell52$70,000.00D2820 E707Stiles44$65,000.00D2811 E808Walker48$90,000.00D2221 E909Hartman20$25,000.00D281 E222Carter29$35,000.00D253

64 For each employee, print out the department name.

65

66

67

68

69

70

71 Assignment 2

72 Statistics of an group Exercise 3

73 Show the average age (label as average age) and average salary (label as average salary) for all employees

74

75

76

77

78

79 Show the max, min and average age for all employees in Dept Software

80

81

82

83 Still incorrect!

84

85

86 Join Table (AC 105)

87 For all employees under 30, show a count of these employees and their average salary.

88

89 For all employees in department D22 or D28, show a count of these employees, their average age, and maximum salary

90

91

92

93

94

95

96 For each department list avg, max and min age, along with a count of employees in each department.

97

98

99

100

101 For each department find a count and average salary for all employees younger than 40.

102

103

104

105

106 For each department with an average salary of >40000 list the dnums, employee count for these departments.

107

108

109 For each department with less than 4 employees, show the average age and number of employees.

110

111

112 For each department with more than 2 people over 40 list deptNum, and a count of these people.

113

114

115 Assignment 3

116 Maintenance Record addition, page AC 144 Search, page AC 145 Record update, page AC 147 Record deletion, page AC 148 Filter, page AC 149


Download ppt "CST221: Database Systems (II) Dr. Zhen Jiang Computer Science Department West Chester University West Chester, PA 19383."

Similar presentations


Ads by Google