
5.6 练习:查询学生成绩
练习要点
• 新建数据库。
• 添加字段。
• 修改字段。
• 设置字段属性。
• 输入记录。
• 保存数据表。
• 使用选择查询。
查询是一种非常强大而灵活的定位特定记录的方式,可以执行自定义搜索、应用自定义筛选器以及对记录进行排序。在本练习中,将通过“选择查询”功能查询“学生成绩表”中的数据。

操作步骤
STEP|01 新建数据库。执行【文件】|【新建】命令,在展开的列表中选择【空白数据库】选项。

STEP|02 在弹出的对话框中设置数据库名称,单击【创建】按钮。

STEP|03 修改字段和属性。双击ID字段名称,将其更改为“学号”。同时,执行【表格工具】|【字段】|【格式】|【数据类型】|【短文本】命令,更改字段属性。

STEP|04 添加字段。单击【单击以添加】字段下拉按钮,在其下拉列表中选择【短文本】选项,添加一个短文本字段。

STEP|05 此时,系统将以“字段1”名称显示新字段,直接在字段名称框中输入新的名称,即可更改字段名称。使用同样方法,添加其他短文本和数字字段。

STEP|06 单击【单击以添加】字段下拉按钮,在其下拉列表中选择【计算字段】|【数字】选项。

STEP|07 在弹出的【表达式生成器】对话框中输入表达式,单击【确定】按钮。

STEP|08 此时,系统将以“字段1”名称显示新字段,直接在字段名称框中输入新的名称,即可更改字段名称。

STEP|09 输入记录。在数据表中,根据字段类型依次输入相应的数据记录。

STEP|10 保存数据表。单击快速访问工具栏中的保存按钮,在弹出的【另存为】对话框中输入数据表名称,单击【确定】按钮,保存数据表。

STEP|11 选择查询。执行【创建】|【查询】|【查询向导】命令,在弹出的【新建查询】对话框中,选中【简单查询向导】选项,并单击【确定】按钮。

STEP|12 在弹出的【简单查询向导】对话框中,设置【表/查询】选项,同时在其下方将【可用字段】列表框中的字段添加到【选定字段】列表框中,并单击【下一步】按钮。

STEP|13 在弹出的对话框中,选中【明细(显示每个记录的每个字段)】选项,并单击【下一步】按钮。

STEP|14 在弹出的对话框中,设置【请为查询指定标题】选项,同时选中【打开查询查看信息】选项,并单击【完成】按钮。
