Last active
January 15, 2021 11:35
-
-
Save simonthompson99/e7ee52dd05c0efef7c2accd7222732e8 to your computer and use it in GitHub Desktop.
[Random data query] Generate random data query #sql #database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- generates 5000000 rows of random data | |
| select i | |
| ,now() - (random() * (interval '100 years')) | |
| ,(array['1', '2'])[floor(random() * 2 + 1)] | |
| from pg_catalog.generate_series(100000001, 105000000, 1) s(i) | |
| ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment