当前位置:网站首页>Summary of 2021 computer level III database
Summary of 2021 computer level III database
2022-06-28 13:44:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
For convenience The next big questions are put here The first big question ——ER Diagrams and relational patterns
Related references : ( One ) What is? ER chart ?
(1) Concept
ER chart : Entity relation diagram , Brief notes E-R chart , Refers to the entity 、 Relationship 、 Three basic concepts of attributes summarize the basic structure of data , So as to describe the conceptual pattern of static data structure
(2) elements
3 elements : Entity 、 Properties and relationships
(3) Express
** Entity ** type : Use a rectangle to represent ,** Inside rectangle ** Specify the entity name ;
** attribute **: use ** ellipse ** Rounded corners or rectangles represent , Connect with the corresponding entity ; Multivalued attributes are connected by two lines ;
Underline the name of the primary attribute ;
** contact **: use ** The diamond ** Express , Write the contact name in the diamond box , Connect with related entities , At the same time, the type of connection is marked beside the undirected edge
(4) Relationship
stay E-R The diagram should clearly show 1 To many ,1 Yes 1 Relationships and many to many relationships .
1 Yes 1 The relationship is written in the direction of the connection between two entities 1;
1 The many to many relationship is 1 The party who wrote 1, More than one party to write N;
Many to many relationships are written in the direction of the connection between two entities N,MFor the requirements analysis phase , Example title :
ER chart
Relationship model
The second big question ——SQL Fill in the blanks
1) Use FOR or AFTER The trigger defined by the top selection is the post trigger , Only in The actions in the statement that triggered the trigger execution have been successfully executed , And after all constraint checks have been successfully completed , To execute the trigger . 2) Use INSTEAD OF The trigger defined by the top selection is the front trigger . In the trigger of this mode , Appoint Execute trigger Instead of executing what triggers the trigger to execute SQL sentence , Instead of the operation that triggers the statement . Two special temporary worksheets can be used in trigger statements :INSERTED Table and DELETED surface . These two tables are created by the user data During the change operation of ,SQL Server Automatically created and managed . among INSERTED Tables are used to store INSERT and UPDATE A copy of the line affected by the statement . and DELETED Tables are used for storage DELETE and UPDATED A copy of the line affected by the statement . The syntax for creating triggers is : CreateTRIGGER trigger_name ON { table | view } { { { FOR |AFTER | INSTEAD OF } { [ Insert ] [ , ] [ Update ] } AS [{ IF Update (column ) [{ AND | or } Update ( column )] […n ] | IF ( COLUMNS_UpdateD ( ) { bitwise_operator } updated_bitmask) { comparison_operator } column_bitmask […n ] }] sql_statement […n ] } }
The third big question —— case analysis
【 Their thinking 】 This question examines Knowledge of partition tables, database operating environment and parameter adjustment . (1) Partitioned table is to divide the data in the table into different subsets in a horizontal way , These subsets of data are stored in one or more filegroups in the database . Reasonable use of partitions will greatly improve the performance of the database . Whether to create a partitioned table mainly depends on the current and future data size of the table , It also depends on the operation characteristics of the data in the table . Usually , If a large table meets the following conditions at the same time , Is more suitable for partitioning :① The table contains ( Or will contain ) A large amount of data used in many different forms ,② The data is segmented , For example, data is separated by years . However , A large amount of data is not the only condition for creating partitioned tables **, If a large number of data in the table are frequently used data , And they operate in the same way , It's best not to use partition tables **. When the operation on data only involves some data but not all data , Consider creating partition tables . (2) about CPU、 Memory 、 Disk and other hardware devices are used more than when idle 90%, It indicates that hardware resources are scarce . If the utilization rate is less than 90% It indicates that the hardware resources are sufficient . For partition tables , If for a table Current segment data , A common operation is to add 、 modify 、 Delete 、 Inquire about , For other data , There is almost no operation , Or the operation is limited to query , Then you can partition the table . Use RAID when , You can put the basic table and the index based on the table on different disks , When accessing the base table in this way , Disk drives that store data and indexes work in parallel , You can get faster file reading and writing speed ; Allied , Log files and data objects ( surface 、 Index, etc. ) It can also be stored on different disks to improve the performance of the system I/O performance .**RAID1 be relative to RAID0 To improve the reading speed , The reliability of the system is enhanced , But the writing efficiency has not improved .** stay RAID in , If price is not taken into account , Actually RAID10 Best fit , It's a RAID0 And RAID1 The combination of , It inherited RAID0 Fast and RAID1 The safety of the , At the same time, the reading and writing speed is improved . But the topic mainly tests reading ability , therefore RAID1 Than RAID0 More suitable for .
answer : [1] On the login time column in the login log table Create the right partition function in months , Divide the login log table into 12 Zones , Each partition corresponds to the value of one month of the year . because Operations are limited to query , Creating partition tables can effectively improve query efficiency . [2] Adoption scheme 2. about CPU、 Memory 、 Disk and other hardware devices are used more than when idle 90%, It indicates that hardware resources are scarce . If the utilization rate is less than 90% It indicates that the hardware resources are sufficient . In this question , Memory and disk utilization are higher than 90%, and CPU The utilization rate of is not higher than 50%, explain ** Memory 、 Lack of hard disk resources , Need to adjust , and CPU We have sufficient resources and do not need to adjust .** Therefore, when adjusting the hardware , The capacity of memory and the access efficiency of hard disk should be improved .RAID1 be relative to RAID0 To improve the reading speed , The reliability of the system is enhanced , But the writing efficiency has not improved .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/150615.html Link to the original text :https://javaforall.cn
边栏推荐
- (original) [Maui] realize "floating action button" step by step
- Zhongang mining focuses on the fluorine chemical industry and lays out the new energy industry chain
- China Radio and television 5g package is coming, lower than the three major operators, but not as low as expected
- 程序员坐牢了,会被安排去写代码吗?
- 如何备份mysql_史上最全的MYSQL备份方法
- To be the Italian Islander? Liuqiangdong cashed out 6.6 billion yuan in two months and made a one-time 560million "emergency transfer" to buy the European maritime Palace
- PostgreSQL surpasses MySQL
- 公司领导说,个人代码超10个Bug就开除,是什么体验?
- PCB understand Wang, are you? I am not
- 真香啊!最全的 Pycharm 常用快捷键大全!
猜你喜欢

Luogu_ P1303 A*B Problem_ High precision calculation

Mobile web training day-2

公司领导说,个人代码超10个Bug就开除,是什么体验?

PHP crawls web pages for specific information

Align content attribute in flex layout

iNFTnews | 科技巨头加快进军Web3和元宇宙

Recognize the startup function and find the user entry

PostgreSQL超越MySQL

Why do more and more users give up swagger and choose apifox

Unit test ci/cd
随机推荐
PHP gets the number of digits and replaces it with the specified mantissa
Hubble数据库x某股份制商业银行:冠字号码管理系统升级,让每一张人民币都有 “身份证”
为什么越来越多的用户放弃 Swagger,选择Apifox
Explanation of sprintf function in C language
[understanding of opportunity -32]: Guiguzi - Dui [x ī] Five attitudes towards danger and problems
Recognize the startup function and find the user entry
Kubernetes' in-depth understanding of kubernetes (II) declaring organizational objects
StackOverflow 2022数据库年度调查
Unit test ci/cd
NPOI导出Excel并下载到客户端
Pytorch Foundation
APP冷热启动专项测试
Latest summary! 30 provinces announce 2022 college entrance examination scores
Visual design tutorial of word cloud
Luogu_ P1303 A*B Problem_ High precision calculation
Fs7022 scheme series fs4059a dual two lithium battery series charging IC and protection IC
Data analysis - promoter evolution analysis
30 sets of JSP website source code collection "suggestions collection"
Jeecg 官方组件的使用笔记(更新中...)
Kubernetes 深入理解Kubernetes(二) 声明组织对象