Get the App
SLTechnology News&Howtos  ›  Database  › 

How to construct test data with MySQL

Shulou Source: shulou.com Published: 2022-05-31 14:08:44 10月04日 Update

This article introduces how to carry out MySQL construction test data, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Construct test data (Cartesian product, 6 times 1 million)

Create table T1 (id int, val varchar (80))

Set @ I: = 0

Create table tmp as select (@ I: = @ I + 1) as id from information_schema.tables limit 10

Set @ I: = 0

Insert into T1 select @ I: = @ I + 1, substr (concat (sha1 (rand ()), sha1 (rand (), 1, floor (rand () * 80) from tmp a, tmp b, tmp c, tmp d, tmp e, tmp f

On how to carry out MySQL construction test data sharing here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Data tests content more help good interest guys buddies articles knowledge articles Descartes references Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Linux Apple Redmi OPPO Reno