- 相關(guān)推薦
NIITsql選擇題考試題庫(kù)
NIIT的工作領(lǐng)域包括系統(tǒng)合成,商業(yè)對(duì)策,工程,制造,財(cái)務(wù),網(wǎng)絡(luò)工程,通訊,信息技術(shù)咨詢(xún),應(yīng)用軟件開(kāi)發(fā),多媒體軟件及職業(yè)信息技術(shù)培訓(xùn)和企業(yè)信息技術(shù)培訓(xùn)。以下是關(guān)于NIITsql選擇題考試題庫(kù),希望大家認(rèn)真閱讀!
選擇題:(每空2分共20分)
1、在MS SQL Server中,用來(lái)顯示數(shù)據(jù)庫(kù)信息的系統(tǒng)存儲(chǔ)過(guò)程是( )
A sp_ dbhelp
B sp_ db
C sp_ help
D sp_ helpdb
2、SQL語(yǔ)言中,刪除一個(gè)表的命令是( )
A DELETE
B DROP
C CLEAR
D REMORE
3、關(guān)系數(shù)據(jù)庫(kù)中,主鍵是(__)
A、為標(biāo)識(shí)表中唯一的實(shí)體
B、創(chuàng)建唯一的索引,允許空值
C、只允許以表中第一字段建立
D、允許有多個(gè)主鍵的
4、在Transact-SQL語(yǔ)法中,SELECT語(yǔ)句的完整語(yǔ)法較復(fù)雜,但至少包括的部分(1___),使用關(guān)鍵字(2___)可以把重復(fù)行屏蔽,將多個(gè)查詢(xún)結(jié)果返回一個(gè)結(jié)果集合的運(yùn)算符是(3___),如果在SELECT語(yǔ)句中使用聚合函數(shù)時(shí),一定在后面使用(4___)。
、 A、SELECT,INTO B、SELECT,F(xiàn)ROM
C、SELECT,GROUP D、僅SELECT
⑵ A、DISTINCT B、UNION
C、ALL C、TOP
、 A、JOIN B、UNION
C、INTO C、LIKE
、 A、GROUP BY B、COMPUTE BY
C、HAVING D、COMPUTE
5、語(yǔ)句DBCC SHRINKDATABASE (Sample, 25)中的25表示的意思是
A、25M
B、剩余占整個(gè)空間的25%
C、已用空間占整個(gè)空間的25%
D、以上都不對(duì)
6、你是一個(gè)保險(xiǎn)公司的數(shù)據(jù)庫(kù)開(kāi)發(fā)人員,公司的保單信息存儲(chǔ)在SQL Server 2000數(shù)據(jù)庫(kù)中,你使用以下腳本建立了一個(gè)名為Policy的表:
CREATE TABLE Policy
(
PolicyNumber int NOT NULL DEFAULT (0),
InsuredLastName char (30) NOT NULL,
InsuredFirstName char (20) NOT NULL,
InsuredBirthDate datetime NOT NULL,
PolicyDate datetime NOT NULL,
FaceAmount money NOT NULL,
CONSTRAINT PK_Policy PRIMARY KEY (PolicyNumber)
)
每次公司銷(xiāo)售出一份保單,Policy表中就增加一條記錄,并賦予其一個(gè)新的保單號(hào),你將怎么做?
a.建立一個(gè)INSTEAD OF INSERT觸發(fā)器來(lái)產(chǎn)生一個(gè)新的保單號(hào),并將這個(gè)保單號(hào)插入數(shù)據(jù)表中。
b.建立一個(gè)INSTEAD OF UPDATE觸發(fā)器來(lái)產(chǎn)生一個(gè)新的保單號(hào),并將這個(gè)保單號(hào)插入數(shù)據(jù)表中。
c.建立一個(gè)AFTER UPDATE觸發(fā)器來(lái)產(chǎn)生一個(gè)新的保單號(hào),并將這個(gè)保單號(hào)插入數(shù)據(jù)表中。
d.用AFTER UPDATE觸發(fā)器替代DEFAULT約束條件產(chǎn)生一個(gè)新的保單號(hào),并將這個(gè)保單號(hào)插入數(shù)據(jù)表中。
7、在SQL語(yǔ)言中,如果要建立一個(gè)工資表包含職工號(hào),姓名,職稱(chēng)。工資等字段。若要保證工資字段的取值不低于800元,最合適的實(shí)現(xiàn)方法是:
A。在創(chuàng)建工資表時(shí)為”工資“字段建立缺省
B。在創(chuàng)建工資表時(shí)為”工資“字段建立檢查約束
C。在工資表建立一個(gè)觸發(fā)器
D。為工資表數(shù)據(jù)輸入編寫(xiě)一個(gè)程序進(jìn)行控制
8、Select 語(yǔ)句中用來(lái)連接字符串的符號(hào)是______.
A. “+” B. “&” C.“||” D.“|”
9、你是一個(gè)出版公司的數(shù)據(jù)庫(kù)開(kāi)發(fā)人員,對(duì)特定的書(shū)名的每天的銷(xiāo)售情況建立了如下的存儲(chǔ)過(guò)程:
CREATE PROCEDURE get_sales_for_title
title varchar(80), @ytd_sales int OUTPUT
AS
SELECT @ytd_sales = ytd_sales
FROM titles
WHERE title = @title
IF @@ROWCOUNT = 0
RETURN(-1)
ELSE
RETURN(0)
另外建立了一個(gè)腳本執(zhí)行這個(gè)存儲(chǔ)過(guò)程,如果執(zhí)行成功,將返回對(duì)應(yīng)于書(shū)名的每天的銷(xiāo)售情況的報(bào)表,如果執(zhí)行失敗,將返回“No Sales Found”,怎樣建立這個(gè)腳本?
A. DECLARE @retval int
DECLARE @ytd int
EXEC get_sales_for_title ‘Net Etiquette’, @ytd
IF @retval < 0
PRINT ‘No sales found’
ELSE
PRINT ‘Year to date sales: ’ + STR (@ytd)
GO
B. DECLARE @retval int
DECLARE @ytd int
EXEC get_sales_for_title ‘Net Etiquette’, @ytd OUTPUT
IF @retval < 0
PRINT ‘No sales found’
ELSE
PRINT ‘Year to date sales: ’ + STR (@ytd)
GO
C. DECLARE @retval int
DECLARE @ytd int
EXEC get_sales_for_title ‘Net Etiquette’,@retval OUTPUT
IF @retval < 0
PRINT ‘No sales found’
ELSE
PRINT ‘Year to date sales: ’ + STR (@ytd)
GO
D. DECLARE @retval int
DECLARE @ytd int
EXEC @retval = get_sales_for_title ‘Net Etiquette’, @ytd OUTPUT
IF @retval < 0
PRINT ‘No sales found’
ELSE
PRINT ‘Year to date sales: ’ + STR (@ytd)
GO
10、You are a database developer for a container manufacturing company. The containers produced by your company are a number of different sizes and shapes. The tables that store the container information are shown in the Size, Container, and Shape Tables exhibit:
Size
SizeID
SizeName
Height
Container
ContainerID
ShapeID
SizeID
Shape
ShapeID
ShapeName
Measurements
A sample of the data stored in the tables is shown below:
Size Table
SizeID SizeName Height
1 Small 40
2 Medium 60
3 Large 80
4 Jumbo 100
Shape Table
ShapeID ShapeName Measurement
1 Triangle 10
2 Triangle 20
3 Triangle 30
4 Square 20
5 Square 30
6 Square 40
7 Circle 15
8 Circle 25
9 Circle 35
Periodically, the dimensions of the containers change. Frequently, the database users require the volume of a container. The volume of a container is calculated based on information in the shape and size tables.
You need to hide the details of the calculation so that the volume can be easily accessed in a SELECT query with the rest of the container information. What should you do?
A. Create a user-defined function that requires ContainerID as an argument and returns the volume of the container.
B. Create a stored procedure that requires ContainerID as an argument and returns the volume of the container.
C. Add a column named volume to the container table. Create a trigger that calculates and stores volume in this column when a new container is inserted into the table.
D. Add a computed column to the container table that calculates the volume of the container.
【NIITsql選擇題考試題庫(kù)】相關(guān)文章:
2017年計(jì)算機(jī)二級(jí)考試題庫(kù)「選擇題」08-29
最新電工考試題庫(kù)02-03
cad中級(jí)考試題庫(kù)附答案04-27
最新資料員考試題庫(kù)及答案08-30
電子商務(wù)師考試題庫(kù)10-12
2023執(zhí)業(yè)中藥師考試題庫(kù)及答案02-06
計(jì)算機(jī)基礎(chǔ)考試題庫(kù)及答案03-11
2017普通話(huà)考試測(cè)試題庫(kù)09-09
托?谡Z(yǔ)題庫(kù)08-26