MySQL To strengthen

Default

Not null

Unique

Primary key

Zerofill primary key auto_increment

primary key auto_increment

constraint Main table _ Side table _pk foreign key (id) reference Main table (id);

constraint Main table _ Side table _pk foreign key (id) reference Main table (id)on update cascade on delete cascade Cascade modification cascading deletion

delimiter$

create procedure

begin

declare

end$

First normal form Each field is indivisible

Second normal form Each field has a dependency on the primary key

Third normal form In addition to the primary key, they are directly dependent on the primary key

Internal connection :

Select * from a,b where a.id = b.id

Select * from a where inner join b on a.id = b.id

The left outer join 、 Right connection

Select * from a left outer join b on a.id = b.id

-- Use the left table as the main table To display   Can show null

Call Stored procedure name – call

See all global variables show variables

Look at a global variable show @@ Variable name

Modify global variables   set Variable name = value

Session variables set @ Variable name = value

View session variables select @ Variable name

Create trigger tri_ name after update on Table name for each row

Insert into Record sheet values(‘ Content ’);

-- Change Password

Update user set password = password(‘ New password ’) where user=’ user ’

-- Assign permissions

Grant select on database . Table name to ‘ user ’@‘localhost’identified by ‘ password ’;

MySQL Strengthen more related articles

  1. Hadoop In the use of mapreduce Reading and writing mysql data

    Hadoop In the use of mapreduce Reading and writing mysql data   Sometimes we encounter a large input result set in a project , But the output is small , For example, some pv.uv data , And then for the needs of real-time query , Or some OLAP ...

  2. mysql How many pieces of data can be inserted at most per second ? Dead beat performance pressure test

    We did optimization some time ago , Finally, bottlenecks are found on a single point in the database . ask DBA, The answer to my question is 1W( Mechanical drive ) about . Think of the other day infoQ The last article said that their best hardware write speed is 2W I can't improve after that (SSD Hard disk ) But it doesn't feel like ...

  3. LINUX piece , Set up MYSQL Remote access utility

    Every time you set root And remote access are prone to problems , A general method is summarized , The key is to be practical step1: # mysql -u root mysql mysql> Grant all privileges o ...

  4. nodejs Advanced (6)— Connect MySQL database

    1. Build a library and connect it Connect MySQL Database needs installation support npm install mysql We need to install it ahead of time mysql sever End Build a database mydb1 mysql> CREATE DATABA ...

  5. MySQL Advanced knowledge - MySQL Introduction to the architecture of

    [TOC] 1.MySQL brief introduction summary MySQL Is a relational database management system , The Swedish MySQL AB Companies to develop , At present belongs to the Oracle company . MySQL It's an associated database management system , Save the data in different tables , and ...

  6. Leap second causes MySQL Server's CPU sys Too high

    today , There's a guy with a problem , He has a slave library , As long as it starts MySQL,CPU The utilization rate is very high , among sys The proportion is also relatively high , See the figure below for details . Be careful : His production environment is physical machine , Single CPU,4 individual Core. therefore , He grabbed CP ...

  7. my MYSQL The learning ( One ) Simple grammar

    my MYSQL The learning ( One )  Simple grammar my MYSQL The learning ( Two ) Data type width my MYSQL The learning ( 3、 ... and ) Look at the field length my MYSQL The learning ( Four ) data type my MYSQL The learning ( 5、 ... and ) shipment ...

  8. Entity Framework Core Realization MySQL Of TimeStamp/RowVersion concurrency control

    The general serial number generator Library from SQL Server Migrate to Mysql A problem encountered , Namely TimeStamp/RowVersion Concurrency control type in non Microsoft SQL Server The realization of database in the database .SQ ...

  9. Docker Note 1 : be based on Docker The container builds and runs nginx + php + mysql ( mariadb ) Service environment

    First of all, why write your own Dockerfile To build  nginx.php.mariadb These three mirrors ? First, we hope to have a deeper understanding of Dockerfile Use , So we can have a preliminary understanding of docker How the image is constructed : Second, hope for the future ...

  10. When you forget mysql How to modify the database password

    Because I haven't used the database for a long time , Or forget the database password after changing the password , Unable to access the database normally , You can't change the password , There's a simple way to change the password : 1. First find and open mysql.exe and mysqld.exe The document where it is ...

Random recommendation

  1. Sun Xin MFC Learning notes 14: Network programming

    1.OSI 2.TCP/IP And OSI Corresponding relation 3.Socket 4. The client / Server mode 5.Windows Sockets 6. Socket type 7. Connection oriented socket Programming 8. Facing connectionless socket ...

  2. openLDAP

    Error message : D:\OpenLDAP>slapd -d 256 515a48ae OpenLDAP 2.4.34 Standalone LDAP Server (slapd)515a48af co ...

  3. python3 Preliminary study on reptiles ( Two ) And requests

    About the request page , Have to mention requests This library , This is a third-party library that crawlers often use , use pip Can be installed . requests There are many uses , Here's just some basic , For other advanced functions, please refer to the official documents . import reques ...

  4. (C#) Action, Func, Predicate And so on

    ( Reprint network article ) (1). delegate delegate A statement that we use frequently   Delegate At least 0 Parameters , at most 32 Parameters , There can be no return value , You can also specify the return value type .   example :public del ...

  5. [js Master's Road ] Design Patterns Series - Design a modular extension function (define) And use (use) library

    The birth of modularity marks javascript Development has entered the industrial age , In recent years es6, require js( sea js ), node js The rise of , especially es6 and node js With module loading function , For large program development ...

  6. In a nutshell Java Of HashMap

    In normal development ,HashMap It's the one I use most Map class ( Not one of them. ), It supports null Key sum null value , It is the first choice for most access scenarios using key values . One thing to remember is ——HashMap Not thread safe data structures , So don't ...

  7. Android System startup process ( One ) analysis init Process startup process

    The overall process is as follows :     1.init brief introduction init The process is Android The first process in user space in the system , As the first process , It has been given a lot of extremely important responsibilities , Such as creating zygote( The incubator ) And attribute services .in ...

  8. Spring Http Invoker Brief introduction

    One .Spring HTTP Invoker brief introduction Spring HTTP invoker  yes  spring  A remote call model in the framework , Execution is based on  HTTP  Remote call to ( It means you can go through the firewall ), And use  ja ...

  9. 【Redis】Redis Study ( 6、 ... and ) Redis Basic operation and maintenance

    Redis The single machine construction of , Master slave building ,Sentinal build , as well as Redis Refer to the previous article for the steps of cluster construction . Now let's talk about Redis The basic operation and maintenance of , After all, if everything is OK, it's best , But when something goes wrong and can't be used , Pinpoint the problem ...

  10. sencha touch 2.2 by list PullRefresh Plug in add refreshFn Method

    sencha touch 2.2 list PullRefresh The plug-in doesn't have refreshFn Method But we need him , So you need to expand on your own The code is as follows /** * Rewrite the drop-down refresh plug-in , To support the refreshFn things ...