《数据库系统原理》教学上机实验报告

这篇实验报告详细介绍了《数据库系统原理》的教学上机实践,涵盖创建数据库和表、数据操作、查询、视图使用、索引与数据完整性、MySQL语言结构以及数据库的备份与恢复、安全性管理。通过一系列实验,学习了SQL语句的运用,理解了数据库管理的关键环节。
摘要由CSDN通过智能技术生成

《数据库系统原理》教学上机实验报告

实验题目:

实验一 创建数据库与表

实验目的和要求:

  1. 了解 mysql 数据库的存储引擎分类;
  2. 了解表的结构特点;
  3. 了解 mysql 的基本数据类型;
  4. 了解空值概念;
  5. 学会使用 sql 语句创建数据库和表。

实验过程:
1.实验题目
创建用于企业管理的员工数据库,数据库名为 yggl,包含员工信息,部门信
息及员工薪水信息。数据库 yggl 包含 3 个表:

  1. Employees: 员工信息表;
  2. Departments: 部门信息表;
  3. Salary: 员工薪水情况表。

2.创建语句如下:
(1)创建数据库

create database yggl;
use yggl;

(2)创建表 departments


                
1、 Find the name, loan number and loan amount of all customers; rename the column name loan_number as loan_id. 2、 Find the names of all customers whose street includes the substring “Main”. 3、Find all customers who have a loan, an account, or both: 4、Find all customers who have both a loan and an account. 5、Find all customers who have an account but no loan. 6、Find the average account balance at the Perryridge branch. 7、 Find the number of tuples in the customer relation. 8、 Find the number of depositors in the bank. 9、 Find the number of depositors for each branch. 10、Find the names of all branches where the average account balance is more than $1,200. 11、Find all loan number which appear in the loan relation with null values for amount. 12、Find all customers who have both an account and a loan at the bank. 13、Find all customers who have a loan at the bank but do not have an account at the bank 14、Find all customers who have both an account and a loan at the Perryridge branch 15、Find all branches that have greater assets than some branch located in Brooklyn. 16、Find the names of all branches that have greater assets than all branches located in 1、创建一个School数据库,该数据库的主数据文件逻辑名称为SCHOOL_data,物理文件名为School.mdf,初始大小为10MB,最大尺寸为无限大,增长速度为10%;数据库的日志文件逻辑名称为School_log,物理文件名为School.ldf,初始大小为1MB,最大尺寸为5MB,增长速度为1MB。 2、用SQL语句建立上述,自定义主键和外键,对于student建立约束条件:ssex仅能取male或female;sage在18和22之间。并完成下面的查询语句。 1、查询所有选修过“Bibliometrics”课的学生的姓名和成绩; 2、查询考试成绩不及格的学生的个数; 3、查询名字中至少含有一个“z”字符的学生的姓名、学号和性别; 4、查询选修了“Introduction to the Internet”课程的学生的学号及其成绩,查询结果按分数的降序排列; 5、查询“Zuo li”同学选修课程的总学时(time)数 6、查询年龄不大于20岁的学生的平均考试成绩; 7、查询 “computer science”专业学生选修 “Database System”的人数; 8、查询同时选修课程“Database System”和“Introduction to the Internet”的学生姓名; 9、查询选修的课程中含有“Wang gang”同学所有选修课程的学生姓名。 10、查询“Information Technology for Information Management”考试成绩为空的学生姓名及专业名称。 11、查询“computer science”专业学生每个人的选修课总学分。 12、查询个人考试平均成绩高于专业平均成绩的学生姓名 13、查询个人考试平均成绩高于女生平均成绩的男生姓名 14、查询比“computer science”专业所有学生年龄都大的学生姓名。 15、查询考试成绩仅有一科不及格学生姓名
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

司沐夜枫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值