当前位置:网站首页>Summary of knowledge points of computer level III (database) test preparation topics

Summary of knowledge points of computer level III (database) test preparation topics

2022-06-25 02:28:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm your friend, Quan Jun .

Computer level three ( data library ) Summary of knowledge points of test preparation topics

Summary of knowledge points encountered in question brushing

The following are the common knowledge points I encountered when I was brushing questions , For reference when reviewing .

1.DBAS An important task in the requirements analysis phase is to analyze DBAS Should have the performance index , It mainly includes :① Data operation response time , Or data access response time ;② System throughput , It refers to the number of database transactions or queries that the system can complete in a unit time ;③ Maximum number of users allowed concurrent access ;④ Every time TPS(Price per TPS) On behalf of value .

2. The key values of a clustered index can be repeated .

3. The index is suitable for use :

① On columns that often need to be searched , Can speed up the search ;
② On columns that often use joins ( These columns are mainly some foreign keys ) Can speed up the connection , Create indexes on columns that often need to be searched by range , Because the index is sorted , Its specified range is continuous ;
③ Make the disc frequently 【 use WHERE Create an index on the column in clause , Speed up the judgment of conditions .

Conditions unsuitable for use :

① Indexes should not be created for columns that are rarely used or referenced in queries ;
② Indexes should not be created for columns with few data values ;
③ Columns that are frequently updated are not suitable for creating indexes .

4.SQL Server 2008 in GRANT The usage of is ( First on after to):

GRANT { ALL [ PRIVILEGES ] }
 | permission [ ( column [ ,...n ] ) ] [ ,...n ]
[ ON [ class :: ] securable ] TO principal [ ,...n ] 
[ WITH GRANT OPTION ] [ AS principal ]

5. The physical design of the database does not include the specific implementation details of the file and database ( For example, how to create a file 、 Build a database and how to load data ).

6. One database only corresponds to one internal schema . The system structure of three-level schema and two-layer image of multiple external schema database systems can be defined in a database, which ensures that the database system can have high logical independence and physical independence .

7. The general data distribution strategy of distributed database can be considered from two aspects of data fragmentation and data distribution , Generally, the data is partitioned first , Redistribute data . Sharding is the operation of relationships , And allocation is the operation of partition results . Sharding mode is an image that describes each data fragment and its global relationship to the fragment , The allocation mode is to describe the image of each fragment to the physical storage site .

8.SQL Server 2008 There are three data recovery modes for :

① Simple recovery mode , This method can minimize the management overhead of transaction log , Because the recovery mode does not back up the transaction log . But if the database is corrupted , The simple recovery model will face a great risk of data loss . In this recovery mode , Data can only be restored to the latest backup state . So for the user database , The simple recovery model is only applicable to testing and developing databases , Or for databases that mainly contain read-only data .
② Full recovery mode , This method can completely record all transactions , And keep the transaction log records until the backup is completed . This method is relatively simple to restore , More time consuming .
③ Large capacity log recovery mode , This method only records the minimum amount of bulk operations , So that the transaction log will not be filled by the bulk load operation .
 During data import , All business is suspended , Therefore, the simple recovery mode can be adopted to improve the data import speed . And only temporarily modify the recovery mode during the data import process , So the data is not lost .

9. Materialized views are the results of time-consuming operations such as table joins or aggregations that are pre calculated and saved , such , It greatly improves the reading speed when executing queries .

10. The first category ODS The data update frequency is in seconds , The second category ODS The data update frequency of is hourly , The third category ODS The data update frequency of is days , The above three categories are divided according to the speed of data update ,ODSⅣ: Fourth category ODS It is divided according to the direction and type of data source .

11. Transaction isolation protects data integrity .Ⅲ Chinese digital signature is used for data tamper proof , Defining the master code is used for entity integrity .

12. An aggregate file is a file with multiple record types , It stores data from multiple relational tables , Each relationship table corresponds to a record type in the file . The aggregate file stores the associated records in different relational tables in the same disk block , Thus, the disk access times of database multi table query operation are reduced , Improve the system I/O Speed and lookup processing speed .

13. The responsibilities of the database administrator are :

① Database dump and recovery ;
② Database security 、 Integrity control ;
③ Detection and improvement of database performance ;
④ The reorganization and reconstruction of database .

14. Each cursor has a pointer to the current row , When the cursor is open , The current row pointer automatically points to the first row of data in the result set ,INSENSITIVE Keyword to create a temporary copy of the data used by the cursor . All requests for cursors are made from tempdb Get a response from this temporary table in . therefore , When extracting the cursor , The returned data does not reflect the changes made to the base table , And the cursor is not allowed to be modified . Use SQL-92 Grammatical time , If omitted INSENSITIVE, Any user's deletion and update to the base table will be reflected in the subsequent extraction .

"@@FETCH_STATUS= 0" when , It means FETCH Statement success ;
"@@FETCH_STATUS=-1" when ,FETCH  Statement failed or row is not in result set ;
"@@FETCH_STATUS=-2" when , The extracted line does not exist ;

After closing the cursor , Can pass OPEN Statement to open the cursor again .

15. Advantages and disadvantages of file structure :

 Heap file : It's troublesome to find , But it's easy to insert , Suitable for batch loading data .
 Sequence file : It is very convenient to find the primary key . Sequential files are especially suitable for tape storage , It also applies to disk storage . Random access to sequential files ( That is, access a record according to the randomly given key ) Efficiency is very low . The disadvantage is that files cannot grow dynamically , Not conducive to file insertion and deletion .
 Hash file : With random storage 、 Records do not need to be sorted 、 Easy to insert and delete 、 Fast access 、 No index area is required and storage space is saved .
 Aggregate file : Applicable to range filtering , Order by yourself . Records with associated relationships in different relationship tables are stored together . If some important and frequent user queries often require multi table join operations , Consider aggregating files , To improve query efficiency 

16.T-SQL Language summary : Create database :

CREATE DATABASE Students
 ON PRIMARY                         Primary filegroup file 1
      (
      		NAME = Student_data1,
      		FILENAME ='F:\DATA\MDF',
      		SIZE = 5MB,
      		MAXSIZE = UNLIMITED,
      		FILEGROWTH = 1MB
      )
      (								  Primary filegroup file 2
      		NAME = Student_data1,
      		FILENAME ='F:\DATA\NDF',
      		SIZE = 5MB,
      		MAXSIZE = UNLIMITED,
      		FILEGROWTH = 1MB
      )
      LOG OPTION                         Log files 1
      (
      		NAME = Student_data1,
      		FILENAME ='F:\DATA\ldf',
      		SIZE = 5MB,
      		MAXSIZE = UNLIMITED,
      		FILEGROWTH = 1MB
      )
      (								 Log files 2
      		NAME = Student_data1,
      		FILENAME ='F:\DATA\ldf',
      		SIZE = 5MB,
      		MAXSIZE = UNLIMITED,
      		FILEGROWTH = 1MB
      )

modify the database :

ALTER DATABASE RShDb
	ADD FILE(

	)

	ALTER DATABASE RShDb
	MODIFY FILE(
		
	)

	ALTER DATABASE RShDb
	ADD LOG FILE(
		
	)

Shrink database space :

DBCC SHRINKDATABASE(Students,20)

Shrink file space :

DBCC SHRINKFILE(Students,4)

Delete database file :

ALTER DATABASE student REMOVE FILE Student_data1

Detach and attach databases :

 Separate :EXEC sp_detach_db 'Students','true'
 additional :CREATE DATABSE Students ON(FILENAME='F:\DATA\.MDF') FOR ATTACH

Database architecture :

CREATE SCHEMA TEST AUTHORIZATION ZHANG
	CREATE TABLE T1(
							C1 INT
							C2  CHAR(10))
							
DROP SCHEMA  TEST CASCADE( Delete the schema object together )/RESTRICT( If the schema contains schema objects , Don't delete )

Partition table :

				 Create partition functions :CREATE PARTITION FUNCTION myRangePF1(int)
							 AS RANGE LEFT( Less than or equal to and greater than )/RIGHT( Greater than or equal to and less than ) FOR VALUES(1,100,1000)
				 Create partition scheme :CREATE PARTITION FUNCTION myRangePF1(int)
							 	AS RANGE LEFT FOR VALUES(1,100,1000)
							 GO
							 CREATE PARTITION SCHEME myRangePS
							    AS PARTITION myRangePF1 
							    TO(test1fg,test2fg,test3fg,test4fg)
							 GO
							 CREATE TABLE ParititonTable(
							 col1 int,
							 col2 char(10))
							 ON myRangePS(col1)

Indexes :

 Create index :CREATE NONCLUSTERED/CLUSTERED/UNIQUE INDEX IX_TransactionHistory
			         	ON Transaction(TransactionDate)
 Delete index :DROP INDEX INDEXNAME;
 Index view :
	 Suitable for scenarios using indexed views : The basic data is rarely updated or updated regularly in the form of batch processing , Can improve the performance of join and aggregate operations .
 Create indexed views :CREATE VIEW Sales.vOrders
		  	 With SCHEMABINDING
			 AS
			 SELECT .....
			 GO
			 CREATE UNIQUE CLUSTERED INDEX IDX_V1  Must be a unique clustered index 
			    ON Sales.vOrders( Field name )
			 GO
			  Use the view directly later 

17.SQL SERVER Divide databases into two categories : System database and user database . The system will automatically install five system databases :

master( All system level information )
msdb( Used to schedule alarms and jobs and to record operators )
model( All database templates )
tempdb( Temporary objects and intermediate result sets )
Resourse( Read only database , Contains all system objects )

19. Operating system files include data files ( Data and objects ) And log files ( Information needed to recover all transactions in the database ).

20. Data files include main data files (mdf)( There is only one database ) And secondary data files (ndf). Log files (ldf).

21. Database filegroups : Primary filegroups and user-defined filegroups .

22. Properties of the database file : File name and its location , Initial size , Growth mode , Maximum size

23. Access control can be divided into autonomous access control (DAC) And mandatory access control (MAC) Two types of .

In the autonomous access control method , The user who owns the data object has all access rights to the data , And users can delegate their access rights to other users . Autonomic access control is flexible , However, in the database with autonomous access control strategy , This access restriction defined by authorization can easily be bypassed , Make the system unable to resist malicious attacks on the database . therefore , The method of mandatory access control is adopted in the system that requires a higher degree of security .

In the mandatory access control method , Divide users and objects into multiple security levels , Assign a secret level to each access object in the database , Grant each user an access level , The system provides advanced security authentication based on identification . For any object , Only users with legal access level can access .

When the license level of the subject is greater than or equal to the secret level of the object , The subject can read the corresponding object .

When the license level of the subject Less than or Equal to the secret level of the object , The subject can write the corresponding object .

24. Open the window function :

 The windowing function must be placed in over front , Apply to each partition separately .
 Aggregate windowing function :
	SELECT Cno,Cname,Semester,Credit,SUM(Credit)OVER(PARTITION BY Semester)AS'Total',
	AVG(Credit) OVER(PARTITION BY Semester)AS 'Avg' FROM Course;
 Aggregate ranking function :
	RANK( There can be parallel ),DENSE_RANK( No juxtaposition ),NTILE( Group function ),ROW_NUMBER( The serial number of the row in each partition , from 1 Start )
	 Example :
		SELECT OrderID,ProductID,OrderQty,
			RANK() OVER
			(PARTITION BY OrderID ORDER BY OrderQty DESC)AS RANK
			FROM OrderDetail
			ORDER BY OrderID;

25. Common table expression :

WITH BuyCount(CardID,Counts)AS (
	SELECT CardID,COUNT(*)FROM Table_SaleBill
			GROUP BY CardID)
	SELECT CardID,Counts FROM BuyCount ORDER BY Counts

26. Correlation subquery :

1、 Use subqueries for collection based testing : WHERE IN/NOT IN ( Execute the inner layer first and then the outer layer )
2、 Use subqueries for comparison tests :where  An aggregate function... Cannot appear in a statement , So you need to use SELECT Get the result of the aggregate function first .
3、 Use subqueries for existence testing :where EXISTS/NOT EXISTS( Start with the outer layer , And execute the inner layer )

27. Multi attribute indexes are sorted according to their discrimination

29. In the database application system , There are several principles to prevent deadlocks :

① Each transaction should access the shared resources sequentially , The complex 、 Large transactions are broken down into multiple simple 、 Small business ;
② Access objects in the same order ;
③ Transaction isolation level ;
④ Use binding connection ;
⑤ Flexible use of display locking technology, etc .

30. Multiple post triggers can be created for an operation on a table , But only one pre trigger can be created .

31.( I have a general impression ) According to different monitoring objects , Database monitoring and analysis can be divided into :

 Monitoring of the database architecture 
	 primary coverage : Basic spatial information 、 Space utilization and remaining space size , Whether the space has the ability of automatic expansion 、 Which table expansion will cause space expansion , And the occupied space and interval number of segments .
 Monitoring of database performance 
	 It mainly includes : Hit rate of data buffer 、 Library buffer 、 User lock 、 Lock and wait 、 Rollback segment 、 Use of temporary section 、 Index usage 、 Waiting for events and shared pools .

32.( Regular examination )OLTP(online transaction processing): Online transaction processing environment ( Basic operation ) OLAP(online analytical processing): OLAP is used to support complex analysis operations , Focus on decision support for decision makers and senior managers . Multidimensional analysis operation :1. Drilling and rolling up 2. section 3. rotate 33. The cursor ( Often take multiple-choice questions and fill in the blanks ):

 declare cursor :DECLARE cursor_name 【INSENSITIVE】【SCROLL】CRUSOR
	         FOR...
 Examples illustrate everything :
	 DECLARE @CN VARCHAR(10), @Email VARCHAR(50)
	    DECLARE Cname_cursor CURSOR FOR
		  SELECT CName, Email From Table_Customer
			WHERE CName LIKE ‘ king %’AND Address LIKE ‘’
	    OPEN Cname_cursor
	 FETCH NEXT FROM Cname_cursor INTO @cn,@Email
	 WHILE @@FETCH_STATUS=0
	 BEGIN
		PRINT’ Customer name :’[email protected]+’ mailbox ’[email protected]
		FETCH NEXT FROM Cname_cursor INTO @cn,@Email
	 END
	CLOSE Cname_cursor
	DEALLOCATE Cname_cursor
 Some keyword comments for cursors :
	ABSOLUTE: The first few 
	RELATIVE: Starting from the current position 
	INSENSITIVE: Sensitive and insensitive . Plus, it's not sensitive , The extraction operation reads tempdb Data in the temporary copy of , If not, the data in the original table will be read .
	SCROLL: Plus you can use all the operations , Use only without next

34.UML Figure summary overview : All systems are composed of static structure and dynamic behavior .

UML Four types of diagrams supporting dynamic modeling : State diagram , Sequence diagram , Collaboration map , Activity diagrams 
UML Four levels : Meta model , Metamodel , The user model , Model 
  The business process - Activity diagrams : It can describe the sequence of logical processes in parallel .------
  System requirements - Use case diagram : Use cases , Roles and systems 
  System structure - Class diagram : relation ( Shared aggregation : Hollow diamond , Combine : Solid diamond ), Generalized inheritance : Hollow triangle solid line , rely on :, Refine : White triangle dotted line 
  System structure - Sequence diagram : Explain how the collaboration of objects can meet the objectives of the system . The vertical represents the duration of time , The landscape represents the object . The communication between objects is represented by horizontal message lines . Emphasize time ------
  System structure - Communication diagrams : Describe how objects relate to each other . Emphasis on space ----
  Micro design - Object graph : A snapshot of all objects in the system at a specific point in time .
  Micro design - State diagram : State the time or state transition of the system . Inside the ellipse is the state ----
  Micro design - Time map : Take advantage of the passage of time , Let the time factor present a visual state .
  Macro design - Package diagram : High cohesion , Low coupling 
  Macro design - Interaction Overview : Put the process ( Activity diagrams ) Integration .
  Macro design - Composite structure diagram : For system integration .
  system implementation - Component diagram :
  system implementation - Deployment diagram :

35. Forced access control ( Fill in the blanks often ):D class : Minimum protection .C class : Self protection .B class : Compulsory protection .A class : Verify protection .

36. The physical design of the database does not include the specific implementation details of the file and database ( For example, how to create a file 、 Build a database and how to load data ).

37.dbcreator Roles have the ability to create 、 Delete 、 Permissions to modify and restore database objects , So we can make ACCT Only in dbcreator Role .

38. The general data distribution strategy of distributed database can be considered from two aspects of data fragmentation and data distribution , Generally, the data is partitioned first , Redistribute data . Sharding is the operation of relationships , And allocation is the operation of partition results . Sharding mode is an image that describes each data fragment and its global relationship to the fragment , The allocation mode is to describe the image of each fragment to the physical storage site .

41. The transaction ACID( Fill in the blanks with multiple choice questions

⑴  Atomicity (Atomicity)
   Atomicity refers to the success of all operations contained in a transaction , Either all failures roll back , This is the same as the previous two blogs about transactions   Function is the same concept , Therefore, if the transaction operation succeeds, it must be fully applied to the database , If the operation fails, there will be no impact on the database .
⑵  Uniformity (Consistency)
   Consistency refers to the fact that a transaction must transform a database from one consistency state to another , That is to say, a transaction must be in a consistent state before and after execution .
   Take money transfer , Suppose the user A And the user B The sum of the two is 5000, So no matter A and B How to transfer money between banks , Transfer several times , After the transaction, the sum of money of the two users should be 5000, This is the consistency of transactions .
⑶  Isolation, (Isolation)
   Isolation is when multiple users access the database concurrently , For example, when operating the same table , A transaction opened by a database for each user , It cannot be interfered by the operation of other transactions , Multiple concurrent transactions should be isolated from each other .
   That is to achieve such an effect : For any two concurrent transactions T1 and T2, In the transaction T1 It seems ,T2 Either in T1 It's over before it starts , Either in T1 It's not until it's over , In this way, each transaction does not feel that other transactions are executing concurrently .
   Isolation databases for transactions provide multiple levels of isolation , I'll talk about it later .
⑷  persistence (Durability)
   Persistence means that once a transaction is committed , So the change to the data in the database is permanent , Even in the case of database system failure, the transaction commit operation will not be lost .  For example, we are using JDBC When operating the database , After the transaction method is committed , Prompt the user to complete the transaction operation , When we finish the program execution until we see the prompt , You can identify the transaction and submit it correctly , Even if there's something wrong with the database , We must also complete our business , Otherwise, we will be prompted that the transaction is finished , But the database failed to execute the transaction due to failure .

42. Metadata : Description table structure , The data of the relationship between tables is metadata ; Data integration during statistical analysis is also metadata .

43. The specific contents of system planning and definition include : Mission statement 、 Set the goal of the task 、 Determine the scope and boundaries of the system 、 Determine the user view .

44.DFD The arrow in indicates the flow direction of the data , Cannot represent control flow and constraints .

45. The main task of presentation layer is to design human-computer interface ; The main task of the business logic layer is to sort out DBAS Various business activities , It is represented as various system components ( Such as class 、 modular 、 Components etc. ); The main task of the data access layer is to DBAS The data processing requirements are designed to operate various transactions of the database ; The main task of the data persistence layer is to design the storage structure of the application system .

46. For the data file and its specific index file , If the data records in the data file are arranged in the same order as the index entries in the index file , The index file is called a clustered index . A clustered index can be a primary index , It can also be a secondary index . The index established on the main code attribute set of the data file is called the main index . The primary index can be a clustered index , It can also be a non clustered index . The key values of a clustered index can be repeated . A sparse index is an ordered index , Therefore, the data file pointed to must be orderly .

47. Hash file organization is not suitable for :

① Inexact query based on Hash field value ( Such as fuzzy query 、 Range queries );
② Queries based on non hash fields .

48.WITH DIFFERENTIAL,NOINIT in DIFFERENTIAL Means to perform a database differential backup , Absence of this option means a full database backup ,NOINIT Indicates that the backup content is appended to the specified media set , To preserve the original backup set .

47. The rotation method is more complex for point query and range query , Because I don't know which disk the tuples are distributed on , All disks must be searched , Obviously reduces the query efficiency , Not suitable for point query . Both hash partition and range partition are beneficial to point query .

48. Decision support system (DSS) generally refers to the information system in an enterprise which is based on data to implement auxiliary decision-making for important business or affairs .

49.K-means The algorithm is a typical distance based clustering algorithm , Distance is used as the similarity evaluation index , That is to say, the closer the two objects are , The more similar it is .

50.UML Four layer modeling framework : Meta model ( form UML The most basic element ), Metamodel ( Make up the basic elements , Including object-oriented and component-oriented ), Model ( Each concept in this layer contains an instance of the metamodel ), The user model ( Are instances of the model layer )

51. common RAID The levels are :

RAID0( The advantage is that the data is partitioned 、 The technology of parallel transmission , Can improve the reading and writing speed )
RAID1( Security , Mirror image is adopted , Improve the reading speed , No improvement in writing speed , It improves the fault tolerance of the system , Low utilization of hard disk )
RAID5( stay RAID0 Add parity information based on , Read speed and RAID0 be similar , But the writing speed is slightly slower , But disk utilization ratio RAID1 high )
RAID10(RAID0 and RAID1 The combination of , Improve the speed of reading and writing ).

52. Backup the database T-SQL grammar :

BACKUP DATABASE/LOG database_name TO MyBK_1 WITH DIFFERENTIAL,NOINIT;
DIFFERENTIAL  Differential backup 
 The default is full backup 
NOINT  Additional , And keep the original set 

53. Partition strategy of parallel database :

 It is divided into shared memory structure , Shared disk structure , No shared structure and hierarchy .
 One dimensional data partition :  Rotation method : Not applicable to point query and range query , But it gives full play to parallelism .
 Hash partition : Fit point query , It is also very efficient for sequential queries , Improper selection of hash function will lead to unbalanced data division .
 Scope division : It is applicable to point query and range query .

54. data mining

 Steps of data mining : Data preparation , data mining , Interpretation and evaluation of results .
 Classification of data mining :  
  Mining association rules : Find some kind of connection between data . Support , Degree of confidence 
  Classification mining : Create a classification function , Construction of classifier .
  Clustering mining : High similarity within the group , However, the similarity among different groups is quite different .
  Time series analysis : Data evolution analysis .

55.DFD Data flow diagram : It is divided into four departments :

 Data flow ( arrow , Describe the flow of data ), Handle ( Rectangle box , Process and transform data ), data storage , External item ( Parallelogram box , Providers and consumers of data ) A top-down, step-by-step, structured analysis method .

56.IDEFO(ICAM DEFinition Method): Rectangle box ( Functional activities ) And arrows . The upper arrow controls , Down arrow mechanism , Left arrow condition , Right arrow output .

57. Cloud computing usually includes software as a service (SaaS)、 Platform as a service (PaaS)、 Infrastructure as a service (Iaas).

58. There are several steps to create a partitioned table : Create partition functions , Create partition schemes and create tables using partition schemes .

59. From the perspective of function, the database application system can be divided into 4 The first layer is the presentation layer 、 Business logic layer 、 Data access layer 、 Data persistence layer . The main task of presentation layer outline design is to design man-machine interface ; The main task of business logic layer outline design is to sort out DBAS Various business activities , It is expressed as various system architectures ; The main task of the data access layer outline design is to DBAS The data processing requirements are designed to operate various transactions of the database ; The main task of the data persistence layer outline design is to design the storage structure of the application system .

60. Communication between objects is represented by horizontal message lines between object lifelines , The arrow indicates the type of message , Such as synchronization 、 Asynchronous or simple . Sequence diagrams can represent recursive processes , When an operation calls itself , Messages are always synchronized . In the sequence diagram, you can describe how to create and destroy objects , Messages that create or destroy an object are usually synchronized . Messages in sequence diagrams can be conditional , It also stipulates that messages can be sent and received only when the condition is true , If the conditions are not mutually exclusive , Messages may be sent in parallel .

61. Cannot define... On a view AFTER Type trigger

62. Scalar functions are functions that return a single data value . Not applicable in scalar functions SET sentence .

63. Putting data files and index files on the same disk can not improve query efficiency , This is because reading data from the same disk is not as fast as reading data from different disks in parallel .

64. The main purpose of establishing data warehouse is to take appropriate measures to integrate enterprise data according to decision-making requirements , Form a comprehensive 、 Analysis oriented data environment , It is used to support the information of the enterprise 、 Application of decision-making analysis .

65. If you want to enable a user to delegate the permissions granted to him to other users , Then you need to add... To the authorization statement WITH GRANT OPTION Options .

66. The requirements analysis process includes identifying issues 、 Build demand model 、 Describing requirements 、 Confirm demand . among DFD and IDEF0 It can be used to model requirements ; and IDEF2 Used for system simulation , Build a dynamic model .

67. stay UML in , Use cases are represented by ellipses , Use cases are located inside the system boundary .

68. Shared free architecture is considered as the best parallel architecture to support parallel database systems , It reduces the probability of resource competition by minimizing shared resources , It's very scalable , And it can achieve near linear speedup ratio in the process of complex database query processing and online transaction processing , therefore , No sharing structure is suitable for OLTP Applications like that .

69.XML The database is suitable for managing data sets with complex data structures , When the data itself has hierarchical characteristics , because XML The data format can clearly express the hierarchical characteristics of data , therefore XML The database facilitates the operation of hierarchical data .

70. Clustering methods include statistical methods 、 Machine learning methods 、 Neural network method and database oriented method . In machine learning , Clustering is called unsupervised ( Or no teachers ) inductive . Compared with classification , Examples of classification or data objects have category marks , In the case of clustering, there are no markers , It needs to be determined automatically by clustering algorithm . The core of clustering is to group the data in a data set , Make the data in each group as similar as possible and the data in different groups as different as possible .

71. stay IDEF1X Data modeling methods , Right angled rectangular boxes are used to represent independent entity sets , The rounded rectangle is used to represent the set of dependent entities .

72. In the classification prediction task , The data to be used generally includes training sets 、 Test sets and validation sets . 73.SQL Server 2008 The minimum size of the main data file in the database cannot be less than 3MB. 74.Guest yes SQL Server A special database user in , In practice, it is often used as an anonymous visitor to the database .sa It is a database login account defined by the system . A login account can be mapped to users in multiple databases . When the login account becomes a legal user in the database , This account has the query authority of some system views , It does not have any operation permissions for user data and objects in the database . 75. Data integration is to extract data from different data sources 、 transformation 、 clear 、 Loading is the process of loading data warehouse , Users can only extract the required data from the data source , After data cleaning , And loaded into the data warehouse designed previously , Report analysis can be performed on data in the data warehouse 、 Multidimensional analysis and data mining , Instead of integrating all the data in the enterprise into the data warehouse 76. Create user-defined functions : Scalar function : CREATE FUCNTION function_name( Parameters ) RETURNS int AS BEGIN RETURN( Return value ) END

	 Inline table valued functions :
			 Monolingual sentence table valued function :
				CREATE FUNCTION function_name( Parameters )
				RETURNS table
				AS
				BEGIN
					RETURN(SELECT sentence )
				END
			 Multi statement table valued function :
				CREATE FUNCTION function_name( Parameters )
				RETURNS  Table name  table()
				AS
				BEGIN
					INSERT INTO  Table name 
						SELECT  sentence 
					RETURN
				END

77. Rules for defining triggers : Triggers are divided into DML( Data operation language ),DDL( Data definition language ) And login triggers (LOGON).

 Create trigger :CREATE TRIGGER trigger_name ON table_name FOR/AFTER/INSTEAD OF
			AS
			BEGIN
			END;
 Trigger notes :  about AFTER Type trigger , The same operation can create multiple triggers .
			    about INSTEAD OF Type trigger , Only one trigger can be created on the same operation .
			    Statements that create and change databases and database objects are not allowed in trigger bodies .
			   IF UPDATE  To determine whether the specified field is affected .
			    produce INSERTED and DELETED surface ,DELETED Table storage DELETE and UPDATE A copy of the line affected by the statement .
			   						   INSERTED Table storage INSERT and UPDATE A copy of the line affected by the statement .

78. Transaction internal failures are divided into expected transaction internal failures and unexpected transaction internal failures . The expected transaction internals refer to the transaction internal faults discovered by the transaction program itself ( The balance of campus card is inconsistent , Because the consistency of transactions is not guaranteed ). However, unexpected transaction internal failures cannot be handled by the transaction program , For example, operation overflow fault 、 Concurrent transaction deadlock failure 、 Failure due to violation of some integrity restrictions .( See if it can be handled through the transaction program )

79. Three characteristics of distributed database : Decentralized management , High availability , Local autonomy

80. Characteristics of data warehouse : Subject oriented 、 Integrated 、 non-volatile 、 Changing over time .( Theme oriented , Integration , Non updatability , Time characteristics )

81. stay IDEF1X Data modeling methods , Right angled rectangular boxes are used to represent independent entity sets , The rounded rectangle is used to represent the set of dependent entities . IDEF1X Use a rectangular box to represent the entity set , The set of dependent entities is represented by a rectangular box with a circle . contact : Standard contact ( Determined by the connection of the parents , Solid line connects single points )、 Non standard contact ( There is no need to know the entity set of parents , Dotted lines connect single points )、 Categorical contact ( Monthly and hourly employees , Single point solid line with two bars )、 Uncertain contact ( Many to many relationship , Two point solid line )

82. The account can only be connected to SQL Server Database server , But do not have access to any database . The operation of making the database account a database user becomes “ mapping ”. One login account can map users of multiple databases . The newly created database has only one user :dbo. It is the owner of the database . among , also guest Users can access the database anonymously ( No account required ).

83.XML(Extensible Markup Language): Extensible markup language . XML Advantages of database :

1.XML Database can effectively access and manage semi-structured data .
2. Provide operations on labels and paths .
3. It is convenient to operate hierarchical data .

84. The transaction specification includes the transaction name 、 Transaction description 、 Data items accessed by the transaction 、 Transaction users

85. Transaction log backup is only used in full recovery mode and bulk log recovery mode , It does not back up the database itself , Only backup log records , And only the log contents that have changed from the last backup to the current backup time are backed up . However, point in time recovery is not allowed for mass operation log backups . The end log backup is performed in case of failure , Used to prevent data loss , It can contain pure logging or bulk operation logging .

86. The parallel computation of aggregate function can be “ Open first and close later ” Methods .

87. Location independence 、 The independence of data fragmentation and data replication are the main factors that make the distributed database transparent .

88. The two-phase commit protocol divides the site's transaction manager into coordinator and participant , In the first stage, the coordinator asks all participants whether the transaction can be committed , Participants respond , In the second stage, the coordinator decides whether to commit the transaction according to the participants' answers .

89. When developing a backup strategy , In addition to considering the amount of data lost when using backup recovery , Also consider the time required for database backup . Checkpoint technology greatly reduces the log portion that must be performed when a database is fully restored . Static dump ensures the validity of data , But at the cost of reducing the availability of the database ; Although dynamic dump improves the availability of the database , But the validity of the data may not be guaranteed . Differential dump is compared with incremental dump , Slow speed , Take up more space , But recovery is faster than incremental dump .

90.SQL Server Two backup methods are supported , One is to establish a backup device first , Then back up the database to the backup device , Such a backup device is called a permanent backup device ; The other is to back up the database directly to the physical file , Such a backup device is called a temporary backup device . Create a backup device T-SQL The stored procedure is sp_addumpdevice

91. A snapshot is a fully available copy of a specified set of data , This copy includes the corresponding data at some point in time ( Copy the start time ) Image of . A snapshot can be a copy of the data it represents , It can also be a copy of the data . It reflects the data at a certain point in time , The data is unchangeable . And the shopping mall commodity sales table 、 The call details of telecom companies belong to dynamic data , It is not suitable to obtain data by snapshot .

92. stay UML In the state machine diagram of , Transitions between states are event driven .

93. Log backup knowledge points :

 Backup content : User data and system data .
 Backup time : The system database must be backed up immediately after modification .
			  The user database is backed up periodically .
 The user database needs to be backed up immediately :
			  After creating a database or loading data in batches in the database .
			  After creating the index .
			  After cleaning up the transaction log .
			  After performing mass data operations .
 Backup : Permanent backup device : First create a backup , Then back up the database to the backup device .
			  Temporary backup device : Back up the database directly to the physical file .
 Create a backup device SQL Statement for :sp_addumpdevice
 Backup type : Database backup :
 Full database backup : Back up all the data in a specific database and enough logs to recover it .( Backup does not affect the user's operation , It can also back up all the operations during the backup process )
		 Difference database : Back up all changes of the database since the latest full backup . It takes up less space , Fast execution                 
 File backup : You can restore only damaged files , Instead of restoring the rest of the database , This accelerates recovery .
 File backup : One or more files or filegroups .
 Differential file backup 
 Transaction log backup : The database can be recovered to the point of failure or a specific point in time . The transaction log uses less resources .
 There are three types of transaction logs : Pure log backup ( Contains only a certain amount of transaction log backups ), Large capacity operation log backup ( Backup of data pages containing logging and bulk operation changes , Point in time recovery of large capacity operation log backup is not allowed ), End log backup .
 Common backup strategies :  Designing an effective backup strategy requires careful planning 、 Implementation and testing . Testing is a necessary part .
				 Full database backup .
				 Full database backup plus log backup .
				 Full database backup plus differential backup plus log backup .

94. Client server architecture (C/S): The client is responsible for the user interface and the application of business rules . The database server is responsible for the transaction logic , data storage , Data access . Fat client Browser server architecture (B/S): The browser is responsible for displaying the logic ,Web The application server is responsible for applying business rules , The database server is responsible for the transaction logic , data storage , Data access . Thin Client

95. checkpoint : The transaction did not complete when the failure occurred , That is, not submitted , It should be revoked ; If the transaction is committed after the checkpoint , The changes they make to the database are still in the buffer at the time of the failure , Not yet written to the database , So we need to REDO operation ; If the transaction has been committed before the checkpoint , So you don't have to REDO operation .

96. To avoid a live lock , Adopt a first come, first serve policy to handle transactions .

97. Metadata is mainly divided into Technical Metadata and business metadata .

98. Database mirroring is divided into highly available operation modes 、 High protection operation mode and high performance operation mode .

99. The results of data processing requirements analysis can also be expressed as transaction specifications . The transaction specification includes the transaction name 、 Transaction description 、 Data items accessed by the transaction 、 Transaction users

100.tempdb It's a temporary database , Used to save temporary objects or intermediate result sets , And provide a temporary workspace for data sorting and other operations . Each start SQL Server Will be recreated tempdb database .tempdb Used to store temporary information , Local and global temporary tables created by the user are automatically placed in the database .

100.SQL Server 2008 Support database 、 Data file two levels of data recovery .

101. The objects of database integrity constraints are divided into columns 、 There are three levels of tuples and relationships . Tuples correspond to rows , The relationship corresponds to the table .

102.SELECT The basic syntax format is

SELECT  Query content   
FROM  Table name 
WHERE  Conditional expression 
GROUP BY  The name of the column to be grouped 
HAVING  Name  
ORDER BY  Column name to be sorted .

103. Export data or materialized views in the data warehouse ( Solid view ) In the maintenance strategy of , The policy of updating only when the user finds that the data has expired during query is called delayed maintenance policy . The maintenance strategy includes : Real time maintenance , Delayed maintenance and snapshot maintenance .

104. When calling a stored procedure , Just declare the type of the parameter , The parameter cannot be specified as an output parameter . Only when executing again can the parameter be specified as an output parameter .

105. To detach a database, you need to deactivate the detached database , But you don't need to stop SQL Server service

106.Oracle The security control mechanism can be divided into database level security control 、 Table level 、 Row level and column level security control . Database level security is guaranteed by user identity authentication and granting users corresponding system permissions , And the table level 、 Row level 、 Column level security is guaranteed by granting or reclaiming object privileges .Oracle Users in the database can be divided according to their operation permissions DBA Users and ordinary users

107. Database operation and maintenance mainly includes database dump and recovery ; Database security and integrity control ; Monitoring, analysis and improvement of database performance ; The reorganization and reconstruction of database . The new database user is a function of database security and integrity control .

108. The operation of the database system depends on the server 、 operating system 、 Storage 、 Network and other factors . Simply add databases CPU Quantity does not necessarily improve database query speed .RAID1 Improved reading speed , The reliability of the system is enhanced , But disk utilization is low , High redundancy , Writing speed has not improved . The database administrator needs to have a deep understanding of the database system when optimizing , You should also have a deep understanding of the business system .

109. Detach and attach databases :

 Detaching the database will remove the database from SQL Server Delete in instance , But do not delete the data files and log files of the database . The purpose of separating the database is to make the database files and logs not managed by the database system , Instead, it is copied to another computer or to another part of the same computer .sp_detach_db
 Attaching a database means that the separated database is re attached to the database management system , Can be attached to an instance , It can also be attached to another database server .

110. System design is subdivided into conceptual design 、 logic design 、 physical design 3 A step . The detailed transaction coding design adopts high-level programming language design or DBMS The transaction implementation mechanism provided , Physical design module covering system design .

111. A role is an external entity that interacts with the system , It can be a system user or other systems or hardware devices .

112. Full database backup ( Also known as full storage ) All data in a specific database will be backed up , And enough logs to recover this data . Full database backup is the most basic and important backup of all backup methods , Is the foundation of backup . A full database backup backs up all the information in the database , Is the baseline for recovery . Because database backup is an online operation , A large full database backup may take an hour or more , The database will change during this time , Therefore, the full database backup also needs to back up some transaction logs , So that the database can be restored to a transaction consistent state . Using “ Full database backup + Log backup ” when , All log backups need to be restored orderly and one by one . If there is a differential backup , be “ Full database backup + Differential backup + Log backup ” Than “ Full database backup + Log backup ” It is easy and fast to restore , Save time and cost . Database data cannot be recovered only by differential backup

113. The hierarchy combines shared memory 、 Features of shared disk and no shared structure .

114.RANK(): Returns the ranking of each row in the partition of the result set . Row ranking is the number of previous rankings of related rows plus one . If two or more rows are associated with a ranking , Then each associated row will get the same ranking .

DENSE_RANK(): Returns the ranking of rows in the result set partition , There is no break in the ranking . The rank of a row is equal to the number of all ranks before the row in question plus one . If two or more rows are constrained by the ranking in the same partition , Then each constraint line will receive the same ranking .

ROW_NUMBER(): Returns the sequence number of the row in the result set partition , The first line of each partition starts with .ORDER BY Clause to determine that a unique ROW_NUMBER The order of .

NTILE(): Distribute rows in an ordered partition to a specified number of groups . Each group has a number , Number from the beginning . For every line ,NTILE The number of the group to which this row belongs is returned .

115. The operational feasibility study is to demonstrate whether there is DBAS Develop all kinds of personnel resources required ( Project managers 、 Database System Analyst 、 Application programmers, etc )、 Software resources 、 Hardware resources and working environment, etc , And to support DBAS Develop how to improve and strengthen these resources .

116.① Determine the storage structure of the data ;② Design data access path ;③ Determine where the data is stored ;④ Determine the system configuration .

117. The use case model describes an external performer (Actor) Understood system functions , It looks at the system function from the outside of the system , It does not describe the specific implementation of functions within the system .

118. Well designed backup strategy , In addition to considering specific business requirements , At the same time, the availability of data should be improved as much as possible and the loss of data should be minimized . The formulation of backup strategy includes defining the type and frequency of backup 、 Characteristics and speed of hardware required for backup 、 Test method of backup and storage location and method of backup media . Generally, the database and backup should be placed on different devices , Therefore, the backup strategy should consider the storage location and storage equipment of backup .

119.BigTable The index of the table is the row keyword 、 Column keyword and timestamp , Each cell consists of row keywords 、 Column keyword and timestamp are located together .BigTable The characteristics of the data model are :① The key in the table can be any string ;② A column family is a collection of column keywords , Is the basic unit of access control ;③ The timestamp records BigTable It is the time identification of different versions of data contained in each data item . stay BigTable in , You can not only increase or decrease the number of rows at will , Under certain constraints , You can also expand the number of columns .

Chart type

Function description

Activity diagrams

Mainly describe the system 、 The sequence of execution of logical processes in use cases and program modules , Parallel order

Use case diagram

Use case model is a tool to express all the functions that meet the needs of users . The use case model describes an external performer (Actor) Understood system functions , It looks at the system function from the outside of the system , It does not describe the specific implementation of functions within the system .

Class diagram ( Static structure )

The class diagram shows a set of classes 、 Structure and collaboration and the relationship between them ; relation ( Shared aggregation : Hollow diamond , Combine : Solid diamond ), Generalized inheritance : Hollow triangle solid line , rely on :, Refine : White triangle dotted line

Sequence diagram ( Dynamic structure )

Explain how the collaboration of objects can achieve the goal of the system

Communication diagrams ( Dynamic structure )

It shows the organizational interaction relationship between objects and the links between objects in the interaction process

Object graph

An object graph is a graph of objects at a particular point in time , A snapshot of all objects that exist in the system

The state machine diagram

The main purpose of the state diagram is to state the state transition of relevant events or objects in the system

Time map

It mainly uses the passage of the time axis to make the time factor present a visual effect

Package diagram

Express different packages in the system 、 The relationship between namespaces or different items .

Interaction Overview

Use activity diagrams as a basis , Connected between its control flows is the interaction diagram

Composite structure diagram

Where system integration is required , Draw the relationship between the system to be developed and the external system

Component diagram

Used to represent the static implementation view of the system , Show organizational dependencies between components , For system modeling

Deployment diagram

Describe the physical configuration and system architecture of hardware and software in the system

121. Support and confidence ( Often take multiple-choice questions ):

 Support : database D There is S% contain X->Y.
 Degree of confidence : database D Contained in the X There are... In all tuples of C% contain X->Y.

122. Transaction waiting graph dynamically reflects the waiting situation of all transactions , The concurrency control subsystem periodically generates a transaction waiting graph for detection , Instead of checking every transaction .

123. The simple recovery model is only used for testing and developing databases , Or for databases that mainly contain read-only data , Such as data warehouse .

124. Database users can be divided into system administrators 、 Ordinary users and object owners .

125. The results of data processing requirements analysis can be expressed as transaction specifications .

126.oracle Database users can be divided into... According to their operation permissions DBA Users and ordinary users .

127. The data model consists of data structures , Data operation and integrity constraint are three parts .

129.datediff(): Used to calculate the difference between two dates .

130. Two level locking protocol can ensure serializability .

131. In distributed database , The use of semi connection operation can reduce the · Data transmission volume .

132. Index structure : The index column value and the corresponding pointer constitute .

133. Scalar function , Embedded table valued functions , Multi statement table valued function

134. Manual monitoring mechanism and automatic monitoring mechanism .

135. Data conversion , Transform data with inconsistent data granularity .

136. Application ETL The processing operations that a tool usually performs are : extract , Conversion and loading .

137. Establishing materialized views and aggregations are storage optimization methods .

A summary after the exam

Finally, I will write some opinions about the computer level 3 database test . It is believed that the purpose of applying for computer level three one is to get the certificate , The second is to broaden the scope of knowledge . CET-3 is a knowledge-based assessment mode , So just take the time , Database Xiaobai can also get high scores . however , Being able to take an exam does not necessarily mean being able to apply , Database is the most widely used data storage nowadays , Processing architecture , It has been optimized step by step by countless generations of database engineers to form the now mature system , It can't be 3~4 The time to prepare for the exam can be mastered . As a person who has taken this exam , I don't recommend that you spend a month to get the certificate , If you have the time , Try to find some projects that contain database applications , It is the new youth of our time to make continuous progress in application , The learning road engineers should take . If you have already signed up , Then follow the review method of blog , Take about a month to prepare it ! After all, this is also a way to prove yourself . come on. ! Growing up in learning .

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/151756.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206242246017911.html