"Introduction to Database System" Experimental Report |
date |
2020/9/13 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Topic: Use SQL Server to manage data tables |
Name |
|
student ID |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lab environment: A computer with SQL Server 2005/2008 installed |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Experiment content and completion status: Please use Management Stuio and T-SQL to complete the following:
Student Information Form (student)
T-SQL
Course Information Sheet (course)
T-SQL
Course selection information form (sc)
T-SQL
2) Add a new field "class name (sclass)" in the table student;
T-SQL
3) Delete the field "class name (sclass)" in the table student; Click on the row of Sclass to delete the column
T-SQL
4) Modify the length of the field named "sname" in the student table from the original 6 to 8;
T-SQL
5) Modify the name of the field "sdept" in the student table to "dept" and the length to 20;
T-SQL
6) Modify the sage field name in the student table to sbirth and the type to smalldatetime;
T-SQL
7) Modify the new name of the table student to stu_info; Right click on the table and select Rename
T-SQL
8) Delete the data table student; Right click on the table and select delete
T-SQL
2. Create teacher teaching management database JSSK and complete the following content;
Table name: teachers
T-SQL
Table name: lessons
T-SQL
表名: shouke
T-SQL
2)在shouke表里添加一个授课类别字段,列名为Type,类型为Char,长度为4;
T-SQL
3)将shouke表的Hours的类型改为smallint;
T-SQL
4)删除lessons表中的property列; 点击property所在的行,删除列
T-SQL
3、(选做)创建产品销售数据库CPXS,数据文件的逻辑文件名为cpxs_data,物理文件名为D:\sql\cpxs.mdf;文件初始大小为2MB,自动增长,每次增长1MB;日志文件逻辑文件名为cpxs_log,物理文件为;文件初始大小2MB,自动增长,每次增长15%; T-SQL
1)在数据库CPXS中创建下列三张表; 表名:产品表(cp)表结构
T-SQL
表名:销售商(xss)表结构
T-SQL
表名: 产品销售(xss)表结构
T-SQL
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
出现的问题及解决方案: 使用T-SQL语句修改表名称,字段名称,字段类型时,不清楚具体方法,在网上查找方法,完成本次实验。 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
教师评语及得分: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||