Overview ?? Before MySQL 55, the default storage engine was MyISAM, and then changed to InnoDB. To modify the default engine, you can modify the default-storage-engine in the configuration file. You can use showengines to view the engines supported
I. Define entities
Double-click the object symbol to go to the object attribute page.
1. General Project
Name: identifies an object in the model and is generally used for displaying the model on the interface (this can be changed by changing the
(1) usage of Foreign keys:
The foreign key has two main functions:One is to allow the database to ensure data integrity and consistency through foreign keys.One is to increase the readability of the erimage.Some people think that the establishment
If Table A's primary key is a field in table B, the field is called the Foreign key of Table B, table A is called the primary table, and table B is called from the table.The foreign key is used to guarantee the integrity and consistency of the data,
This article illustrates how MySQL uses foreign keys to implement cascading deletes and updates. Share to everyone for your reference, specific as follows:
MySQL supports the foreign key storage engine only InnoDB, when creating foreign keys,
Data | database | syntax aggregate function count
Use:
Returns the number of rows in the selected result set.
Grammar:
SELECT COUNT (column_name) from table_name
Cases:
The original data in the "Persons" table is as follows:
Name
Age
Hansen,
The InnoDB engine provides transactional security with commit, rollback, and crash resiliency, but the contrast MyISAM engine is less efficient and consumes more disk space and preserves data and indexes1. Auto-Grow columnThe auto-grow column of the
1. Only the InnoDB engine allows the use of foreign keys, so our datasheets must use the InnoDB engine.2. Note:1, must use the InnoDB engine;2, foreign keys must be indexed (index);3, foreign key binding relationship use "on DELETE CASCADE" here,
Transferred from the public number "MySQL database": http://mp.weixin.qq.com/s?__biz=MzIyNjIwMzg4Ng==&mid=2655293044&idx=1&sn= E312934e5115105fdbe5da12af150276&scene=0#wechat_redirect"All over" MySQL database operations common commands2016-07-21
The main contents of this chapter:
First, foreign key
Second, table connection
Third, sub-query
Iv. Index
first, foreign key:
1. What is a foreign key
2. Foreign KEY syntax
3, FOREIGN key conditions
4.
Create user: CREATE user ' username ' "@ ' hostname '" identified by ' password ' hostname can be empty, default to NULL is% permission, indicating all hosts can connect' jredu '@'localhost'jredu';Grant to assign permissions to the user; Grant
If Table A's primary key is a field in table B, the field is called the Foreign key of Table B, table A is called the primary table, and table B is called from the table. Foreign keys are used to achieve referential integrity, and different foreign
One. Common MySQL command-line commands1. Start MySQL service net start MySQLStop MySQL service net stop MySQL 2. Netstat–na | findstr 3306 View the port being monitored, findstr is used to find out if there is a port in the back3. Log in to the
InnoDB Storage Engine1. Storage: Data directory. Can be modified by configurationStore file: Frm,ibd end of file. FRM storage table structure, IBD stores indexes and dataStorage log: Ib_logfilen file2.INNODB storage engine turned on or off:Close
What are the common data objects for MySQL:
Database/schema
Table
Index
View/trigger/function/procedure
Multi-database uses:
Segregation of business
Isolation of resources
Common data objects on a table:
[Email protected]The + + operation in C # can be an integer or a decimal, and only the integer + + operation in SQL.char type suitable for storage length fluctuation small non-recyclable efficiency highvarchar type suitable for storage length
Both on delete and on update have restrict,no Action, cascade,set null property. Now explain the meaning of their attributes separately.On DELETERestrict (constraint): When the corresponding record is deleted in the parent table (that is, the source
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.