首页数据库数据库考试试题及答案,考试100题库

数据库考试试题及答案,考试100题库

编程之家2026-05-17904次浏览

很多朋友对于数据库考试试题及答案和考试100题库不太懂,今天就由小编来为大家分享,希望可以帮助到大家,下面一起来看看吧!

数据库考试试题及答案,考试100题库

SQL数据库试题求解

------------------------------------------------------

create table students(st_id varchar(20),st_name varchar(50),sex varchar(10))

insert into students(st_id,st_name,sex)

select'st001','张杰','男' union all

select'st002','公孙燕飞','男' union all

select'st003','王楠','女' union all

数据库考试试题及答案,考试100题库

select'st004','王伟','男' union all

select'st005','李燕纹','女' union all

select'st006','孙武','男'

select*

from students

create table teachers(t_id varchar(20),t_name varchar(50),t_lesson varchar(50))

数据库考试试题及答案,考试100题库

insert into teachers

select't001','张老师','数学' union all

select't002','李老师','英语'

delete from results

create table results(r_id varchar(20),r_fenshu int,r_stid varchar(50),r_tid varchar(50))

insert into results

select'r001','90','st001','t002' union all

select'r002','68','st005','t001' union all

select'r003','92','st003','t001' union all

select'r004','82','st006','t002' union all

select'r005','70','st002','t002' union all

select'r006','86','st002','t001' union all

select'r007','57','st003','t002' union all

select'r008','76','st006','t001' union all

select'r009','55','st001','t001' union all

select'r010','77','st004','t002' union all

select'r011','58','st005','t002'

----------------------------------------------------------

1.

select st_id

from students

where st_name='王伟'

2.select st_id,st_name

from students

where st_name like'__燕%'

3 select st_name,len(st_name) as名字长度

from students

where sex='男'

4 select min(r_fenshu) as最低分数

from teachers t inner join results r on t.t_id=r.r_tid

where t_lesson='数学'--这个是不考虑成绩中有null值的

5 select s.st_id as学生编号,r_fenshu as分数,r_tid as课目号

from students s inner join results r on s.st_id=r.r_stid

where s.sex='女'

--如果还要课目的名称的话请用下面的

select s.st_id as学生编号,r.r_fenshu as分数,r.r_tid as课目号,t.t_lesson as课目名称

from students s inner join results r on s.st_id=r.r_stid

inner join teachers t on r.r_tid= t.t_id

where s.sex='女'

6 select avg(r.r_fenshu)

from results r inner join teachers t on r.r_tid= t.t_id

where t.t_lesson='英语'

7.select*

from students s inner join results r on s.st_id=r.r_stid

inner join teachers t on r.r_tid= t.t_id

where s.st_id in(select top 2 st_id from students order by st_id desc)

order by s.st_id desc

8 select sum(r.r_fenshu) as总分

from results r inner join students s on r.r_stid=s.st_id

where s.st_name='王楠'

9.select distinct s.st_id,s.st_name

from students s inner join results r on s.st_id= r.r_stid

where st_id not in(select r_stid from results where r_fenshu<60) and st_id not in(select r_stid from results where r_fenshu>=90)

10 update results

set r_fenshu= r_fenshu+ 10

--如果分数不可能大于100请用这句 set r_fenshu= case when r_fenshu+ 10<=100 then r_fenshu+ 10 else 100 end

where r_stid in(select st_id from students where sex='女')

1进阶题

select t.t_name,count(*)

from students s,teachers t,results r

where r.r_tid= t.t_id

and s.st_id=r.r_stid

and r.r_fenshu>= 60

and t.t_id in(select t_id from teachers where t_lesson='数学')

--and t_lesson='数学'

group by t.t_name

2

select top 1 sum(r_fenshu) as总分,t.t_lesson,t_id,t_name

from results r,teachers t

where r.r_tid= t.t_id

group by t.t_lesson,t_id,t_name

order by总分 desc

3. delete from results where r_stid in(select r_stid from results group by r_stid having count(r_tid)= 1)

1选做题

select d.name from sysobjects d where d.xtype='U'

2.select top 5* from students order by newid()

计算机二级mysql数据库模拟题及答案(2)

练习题二

1)sp_helpdb该代码的功能是:

A返回数据库的基本信息

B返回数据库的`使用空间

C返回数据库的变量名称

D返回数据库的表名

2)sp_helpdb中有这样一条信息:Updateability=Read_Write该代码表示的正确含义是:

A更新能力为可读可写

B恢复模式为完整恢复

C可用于所有用户

D兼容级别

3)sp_helpdb中有这样一条信息:status= online该代码表示的正确含义是:

A表示数据库的状态为:可用于查询

B表示数据库的状态为:正在还原数据库

C表示数据库的状态为:数据库未恢复

D表示数据库已被显示置于脱机状态

4)sp_helpdb中有这样一条信息:IsFulltextEnabled该代码的正确含义是:

A数据库自动生成统计信息

B自动更新统计信息

C数据库已启用全文功能。

D数据库引擎检测信息

5)sp_helpdb中有这样一条信息:COMPATIBILITY_LEVEL=90该代码表示的正确含义是:

A数据库兼容级别是2000

B数据库兼容级别是2005

C数据库兼容级别是2008

D以上说法都不对

6)数据定义语言中的创建,修改,删除这三个英语单词下列哪项才是完全正确的?

A创建(create),修改(alter),删除(update)

B创建(alter),修改(modify),删除(drop)

C创建(create),修改(alter),删除(drop)

D创建(alter),修改(create),删除(drop)

7)SQL 2005的建表语句要写在______之内?

A{}

B[ ]

C()

D<>

8)建表语句中的 not null,该代码表示的含义是:

A允许空格B非空约束

C不允许写入数据

D不允许读取数据

9)select* from student该代码中的*号,表示的正确含义是:

A普通的字符*号

B错误信息

C所有的字段名

D模糊查询

10)向数据表添加数据,哪些是添加的关键字?

Ainsert

B update

C delete

D select

更多计算机二级考试相关试题分享:

《数据库原理应用》简答题(数据库原理与应用试题及答案)

1.数据库:是以某种文件结构存储的一系列信息表,这种文件结构使您能够访问这些表、选择表中的列、对表进行排序以及根据各种标准选择行。数据库通常有多个索引与这些表中的许多列相关联,所以我们能尽可能快地访问这些表。数据库管理系统:随着计算机在信息处理、情报检索及各种管理系统的不断发展,使用计算机时需要处理大量的数据、建立和检索大量的表格,将这些数据和表格按一定的规律组织起来,以便处理更有效、检索更迅速、用户使用更方便,于是就出现了数据库管理系统。数据库和数据库软件就组成了数据库管理系统。数据库管理系统有各种类型,目前许多计算机包括微型机都配有数据库管理系统,如FoxPro、Oracle、sqlserver等。

2.数据库系统由数据库(DB),数据管理系统(DBMS),应用程序,用户和硬件组成,其中最关键的部分是数据库.3.主关键字(Primarykey):用来唯一辨别表格里记录的备选关键字。外来关键字(Foreignkey):表格内匹配同一表格或者另一表格里备选关键字的一个列或者一组列。外来键允许你将一个表格里的记录和另一个表格里的数据相关联。有主外键关系,进行两个表或多个表的关联。

关于数据库考试试题及答案到此分享完毕,希望能帮助到您。

男ai是什么意思,男生发ai是什么意思男的发哎字什么意思数据匹配vlookup函数?比对公式vlookup使用