Constraint is to restrict the fields, so as to ensure the accuracy, effectiveness and integrity of the data.
Multiple constraints are separated directly by spaces
# Create a student table and set constraints for each field
create table student(
id int primary key auto_increment,
name varchar(10) not null unique ...
Added by markts on Mon, 28 Feb 2022 17:07:49 +0200
MySQL UPDATE multi table Association update
1.MySQL can UPDATE data based on multi table query. For the UPDATE operation of multiple tables, you need to be careful. It is recommended to use the SELECT statement to query and verify whether the updated data is consistent with your expectations before updating.
Build two tables, one for prod ...
1. Implementation of spring connection database (JDBC)
Spring has done a lot of encapsulation for JDBC, eliminating redundant code and greatly reducing the development cost. Let's learn about the operation of JDBC in spring through an example.
1) Create data table structure
CREATE TABLE user (
id int(1) NOT NULL auto increment,
name v ...
zset (ordered set) is the most frequently asked data structure in Redis. This ordered set is similar to the set container of C + +, but the underlying structure is different. The underlying structure of C + + is implemented using RB tree (red black tree). Unlike zset, which is implemented using a hop table.
On the one hand, zset ensure ...
Added by svenski on Sun, 27 Feb 2022 07:16:40 +0200
Shared and Column Exclusive LocksIntent LockRecord LockGap lockNext-Key LockInsert Intent LockAUTO-INC lock
This time we will only discuss and experiment with intent locks.
Gap locks are also index records of locks, locking values that do not exist in gaps.
What is gap lock? Gap locks are locks on gaps between index rec ...
Added by ksukat on Sat, 26 Feb 2022 20:12:27 +0200
Chapter 1 JDBC overview
Before that, we learned JavaSE and wrote Java programs. The data is stored in variables, arrays, sets, etc., which cannot be persisted. Later, we learned that IO streams can write data to files, but it is not convenient to manage data and maintain the relationship between data;
Later, we learned the database manage ...
Previous: I'm learning database at station b (8): multi table operation exercise
Function classification Aggregate function, mathematical function, string function, date function, control flow function, window function
1, Aggregate function 1. Introduction Aggregate functions are mainly composed of count, sum, min, Max and AVG. these aggregat ...
Added by dpronk on Sat, 26 Feb 2022 14:11:32 +0200
Supplement 4 When the connection is closed by default, we will submit it automatically,
Each rollback is rolled back to the previous submission
Transfer operation without considering database transactions
When we finished the first transaction, we committed. As a result, an exception occurred, resulting in a direct exit. The subsequent t ...