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

[ORACLE] common metadata query statements related to materialized view

When querying the status of materialized view and other information, monitoring and management, it is necessary to query the system view. The following lists the commonly used query statements for materialized view status, dependency Association, and batch maintenance, which can be modified according to the specific sit ...

Posted by kabucek1 on Sun, 03 May 2020 19:34:27 -0700

How to insert test data in MySQL

There are two methods for inserting MySQL test data: Select the priority (generate test data in combination with PHP > use stored procedures). Use stored procedures (it is recommended to use this method when the test data is less than 1000) The specific code is as follows: To create a table: 1 mysql> create table TB1( 2 -> id in ...

Posted by myraleen on Sun, 03 May 2020 12:39:21 -0700

Stored procedure of Oracle full replication table structure

Recently, when dealing with a table splitting problem, we need to create a stored procedure for the program to automatically split tables. We need to ensure that all table structures, constraints, indexes, etc. are consistent. In addition, views, stored procedures, permissions, etc. are not considered temporarily. In Mysql, the procedure of cre ...

Posted by DJH on Thu, 30 Apr 2020 21:46:48 -0700

On the trigger of mysql stored procedure

What is a stored procedure? That is, you can write logical sql, such as judgment, loop, etc,, What are the benefits? Imagine that we want to insert 100 pieces of data. Compared with batch operation, it is sure that the efficiency of the stored procedure is high In addition, the running speed of stored procedures is v ...

Posted by davidsakh on Wed, 15 Apr 2020 09:29:39 -0700

How much does MySQL count know

Statistics of the amount of data in a table is a common requirement, but different table designs and different writing methods can lead to large differences in statistical performance. Here is a simple experiment to test (everyone should pay attention to the cache when testing, otherwise the test results will be affected). 1. Preparations In or ...

Posted by rwfresh on Sun, 05 Apr 2020 14:41:25 -0700

Oracle database inserts data in table B into table A in batches

Business description: table A is the detailed statement of table B. now it is required that table B has millions of records. Insert the relevant records of table B in table A. Preparation: oracle database, database tool pl\sql, stored procedures written in the package. Implementation ideas: 3.1 get the total data volu ...

Posted by name1090 on Sat, 04 Apr 2020 13:06:07 -0700