当前位置:网站首页>[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter 7 exercises]
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter 7 exercises]
2022-07-03 13:04:00 【Laughing cold faced ghost】
List of articles
One 、 choice question
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|
B | C | B | D | A |
1. stay SQL Server What is not an object in is ( ).
A) user
B) data
C) surface
D) data type
2. Variable declared :DECLARE @i int,@c char(4), For now @i assignment 10, by @c assignment ’abcd’, Correct language
The sentence is ( ).
A)SET @i=10, @c=‘abcd’
B)SET @i=10, SET @c=‘abcd’
C)SELECT @i=10, @c=‘abcd’
D)SELECT @i=10, SELECT @c=‘abcd’
3. stay SQL Server Server , A stored procedure is a set of predefined and ( ) Of Transact-SQL sentence .
A) preservation
B) compile
C) explain
D) To write
4. It can be used ( ) To declare a cursor .
A)CREATE CURSOR
B)ALTER CURSOR
C)SET CURSOR
D)DECLARE CURSOR
5. When the 【】 The positions are BREAK,CONTINUE or RETURN when , The output value is ( ).
DECLARE @n int
SET @n=3
WHILE @n>0
BEGIN
SET @n=@n-1
IF @n=1 []
END
PRINT @n
A)1,0, No output
B)1,1,_
C)0,0,0
D)0,1,2
Two 、 Completion
1.Transact-SQL Can be used in local variable and Global variables Two variables .
2. stay Transact-SQL Two types of annotators can be used in : Single-line comments - - And multiline comments /… …/.
3. The command used to declare one or more local variables is DECLARE.
4. Whether stored procedures or triggers , All are SQL Statement and Process control Collection of statements .
5.SQL Server 2012 Support DML trigger 、DDL trigger and Login trigger There are three types of triggers .( For reference only )
6. Each trigger has Insert table and Delete table Two special tables are in the database .
7. stay SQL Server 2012 There is Database backup 、 Transaction log backup 、 Differential backup and File and filegroup backup Four types of backup .
8. stay SQL Server 2012 There is Simple reduction 、 complete reduction and Batch log restore Three database restore modes .
9. The backup device can be Hard disk 、 Magnetic tape or The Conduit .
3、 ... and 、 Short answer
1. What is trigger ? What are the functions of triggers ?
Trigger is a special stored procedure , It contains a series of T-SQL sentence , But its execution is not with EXECUTE The command explicitly calls , It is automatically activated and executed when certain conditions are met , Such as inserting records into the table ﹑ It is automatically activated and executed by the system when updating records or deleting records .
Using triggers has the following advantages :
(1) Triggers are automatically activated and executed when an event occurs . Such as , After an object is defined in the database , Or it will be activated and automatically executed immediately after making some modifications to the data in the table .
(2) Triggers can achieve more complex integrity requirements than constraints , such as CHECK Columns in other tables cannot be referenced in constraints , Triggers can reference ;CHECK Constraints are just conditional expressions connected by logical symbols , Unable to complete complex logical judgment function .
(3) The trigger can modify the status before and after according to the table data , Take corresponding measures according to their differences .
(4) Triggers can prevent malicious or erroneous INSERT、UPDATE and DELETE operation .
2. Brief description SQL Server 2012 Data backup in 4 Types .
(1) Full database backup
Full database backup (Database Backup) It refers to backing up all objects in the database , Including transaction logs .
This backup type requires relatively large storage space to store backup files , The backup time is also long , When restoring data , Just restore a backup file .(2) Differential backup
Database differential backup (Differential Database Backup) It's a complement to a full backup , Only back up the database since the last time
After a full backup ( Be careful : Not after the last differential backup ) Part of the database changes . Compared with full backup , The data volume of differential backup is smaller than that of full backup , Backups are also faster than full backups . therefore , Differential backup is usually used as a common backup method .(3) Transaction log backup .
Transaction log backup (Transaction Log Backup) Only the transaction log contents of the database are backed up . Transaction log backup takes transaction log files as backup objects , It is equivalent to recording every operation in the database .
The transaction log records the database changes in a certain period of time , So before doing a transaction log backup , Must enter
Row full backup . Similar to differential backup , Transaction log backups produce smaller files 、 Short occupation time , But when restoring data ,(4) File and filegroup backup
File and filegroup backup is to backup a single database file or filegroup , Its advantage is convenience and flexibility ,
And when restoring, you can restore only the damaged database files .
3.SQL Server What methods are provided to reduce the execution time of backup or restore operations .
- (1) Use multiple backup devices to perform backup processing at the same time . Empathy , You can restore databases from multiple backup devices at the same time .
- (2) Comprehensive use of database full backup 、 Differential backup or transaction log backup to reduce the amount of data that needs to be backed up each time .
- (3) Use file or filegroup backups and transaction log backups , In this way, only those files containing relevant data can be backed up or restored , Not the entire database .
PS: For reference only , Because of limited personal ability , If there is a mistake , Please grant me your advice ~
Reference
边栏推荐
- Using swift language features, write a pseudo-random number generator casually
- SSH登录服务器发送提醒
- 关于CPU缓冲行的理解
- Seven second order ladrc-pll structure design of active disturbance rejection controller
- 【習題七】【數據庫原理】
- C graphical tutorial (Fourth Edition)_ Chapter 20 asynchronous programming: examples - cases without asynchronous
- 【数据库原理及应用教程(第4版|微课版)陈志泊】【第五章习题】
- 2022-01-27 redis cluster cluster proxy predixy analysis
- [exercise 5] [Database Principle]
- Idea full text search shortcut ctr+shift+f failure problem
猜你喜欢
How to get user location in wechat applet?
Quick learning 1.8 front and rear interfaces
[comprehensive question] [Database Principle]
Brief introduction to mvcc
并网-低电压穿越与孤岛并存分析
Huffman coding experiment report
【数据库原理及应用教程(第4版|微课版)陈志泊】【第四章习题】
Node.js: express + MySQL的使用
[network counting] Chapter 3 data link layer (2) flow control and reliable transmission, stop waiting protocol, backward n frame protocol (GBN), selective retransmission protocol (SR)
ncnn神经网络计算框架在香橙派OrangePi 3 LTS开发板中的使用介绍
随机推荐
Grid connection - Analysis of low voltage ride through and island coexistence
Dix règles de travail
C graphical tutorial (Fourth Edition)_ Chapter 18 enumerator and iterator: enumerator samplep340
2022-01-27 redis cluster cluster proxy predixy analysis
Drop down refresh conflicts with recyclerview sliding (swiperefreshlayout conflicts with recyclerview sliding)
Sitescms v3.0.2 release, upgrade jfinal and other dependencies
Xctf mobile--rememberother problem solving
剑指 Offer 14- I. 剪绳子
Luogup3694 Bangbang chorus standing in line
Xctf mobile--app1 problem solving
【计网】第三章 数据链路层(2)流量控制与可靠传输、停止等待协议、后退N帧协议(GBN)、选择重传协议(SR)
电压环对 PFC 系统性能影响分析
C graphical tutorial (Fourth Edition)_ Chapter 20 asynchronous programming: examples - cases without asynchronous
Huffman coding experiment report
SSH登录服务器发送提醒
[network counting] Chapter 3 data link layer (2) flow control and reliable transmission, stop waiting protocol, backward n frame protocol (GBN), selective retransmission protocol (SR)
剑指 Offer 17. 打印从1到最大的n位数
Quick learning 1.8 front and rear interfaces
[review questions of database principles]
【数据库原理及应用教程(第4版|微课版)陈志泊】【第三章习题】