SpringBoot integrates Flyway to upgrade the database version
1. Why use Flyway
In daily development, the following problems are often encountered:
1. Forget to execute SQL written by yourself in all environments; 2. The SQL written by others cannot be sure whether it has been executed in all environments; 3. Someone has modified the executed SQL and expects to execute it again; 4. It is necessary to a ...
Posted by mtwildcard on Sun, 31 Oct 2021 22:04:50 -0700
Optimization of 20 SQL statements with twice the result with half the effort
Optimization of 20 SQL statements with twice the result with half the effort
1. Use the where condition to limit the data to be queried to avoid returning redundant rows
Suppose the business scenario is to query whether a user is a member
Before optimization:
List<Long> userIds = sqlMap.queryList("select userId from user where isVip=1 ...
Posted by edking1 on Sun, 31 Oct 2021 13:51:16 -0700
Niu Ke SQL question brushing record
summary
on must be used with join
SQL1 finds all the information of the latest employee
select*from employees order by hire_date desc limit 1;
select * from employees
where hire_date = (select max(hire_date) from employees);
ORDER BY sorts the result set according to the specified column. By default, ORDER BY DESC is in ascending ...
Posted by easmith on Sun, 31 Oct 2021 06:13:42 -0700
Database class notes 11 (slow query log)
analysis
● 1. Observe and run for at least one day to see the slow production ● 2. Start the slow query log, set the threshold value, for example, slow SQL is more than 5 seconds, and grab it ● 3.explain + slow SQL analysis ● 4.show profile ● 5. Optimize the parameters of SQL database server (O & M or DBA)
summary
● 1. Enable and capture ...
Posted by sw9 on Sat, 30 Oct 2021 20:30:39 -0700
Operate on records in database tables
1. Add records for SQL tables
grammar
Insert some columns into the table: insert into student (Column name 1,Column name 2,Column name 3...) values (Value 1, value 2, value 3...);
Insert all columns into the table: insert into student values (Value 1, value 2, value 3...);
matters needing attention
1. The type of value is ...
Posted by ahmedkl on Sat, 30 Oct 2021 08:17:00 -0700
MySQL incremental backup and recovery
introduction
Full backup is to back up all data contents. There are a lot of duplicate data in the backup data, and the time of full backup and recovery is very long. The solution to the problem of full backup is to use incremental backup. Incremental backup is to back up the files or contents added or changed since the last backup.
1 ...
Posted by pristanski on Sat, 30 Oct 2021 04:36:06 -0700
mysql database advanced statement - medium
catalogue
1, Regular expression
1. Introduction
2. Common matching types
3. Query mode
2, Operator
1. Arithmetic operator
2. Comparison operator
3. Logical operator (Boolean)
4. Bitwise operator
3, Connection query
1. Inner connection
2. Left connection
3. Right connection
summary
1, Regular expression
1. Introduc ...
Posted by candy2126 on Sat, 30 Oct 2021 02:33:32 -0700
MyBatis framework dynamic Sql
MyBatis framework dynamic Sql
Dynamic SQL: judge the conditions through various tags provided by MyBatis to realize dynamic splicing of SQL statements. The expression used for conditional judgment here is OGNL expression.
The commonly used dynamic SQL tags are,,, and so on.
The dynamic SQL statement of MyBatis is very similar to the stat ...
Posted by Pyro4816 on Sat, 30 Oct 2021 02:13:56 -0700
Database design a circle of friends
The structure of the circle of friends really gives me a headache - how to implement it in a multi-layer architecture and how to write the script; And the ghost virtual machine, kind of learning is not good at self castration. Do it from the beginning, then.
Each image has its own URL: uniform resource location address protocol: / / hostname [ ...
Posted by ginginca on Sat, 30 Oct 2021 00:02:40 -0700
Oracle Database: Installation & function query & condition query
1. Course introduction
first day: 1.Oracle concept and installation 2. Basic query 3. Condition query 4. Functions in Oracle the second day: 1. Multi table query (mysql also has the same concept, different syntax and important aspect) 2. Sub query (it also exists in mysql, with the same concept, different syntax and important aspect) on th ...
Posted by troublemaker on Fri, 29 Oct 2021 17:42:01 -0700