SQL Base Notebook 2 View Stored Procedure
View
CREATE/ALTER/DROP VIEW ViewName as SELECT(...)
You can continue to create a view based on it, that is, you can place the previously created view as a table name in the select statement of the new view
Format data using views (that is, reassemble and stitch fields)
CREATE VIEW View_player_team AS
SELECT CONCAT(player_name, '(' , t ...
Posted by Izzy1979 on Fri, 26 Jun 2020 09:58:46 -0700
Mysql automatically creates and deletes partition tables
Sometimes we need to save a lot of data, which is time-sensitive, such as some logs. After a period of time, the existence of these data is not significant, and in addition to taking up a lot of hard disk space, it may make data queries slow.This data needs to be cleaned up regularly.We can cope with ...
Posted by timtom3 on Sat, 20 Jun 2020 17:56:03 -0700
How to add fields to mysql large tables without stopping
Adding fields to a table of ten million or more levels in MySQL has always been a headache. In this case, how to deal with it? This paper uses three common scenarios to illustrate the case.
1. Environmental preparation
Database version: 5.7.25-28 (Percona branch)
Server configuration: three centos 7 virtual machines with 2CPU 2G memory
Database ...
Posted by romilbm on Fri, 19 Jun 2020 23:20:57 -0700
Chapter 5 - database integrity
Database integrity: prevent non semantic and incorrect data from entering the database;
Database security: prevent illegal users from intruding into the database and illegally accessing the database data.
5.1 entity integrity PRIMARY KEY
Entity integrity definition: single attribute - column level, tabl ...
Posted by pillarofautumn on Mon, 15 Jun 2020 01:01:57 -0700
Database security and transaction operation
Database security and transaction operation
Article catalog
Database security and transaction operation
1, Purpose and requirements
2, Experiment content
1. Design the security mechanism so that the user Wang Ming can only find the staff of the financial department
2 design a role_Emp ", this ...
Posted by bbbaldie on Sun, 07 Jun 2020 03:19:54 -0700
A simple way to use Mysql cursor
1, Introduction to cursors
1. Introduction to cursors
Cursor is a database query stored on MySQL server. It is not a select statement, but a result set retrieved by the statement. With the cursor, the result set can be processed row by row conveniently. The design of cursors is the idea of data buffer, which is used to store the results of S ...
Posted by Selkirk on Fri, 05 Jun 2020 01:53:14 -0700
Creation and reset of Oracle sequence
The serial number recorded in the table is usually done by the method of sequence. Sometimes it needs to be reset in the creation project, such as in the creation stage, test stage, etc. we can reset the sequence in various ways, delete the reconstruction, sequence reset, etc. The following is an example of a stored pro ...
Posted by jackel15 on Sun, 24 May 2020 08:54:53 -0700
sql server data definition common sql
catalog
Create tableUpdate tableDelete tableQuery table structureCreate view
Create table
Create table TestSql
CREATE TABLE TestSql(
Id bigint identity(1,1) not null PRIMARY key
)
reference material
SQL CREATE TABLE statementSQL PRIMARY KEY constraint
Update table
Create field
Create a normal field
--ALTER TABLE table_name ADD co ...
Posted by snapy on Tue, 12 May 2020 07:29:42 -0700
Stored Procedures for MySQL
Stored procedures are an important feature of database storage. Stored procedures were not supported by MySQL prior to version 5.0. Stored procedures can greatly improve the processing speed of the database and the flexibility of database programming.1. What is a stored procedure?Stored procedures are a collection of SQL statements that are de ...
Posted by sm on Sun, 10 May 2020 10:17:41 -0700
MySQL common management SQL statements
Catalog
Preface
DDL
DCL
DML
1. Management database of DDL statements
1.1. Create database
1.2. Display database
1.3. Switch database
1.4. View the table information contained in the database
1.4.1. Switch to database to view table information
1.4.2. View the table information outside the library
1.5. Delete database
2. Manage users of ...
Posted by lordrt on Mon, 04 May 2020 08:10:07 -0700