SQLServer数据库模拟试题2
SQL Server数据库模拟试题2 说明:本试题为笔试方式,考试时间100分钟,总计100分。 一、选择题(每题1分,共15分) 1. 在数据库中NULL表示_______ A. 0 B. 空格 C. 未知值 D. 其他 2. 批处理是一个SQL语句集合,以 _______为结束。 A. BEGIN B. “}” C. GO D. END 3. 在SQL Server中会滚事务的命令为 _______。 A. COMMIT B. ROLLBACK C. GOTO D. DECLEAR 4. 聚合函数中的_______,可以实现对一数值列执行累加并返回单一值。 A.SUM B.COUNT C.MAX D.SQRT 5. 在存有数据的表上建立非聚集索引,可以引起表中数据的_______发生变化。 A.表间关系 B.物理位置 C.逻辑顺序 D.列值 6. 下列函数中,返回值数据类型为int的是_______。 A.GETDATE B. COUNT C. LTRIM D. SUNSTRING 7. 命令CREATE DEFAULT的功能是_______________。 A. 清空表 B. 创建默认值 C. 创建触发起 D. 创建表 8. 为数据表创建索引的目的是_______。 A. 提高查询的检索性能 B. 归类 C. 创建主键 D. 准备创建视图 9. 表达式Datepart(yy,'2010-9-13')+7的结果是_______。 A. '2010-9-20' B.2010 C.'2017' D. '2011' 10. 在SQL Server 2005服务器上,存储过程是一组预先定义并_______的Transact-SQL语句集合。 A.保存 B.编译 C.解释 D.编写 11. 表是SQL Server数据库中用来_______各种数据内容的数据库对象。 A. 显示 B. 查询 C. 存放 D. 检索 12. 关于SQL Server 2005数据库事务日志文件叙述错误的是_______。 A. 一个数据库可以有多个事务日志文件 B. 创建数据库时,如果未指定事务日志文件,SQL Server则会自动创建一个 C. 事务日志文件的默认大小为5MB D. 如果未指定事务日志文件的增长量,则文件大小也会不断变化。 13. 下列关于执行SQL Server 2005查询叙述正确的是_______。 A. 如果没有选中的命令,则只执行最前面的第一条命令 B. 如果有多条命令选择,则只执行选中命令中的第一条命令 C. 如果查询中有多条命令有输出,则按顺序显示所有结果 D. 遇到GO命令就自动开始执行 14.表达式 DATENAME(Mm,'2011-11-11')的值是_______。 A. 11 B. 12 C. 星期五 D. '2011-11-11' 15. 对数据库表创建索引的缺点有_______ A. 提高检索速度 B. 降低了数据修改速度 C. 强制实施行的唯一性 D. 节省了存储空间 二、填空题(每空1分,共15分) 1. 服务器是用来_______、_______和停止SQL Server 服务的。 2. 以@@作为首部的变量在SQL Server系统中称为_______。 3.SELECT语句的完整语法较复杂,但至少包括的部分_______、_______;使用关键字_______可以把重复行屏蔽,将多个查询结果返回一个结果集合的运算符是_______。 4.声明游标的命令是_______,释放游标的命令是_______。 5.在SQL Server系统中,用户要访问默认工作数据库中的数据,必须在_______、_______、_______之后才能进行。 6.使用系统监视器可以通过创建_______、_______、_______和报表,以监视 SQL Server 实例的运行情况。 三、简答题(每题5分,共20分) 1. 如果给某用户授予更新表的权限,但该用户所属角色又拒绝了此权限,那么该用户账户是否保留更新表的权限,阐述原因? 2. 简述public角色的功能。 3. 用户数据库包括由气象卫星收集的图像数据,并且这些数据不断地进行更新。数据库大小为700GB,并且被划分到5个文件中保存。如果准备对其进行完全数据库备份,那么将耗时20个小时。请问:如何才能尽量缩短每天执行备份所需的时间,并且在系统出现故障的情况下,仍然能够保证较好的数据还原能力呢? 4.说明如何创建一个名为MyDevice的备份设备的步骤,如何将其映射成为磁盘文件“D:\DATA\MyDevice.BAK”。 四、综合题(每小题 5分,共50分) 1. 利用Transact-SQL语句完成操作。 (1)创建一个新的数据库名称为store,该数据库包含一个数据文件和一个日志文件。数据文件逻辑文件名为storeDB1_data,磁盘文件名为storeDB1_data.mdf,文件初始容量为5MB,最大容量为17MB,文件递增容量为1MB(数据库创建在D:\SERVER文件夹下),其他所有参数均取默认值。 (2)在store数据库中创建一个数据表orders,表结构如下表所示: orders 表结构 列名
数据类型及长度 是否为空 备注
订单编号 nchar (10) no 主键 客户编号 nchar (10) no
订购日期 datetime no 默认值为系统时间
(3)向表orders中添加一个“备注”字段,数据类型为nchar(40)。“备注”字段允许为NULL。并向表orders中添加一条记录。 (4)查看orders表上的所有约束。 (5)删除订购日期在2009年7月17日以前的记录。 (6)在store数据库中创建新表expro,并将其number字段设置为主键。 (7)创建一个AFTER触发器,要求实现以下功能:在expro表上创建一个插入、更新类型的触发器TR_expro,当在expro字段中插入或修改number后,触发该触发器,检查number值是否在0-1000之间。 2. 写出实现下列操作的步骤和命令: (1)在SQL Server Management Studio中添加登录名CLASS,密码为BESTtoYOU的SQL登录账户,并映射为数据库TEACHING的数据库用户HANS; (2)配置对数据库TEACHING具有创建表和创建视图的权限; (3)授予对数据表student进行查询、删除的权限,撤销对数据表course的插入、更新、删除权限。 SQL Server数据库模拟试题2参考答案 一、选择题(每题1分,共15分) 1~5. CCBAC 6~10. BBACA 11~15. CCCAB 二、填空题(每空1分,共14分) 1. 启动 暂停 2. 全部变量 3. SELECT FROM DISTINCT UNION 4.DECLARE..CURSOR DEALLOCATE 5.登录服务器 进行身份验证 获得权限 6.图表 警报 日志 三、简答题(每题5分,共20分) 1. 该用户不再保留更新表的权限。因为拒绝权限优先级高于其它权限,从而将使授予给他的权限失效。 2. public角色是一个特殊的数据库角色,SQL Serve中的每个数据库都拥有该角色。其主要功能包括:捕获数据库用户的所有默认权限,包含的所有系统数据库和用户数据库中,并且无法删除。 3. 用户可以选用一种以完全数据库备份开始的备份计划。由于完全数据库备份比较费时,所以极少进行这种备份,而是以轮流方式每天只备份数据库文件中的一个。为了尽量缩短还原时间,除了备份事务日志以外,用户还应当执行差异备份。 4.实现创建备份设备MyDevice,以及将其映射成为磁盘文件D:\DATA\MyDevice.BAK步骤如下: (1)在SQL Server Management Studio中展开服务器组,展开指定的服务器,展开“服务器对象”。 (2)右击服务器对象中的“备份设备”,在弹出的快捷菜单中选择“新建备份设备”选项,打开“备份设备”对话框。 (3)在“备份设备”对话框中,设备名称处输入MyDevice,并单击“文件”右部的按钮,打开“定位数据库文件”对话框,在对话框中选择D盘的DATA文件夹,并在窗口下部的“文件名”框中输入MyDevice.BAK,单击“确定”按钮。 (4)在“备份设备”对话框中单击“确定”按钮,就创建了备份设备MyDevice,在SQL Server Management Studio中可看到此备份设备名称。 四、综合题(每小题5分,共50分) 1.参考答案 (1)Create database store ON( NAME=storeDB1_data, FILENAME='D:\server\storeDB1_data.mdf', SIZE=5mb, MAXSIZE=17mb, FILEGROWTH=1mb ) (2)create table orders ( 订单编号 nchar(10) primary key, 客户编号 nchar(10), 订购日期 datetime default getdate() ) (3)alter table orders add 备注 nchar(40) INSERT INTO orders
SQLServer数据库试题及答案
SQLServer数据库试题及答案选择题:(20分)1、根据关系数据基于的数据模型——关系模型的特征判断下列正确的一项:(___)A、只存在一对多的实体关系,以图形方式来表示。
B、以二维表格结构来保存数据,在关系表中不允许有重复行存在。
C、能体现一对多、多对多的关系,但不能体现一对一的关系。
D、关系模型数据库是数据库发展的最初阶段。
2、在“连接”组中有两种连接认证方式,其中在(___)方式下,需要客户端应用程序连接时提供登录时需要的用户标识和密码。
A、Windows身份验证B、SQL Server 身份验证C、以超级用户身份登录时D、其他方式登录时3、SQL Server 2000 在安装之前,应注意的事项:(___)A、SQL Server 2000的任何版本在安装时都不用考虑操作系统的制约。
B、SQL Server 2000的安装对硬件的要求不作任何限制。
C、SQL Server 2000 在安装之前,必须在操作系统级启用TCP/IP。
D、在Windows NT Server 4.0上安装SQL Server 2000时,最低的要求是必须安装Service Pack 4(SP4)以上。
4、关系数据库中,主键是(1___),主键的建立有(2___)种方法,当运用Transact-SQL 语句创建主键时,可以是(3___)。
⑴ A、为标识表中唯一的实体B、创建唯一的索引,允许空值C、只允许以表中第一字段建立D、允许有多个主键的⑵ A、一 B、二 C、三 D、四⑶ A、create table table1(column1 char(13) not null primary,column2 int not) on primary;B、alter table table1 with notcheck addconstraint [PK_table1] primary key nonclustered( column1) on primary;C、alter table table1 column1 primary key ;5、表在数据库中是一个非常重要的数据对象,它是用来(1___)各种数据内容的,数据库创建后就可以创建表了,创建表可以用(2___)等方法来创建。
SQLServer数据库基础认证考试模拟题(总)
SQLServer数据库基础认证考试模拟题(总)1. ()可以同一个表的不同字段进行联接。
(选一项) * * [单选题] *A、内联接B、自联接(正确答案)C、外联接D、左联接2. 在SQL Server数据库中,UNIQUE约束与PRIMARY KEY约束之间最主要的区别是()(选一项) * * [单选题] *A、UNIQUE约束要求数据库中至少存在一行数据,因此必须在创建数据库表之后才能创建,而PRIMARY KEY约束无此限制B、UNIQUE约束允许有空值,而PRIMARY KEY约束不允许有空值C、创建UNIQUE约束后,该数据行允许被更改,而PRIMARY KEY约束的数据行不允许更改D、UNIQUE约束列不能创建外键,而PRIMARY KEY约束可以创建外键引用(正确答案)3. 查询student表中的所有非空email信息, 以下语句正确的是()(选一项) * * [单选题] *A、Select email from student where email !=nullB、Select email from student where email not is nullC、Select email from student where email <> nullD、Select email from student where email is not null(正确答案)4. SQL语句:select * from students where SNO like '010[^0]%[A,B,C]%',可能会查询出的SNO是( )(选两项) * * *A、01053090A(正确答案)B、01003090A01C、01053090D、0101A01(正确答案)5. 查找 student表中所有电话号码(列名:telephone)的第一位为8或6,第三位为0的电话号码()(‘[86]_0%’等同于'[8,6]_0%')(选一项) * * [单选题] *A、SELECT telephone FROM student WHERE telephone LIKE '[86]%0*'B、SELECT telephone FROM student WHERE telephone LIKE '(8,6)*0%'C、SELECT telephone FROM student WHERE telephone LIKE '[8,6]_0*'D、SELECT telephone FROM student WHERE telephone LIKE '[86]_0%'(正确答案)6. 查找authors表中的所有电话号码的首位为4,第二位为0或1的电话号码()(选一项) * * [单选题] *A、SELECT phone FROM authors WHERE phone LIKE '4[1,0]%'(正确答案)B、SELECT phone FROM authors WHERE phone in '4[^10]%'C、SELECT phone FROM authors WHERE phone LIKE '4_[1,0]%'D、SELECT phone FROM authors WHERE phone between '41%' and '40%'7. 查找 student表中所有电话号码(列名:telephone)的第一位为8或6,第三位为0的电话号码()(选一项) * * [单选题] *A、SELECT telephone FROM student WHERE telephone LIKE '[86]%0*'B、SELECT telephone FROM student WHERE telephone LIKE '(8,6)*0%'C、SELECT telephone FROM student WHERE telephone LIKE '[8,6]_0*'D、SELECT telephone FROM student WHERE telephone LIKE '[86]_0%'(正确答案)8. 成绩表grade中字段score代表分数,以下( )语句返回成绩表中的最低分。
SQLServer数据库考试试题与答案(doc8页)
SQLServer数据库考试试题与答案(doc8页)SQLServer数据库考试试题与答案(doc 8页)选择题:(20分)1、根据关系数据基于的数据模型——关系模型的特征判断下列正确的⼀项:(___)A、只存在⼀对多的实体关系,以图形⽅式来表⽰。
B、以⼆维表格结构来保存数据,在关系表中不允许有重复⾏存在。
C、能体现⼀对多、多对多的关系,但不能体现⼀对⼀的关系。
D、关系模型数据库是数据库发展的最初阶段。
2、在“连接”组中有两种连接认证⽅式,其中在(___)⽅式下,需要客户端应⽤程序连接时提供登录时需要的⽤户标识和密码。
A、Windows⾝份验证B、SQL Server ⾝份验证C、以超级⽤户⾝份登录时D、其他⽅式登录时3、SQL Server 2000 在安装之前,应注意的事项:(___)A、SQL Server 2000的任何版本在安装时都不⽤考虑操作系统的制约。
B、SQL Server 2000的安装对硬件的要求不作C、alter table table1 column1 primary key ;5、表在数据库中是⼀个⾮常重要的数据对象,它是⽤来(1___)各种数据内容的,数据库创建后就可以创建表了,创建表可以⽤(2___)等⽅法来创建。
⑴ A、显⽰ B、查询 C、存放 D、检索⑵ A、企业管理器 B、查询分析器C、OSQLD、企业管理器和CREATE TABLE语句6、为数据表创建索引的⽬的是(1___),可以在创建表时⽤(2___)来创建唯⼀索引,也可以⽤(2___)来创建唯⼀索引。
⑴ A、提⾼查询的检索性能 B、创建唯⼀索引C、创建主键D、归类⑵ A、设置主键约束,设置唯⼀约束B、Create table,Create indexC、设置主键约束,Create indexD、以上都可以7、在Transact-SQL语法中,⽤来插⼊数据的命令是(___),⽤于更新的命令是(___)。
A、INSERT,UPDATEB、UPDATE,INSERTC、DELETE,UPDATED、CREATE,INSERT INTO8、在Transact-SQL语法中,SELECT语句的完整语法较复杂,但⾄少包括的部分(1___),使⽤关键字(2___)可以把重复⾏屏蔽,将多个查询结果返回⼀个结果集合的运算符是(3___),如果在SELECT语句中使⽤集合函数时,⼀定在后⾯使⽤(4___)。
数据库sqlserver oracle试题
数据库sqlserver oracle试题数据库试题及答案1.什么是数据库?数据库是一个组织和存储数据的系统,它是由一系列数据组成的集合,这些数据以结构化的方式存储在计算机上,并可以通过访问和查询来进行管理。
2.SQL是什么?它有哪些常用命令?SQL(Structured Query Language)是一种用于管理和操作关系型数据库的编程语言。
主要的SQL命令包括:•SELECT:从数据库中查询数据•INSERT:插入新的数据记录•UPDATE:更新现有的数据记录•DELETE:删除数据记录•CREATE:创建数据库对象,如表、视图、索引等•ALTER:修改数据库对象的结构•DROP:删除数据库对象•GRANT:授予用户或角色权限•REVOKE:取消用户或角色的权限3.什么是关系型数据库?举例说明。
关系型数据库是以表的形式来组织数据的数据库,其中数据之间的关系通过键(键值对)来建立。
常见的关系型数据库有SQL Server、Oracle、MySQL等。
例如,一个关系型数据库可以包含多个表,如“学生”表和“课程”表,学生表中的学生ID和课程表中的课程ID可以建立联系,形成学生和课程的关系。
4.SQL Server与Oracle有何异同?SQL Server和Oracle都属于具有高性能和可靠性的关系型数据库管理系统。
它们的主要区别在于:•历史:SQL Server最初是由Sybase开发的一款关系型数据库管理系统,而Oracle则是由Oracle Corporation开发的。
•所属公司:SQL Server属于微软公司,而Oracle则是由OracleCorporation所拥有和维护。
•支持平台:SQL Server主要运行在Windows操作系统上,而Oracle可以运行在多个平台上,包括Windows、Linux、UNIX等。
•价格:SQL Server相对较为经济实惠,而Oracle则价格较高。
sql server 练习题
sql server 练习题SQL Server是一种关系型数据库管理系统,广泛用于存储和管理大量结构化数据。
为了帮助大家熟练掌握SQL Server的使用,以下是一些练习题,涵盖了SQL Server的常见操作和语法。
通过完成这些练习题,你可以增强对SQL Server的理解和应用能力。
第一题:创建数据库在SQL Server中,创建数据库使用CREATE DATABASE语句。
请根据以下要求创建一个名为"Company"的数据库:要求:1. 数据库的字符集为UTF-8;2. 数据库的校对规则选择Chinese_PRC_CI_AS。
解答:```CREATE DATABASE CompanyCOLLATE Chinese_PRC_CI_AS;```第二题:创建表格在创建数据库后,我们需要创建表格来存储具体的数据。
请根据以下要求创建一个名为"Employees"的表格:要求:1. 表格包含以下字段:EmployeeID(整数类型,主键),LastName (字符串类型),FirstName(字符串类型),Age(整数类型),Salary(浮点数类型);2. 字符串类型的字段长度分别为50个字符;3. 浮点数类型的字段保留两位小数。
解答:```CREATE TABLE Employees(EmployeeID INT PRIMARY KEY,LastName NVARCHAR(50),FirstName NVARCHAR(50),Age INT,Salary FLOAT(2));```第三题:插入数据在创建表格后,我们需要往表格中插入数据。
请根据以下要求向"Employees"表格中插入一条数据:要求:EmployeeID为101,LastName为"Smith",FirstName为"John",Age为30,Salary为5000.00。
微软认证模拟试题:SQLServer考题
微软认证模拟试题:SQLServer考题微软认证模拟试题:SQLServer考题微软认证模拟试题:SQLServer考题your company s s ql server 7 . 0 dat abase i s backed dail y at m i dn i ght. one morni ng you load a large amount of data by using a nonlogged transaction. you then disable the selectinto/bulkcopy ption. what is the easiest way to restore the validity of the transaction logbackup sequence?a. create a database backup.b. truncate the transaction log.c. backup the transaction log.d. create a differential database backup.answer: dyou want to improve the performance of a sql server 7.0 database by distributing input/output operations across multiple physical disks. you know which tables and indexesare queried most frequently, and you want to place each of them on a separate disk. how canyou place each of the most frequently queried tables and indexes on its own separate disk?answer: one each disk, create a filegroup consisting of a single file and place each table andindex in its ownfilegroup.you are planning to use sql server profiler to debug and optimize queries and applicationsin sql server 7.0. you want to be able to use sql server query-processing tools analyze thedata captured by profiler. where should you save the event data that will be captured by the profiler trace? a. ina text fileb. in a windows nt application logc. in the trace definition file.d. in a sql server tableanswer: dnotice: if you want to use sql server query processing tools to analyze the captured data, thenyou should save the event data to a table.you must perform multiple identical installations of sql server 7.0 in remote branches ofyour company that are not connected to the central office. the network administrators in thebranches have not been trained to install sql server 7.0. how can you facilitate theinstallations so that most of the work will be done automatically?answer: run sql server setup interactively to install sql server on a computer in the centraloffice. during installation, assign the mssqlserver and sqlserveragent services to the localsystem user account send the iss file to the branches.your company isusing sql server 7.0 store corporate business data on a windows nt server computer. to assess disk space requirements and to optimize disk space usage you want to know how often new data is record in database, what tool will provide you with information about the frequency of write operations:answer: windows nt performance monitoryou are the sql server 7.0 administrator for your company. you want to identify all errors in the sales database, but repair only the allocation errors, which two of the following statements should you issue to identify all errors and repair only all allocation errors?(choose two answers) answer: dbcccheckdb( sal es? dbcc checkalloc ?`sales repair_allow_data_loss ?/pyou provide technical support to companies that use sql server 7.0. a customer reportsthat there is a problem, and you are asked to investigate it. you want to capture a trace insql server profiler. what are the minimum permissions that you must have at thecustomer s s ql server co mput er t o be ab l e t o creat e and capt ure a profil er traceanswer: you must have the exec permission for the profiler extended stored procedures.you are running a web site, you want accountingwho is accessing specific tables. whichshould you use performance monitor to monitor? a. connect event, execution plan event, service control event, sql username, nt user name.b. attention event, exec prepared sql event, sql username, nt user namec. connect event, disconnect event, existingconnection event, nt user named. object: opened event, sql user name, nt user name.answer: dthe departmental server has full text search implemented on its sql server database. currently both the full text database and the database files reside on the same logical drive. you do not want the full text indexing to use more than 25% of the available drive space because you want to allow space for dynamic expansion of the data files. you want to be able to remotely monitor the amount of space in use by the catalogs. how should you remotely monitor the space usage with a minimum number of additional administrative steps?a. use the windows nt performance monitor to connect to the server and to monitor the size of the microsoft search catalogb. create a scheduled job to regularly monitor the size ofthe full text indexes and send the result to your e-mail addressc. create a batch file to monitor the size of full text indexes and send the result to you vianetwork message. use the windows nt scheduler service to schedule the batch file to runregularlyd. create a batch file to monitor the size of the full text indexes and send the result to you via network message. create a scheduled job to run the batch file regularly.answer: ayou are a sql server 7.0 system administrator for you company. to provide users with full text search capabilities, you create a full text catalog and enable full text indexing for specific tables in a database. from your windows nt workstation computer, you want to remotely monitor the size of the full text catalog on windows nt server computer that is running sql server. which of the following tools is the most convenient to use for monitor the full text catalog? a. performance monitorb. query analyzerc. the sp_monitor system stored procedured. sql server profiler.answer: anotice: to obtain real-time information about the size of a specific full-text catalog, you can continuously monitor the appropriate instance of the microsoft search indexer catalogs you load a lot data into your database, then you find that the space for log is almost full, how can you do to ensure the restore: (choose all that apply) a. make a full backupb. make a differential backupc. backup the transaction log with the default optionsd. backup the transaction log with truncate onlyanswer: a, dthe engine manufacturing application records data about all the engines that are manufactured at your plant, the database contains approximately 500 million records and is approximately 50gb in size. the database increases by 1000 records per day. you want to accomplish the following goals: 1. minimize the time required to recover the database2. provide the ability to recover the database to a specific time3. minimize the number of transaction logs that need to be during recovery4. minimize the time required to backup the databaseyou take the following actions:1. schedule a full database backup of the entire database to occur every sunday at am 1:00 2. schedule transaction log backup to occur every day at p.m which result or results do these action produce? ( choose all that apply ) a. the time required to recover the database is minimizedb. the database can be recovered to a specific time.c. the number of transaction logs that need to be applied during recovery is minimizedd. the time required to backup the database is minimizedanswer: b, dyou check the free space on a log file and run a backup log with no_log on a database that is a publisher for transactional replication. you check the free space after running this command and note that free space has not changed. what is the most likely reason that free space has not changed? a. the distributor database is fullb. log reader agent has stoppedanswer: byou have 2 tables, t1 t2, gi should be able to update t1, g2 should be only able to select from t1 and third group g3 able to select and update on t2. the question is howmanyapplication roles do you need? answer: 3sales representatives use portable computers. they need to implement replication scenario so that the sales representatives can enter the orders. you want to minimize network traffic: a. transactionalb. snapshot with pullc. snapshot with pushd. mergeanswer: b微软认证模拟试题:SQLServer考题相关内容:。
SQLServer数据库的练习题和答案6共6份
一、上机题一、上机题1. 在Student 数据库的以下表中数据库的以下表中 学生表(Student)基本数据表的字段 字段名字段名 类型类型 长度长度 StudentID Int (Identity) StudentCode Char 8 StudentName V archar 20 Sex Bit Phone V archar 20 Address V archar 100 Parent V archar 20 Birthdate Smalldatetime Remark V archar 500 Photo Image RegisterDateDatetime成绩表(Score)基本数据的字段字段名字段名类型类型长度长度 小数位小数位 ScoreID Int(Identity) StudentCodeChar 8 ExamType Char 1 Chinese Decimal 5 1 Math Decimal 5 1 English Decimal 5 1 Physics Decimal5 1 ChemistDecimal51(1) 在Student 表的StudentCode 字段创建聚集索引Index_StudentCode ,并且该索引为唯一索引,然后向Student 表中插入一条与表中记录的StudentCode 字段相同的记录,检查能否插入成功。
录,检查能否插入成功。
Create union index index_studentcode on student (studenrcode) (2) 在Student 表的StudentName 字段创建非聚集索引。
字段创建非聚集索引。
Create nonclustered index index_studentcode on student(studentname) (3) 在Score 表的StudentCode 字段创建聚集索引。
SQLServer数据库考试试题与答案
选择题:(20分)1、根据关系数据基于的数据模型——关系模型的特征判断下列正确的一项:(___)A、只存在一对多的实体关系,以图形方式来表示。
B、以二维表格结构来保存数据,在关系表中不允许有重复行存在。
C、能体现一对多、多对多的关系,但不能体现一对一的关系。
D、关系模型数据库是数据库发展的最初阶段。
2、在“连接”组中有两种连接认证方式,其中在(___)方式下,需要客户端应用程序连接时提供登录时需要的用户标识和密码。
A、Windows身份验证B、SQL Server 身份验证C、以超级用户身份登录时D、其他方式登录时3、SQL Server 2000 在安装之前,应注意的事项:(___)A、SQL Server 2000的任何版本在安装时都不用考虑操作系统的制约。
B、SQL Server 2000的安装对硬件的要求不作任何限制。
C、SQL Server 2000 在安装之前,必须在操作系统级启用TCP/IP。
D、在Windows NT Server 4.0上安装SQL Server 2000时,最低的要求是必须安装Service Pack 4(SP4)以上。
4、关系数据库中,主键是(1___),主键的建立有(2___)种方法,当运用Transact-SQL 语句创建主键时,可以是(3___)。
⑴ A、为标识表中唯一的实体B、创建唯一的索引,允许空值C、只允许以表中第一字段建立D、允许有多个主键的⑵ A、一 B、二 C、三 D、四⑶ A、create table table1(column1 char(13) not null primary,column2 int not) on primary;B、alter table table1 with notcheck addconstraint [PK_table1] primary key nonclustered( column1) on primary;C、alter table table1 column1 primary key ;5、表在数据库中是一个非常重要的数据对象,它是用来(1___)各种数据内容的,数据库创建后就可以创建表了,创建表可以用(2___)等方法来创建。
SQLServer数据库基础认证考试模拟题(总)
SQLServer数据库基础认证考试模拟题(总)SQLServer数据库基础认证考试模拟题(总)1. ()可以同一个表的不同字段进行联接。
(选一项) * * [单选题] *A、内联接B、自联接(正确答案)C、外联接D、左联接2. 在SQL Server数据库中,UNIQUE约束与PRIMARY KEY约束之间最主要的区别是()(选一项) * * [单选题] *A、UNIQUE约束要求数据库中至少存在一行数据,因此必须在创建数据库表之后才能创建,而PRIMARY KEY约束无此限制B、UNIQUE约束允许有空值,而PRIMARY KEY约束不允许有空值C、创建UNIQUE约束后,该数据行允许被更改,而PRIMARY KEY 约束的数据行不允许更改D、UNIQUE约束列不能创建外键,而PRIMARY KEY约束可以创建外键引用(正确答案)3. 查询student表中的所有非空email信息, 以下语句正确的是()(选一项) * * [单选题] *A、Select email from student where email !=nullB、Select email from student where email not is nullC、Select email from student where email <> nullD、Select email from student where email is not null(正确答案)4. SQL语句:select * from students where SNO like '010[^0]%[A,B,C]%',可能会查询出的SNO是( )(选两项) * * *A、01053090A(正确答案)B、01003090A01C、01053090D、0101A01(正确答案)5. 查找 student表中所有电话号码(列名:telephone)的第一位为8或6,第三位为0的电话号码()(‘[86]_0%’等同于'[8,6]_0%')(选一项) * * [单选题] *A、SELECT telephone FROM student WHERE telephone LIKE '[86]%0*'B、SELECT telephone FROM student WHERE telephone LIKE '(8,6)*0%'C、SELECT telephone FROM student WHERE telephone LIKE '[8,6]_0*'D、SELECT telephone FROM student WHERE telephone LIKE '[86]_0%'(正确答案)6. 查找authors表中的所有电话号码的首位为4,第二位为0或1的电话号码()(选一项) * * [单选题] *A、SELECT phone FROM authors WHERE phone LIKE '4[1,0]%'(正确答案)B、SELECT phone FROM authors WHERE phone in '4[^10]%'C、SELECT phone FROM authors WHERE phone LIKE '4_[1,0]%'D、SELECT phone FROM authors WHERE phone between '41%' and '40%'7. 查找 student表中所有电话号码(列名:telephone)的第一位为8或6,第三位为0的电话号码()(选一项) * * [单选题] *A、SELECT telephone FROM student WHERE telephone LIKE '[86]%0*'B、SELECT telephone FROM student WHERE telephone LIKE '(8,6)*0%'C、SELECT telephone FROM student WHERE telephone LIKE '[8,6]_0*'D、SELECT telephone FROM student WHERE telephone LIKE '[86]_0%'(正确答案)8. 成绩表grade中字段score代表分数,以下( )语句返回成绩表中的最低分。
(没有答案)《SQLServer2000》网络课程同步练习与模拟试题
同步练习题第1章数据库基础知识一、单项选择题1. 通常所说的数据库系统(DBS)、数据库管理系统(DBMS)、和数据库(DB)三者之间的关系是A. DBMS包含DB和DBSB. DB包含DBS和DBMSC. DBS包含DB和DBMSD.三者无关2.数据是信息的载体,信息是数据的A. 符号化表示B. 载体C. 内涵D. 抽象3. 下列说法不正确的是A. 数据库避免了一切数据重复B. 数据库减少了数据冗余C. 数据库数据可为经DBA认可的用户共享D. 控制冗余可确保数据的一致性4.在数据库中,产生数据不一致的根本原因是A. 没有严格保护数据B. 数据存储量太大C. 数据间联系弱D. 数据冗余5.数据库管理系统能实现对数据库中数据的查询、插入、修改和删除,这类功能称为A. 数据定义功能B. 数据管理功能C. 数据操纵功能D. 数据控制功能6.E-R模型是数据库设计的工具之一,它一般适用于建立数据库的A. 概念模型B. 结构模型C. 物理模型D. 逻辑模型7. 当实体中有多个属性可作为键而选定其中一个时,称为该实体的A. 外部键B. 候选键C. 主键D. 主属性8. 如某属性虽非该实体主键,却是另一实体的主键,称此属性为A. 外部键B. 候选键C. 主键D. 主属性9.自然连接是构成新关系的有效方法。
一般情况下,当对关系R和S使用自然联接时,要求R和S含有一个或多个共有的A. 元组B.行C. 记录D.属性10.关系模型中的关系模式至少是A.1NF B.2NFC.3NF D.BCNF11.候选关键字中的属性称为A.非主属性B.主属性C.复合属性D.关键属性12.关系模式中各级模式之间的关系为A.3NF⊂2NF⊂lNF B.3NF⊂lNF⊂2NFC.1NF⊂2NF⊂3NF D.2NF⊂lNF⊂3NF13. 数据库物理设计完成后,进入数据库实施阶段,下列各项中不属于实施阶段的工作的是A. 建立库结构B.扩充功能C. 加载数据D. 系统调试14.从E-R模型向关系模型转换,一个M:N的联系转换成关系模式时,该关系模式的键是A. M端实体的键B. N端实体的键C. M端实体键与N端实体键组合D. 重新选取其他属性15.数据库逻辑设计的主要任务是A. 建立E-R图和说明书B.创建数据库模式C. 建立数据流图D. 把数据送入数据库二、填空题1.要满足基本应用,一个数据库系统通常应提供给用户使用的基本语言有和。
