当前位置:网站首页>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
边栏推荐
- 黑苹果安装教程OC引导「建议收藏」
- 2.01 backpack problem
- Successful cases of rights protection of open source projects: successful rights protection of SPuG open source operation and maintenance platform
- Yii2 connects to websocket service to realize that the server actively pushes messages to the client
- [experience sharing] summary of database operations commonly used in Django development
- Special test for cold and hot start of app
- Jerry's wif interferes with Bluetooth [chapter]
- 我呕血收集融合了来自各路经典shell书籍的脚本教学,作为小白的你快点来吧
- go数组与切片,[]byte转string[通俗易懂]
- Luogu_ P1303 A*B Problem_ High precision calculation
猜你喜欢

PCB understand Wang, are you? I am not

PHP crawls web pages for specific information

Solution to directory access of thinkphp6 multi-level controller

New product experience: Alibaba cloud's new generation of local SSD instance I4 open beta

RSLO:自监督激光雷达里程计(实时+高精度,ICRA2022)

First knowledge of exception

MySQL multi table joint query

Jupyter notebook中添加虚拟环境

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

你的代码会说话吗?(上)
随机推荐
Template_ Large integer multiplication
2.01 backpack problem
2022年中国运维安全产品市场规模及发展趋势预测分析
为什么越来越多的用户放弃 Swagger,选择Apifox
How to set auto format after saving code in vscade
[codec] write H264 decoder (1) from scratch
中国数据库技术大会(DTCC)特邀科蓝SUNDB数据库专家精彩分享
中国广电5G套餐来了,比三大运营商低,却没预期那么低
StackOverflow 2022数据库年度调查
《蛤蟆先生去看心里医生》阅读笔记
Pytorch main modules
5A synchronous rectifier chip 20V to 12v2a/5v4.5a high current 24W high power synchronous rectifier chip high current step-down IC fs2462
锐捷交换机配置ssh password登录命令[通俗易懂]
G1垃圾收集器中重要的配置参数及其默认值
How about stock online account opening and account opening process? Is it safe to open a mobile account?
PCB understand Wang, are you? I am not
Latest summary! 30 provinces announce 2022 college entrance examination scores
2021计算机三级数据库大题总结
单元测试 CI/CD
Hubble数据库x某股份制商业银行:冠字号码管理系统升级,让每一张人民币都有 “身份证”