Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgresql fill fake data

WITH salary_list AS (
    SELECT '{1000, 2000, 5000}'::INT[] salary
)
INSERT INTO public.employee
(id, name, salary)
SELECT n, 'Employee ' || n as name, salary[1 + mod(n, array_length(salary, 1))]
FROM salary_list, generate_series(1, 1000000) as n
Comment

postgresql fill fake data

insert into towns (
    code, article, name, department
)
select
    left(md5(i::text), 10),
    md5(random()::text),
    md5(random()::text),
    left(md5(random()::text), 4)
from generate_series(1, 1000000) s(i)
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql update set sum 
Sql :: Syntax of for-loop in SQL Server 
Sql :: show all public tables postgres 
Sql :: oracle ORA-00054 origin 
Sql :: list foreign data tables postgres psql 
Sql :: oracle user privileges 
Sql :: grant mysql 
Sql :: oracle grant select on schema 
Sql :: oracle add datafile to tablespace 
Sql :: create function in microsoft sql server 
Sql :: check database status oracle 
Sql :: org.h2.jdbc.jdbcsqlsyntaxerrorexception table not found 
Sql :: mysql parse int 
Sql :: real world example of nosql 
Sql :: oracle sessions_per_user limit 
Sql :: how to remove default in mysql 
Sql :: ajouter une clé etrangere mysql 
Sql :: foreign key sqlite3 python 
Sql :: sql get month name 
Sql :: mysql update table from another table 
Sql :: list all columns in a table sql 
Sql :: Suse Linux restart MySQL 
Sql :: table or view does not exist 
Sql :: postgres type cast to string 
Sql :: mysql query first character 
Sql :: postgresql to_char time 
Sql :: How to Find Duplicate Values in a SQL Table 
Sql :: CONCAT_WS() concat function we can use for adds two or more expressions together with a separator or delimeter. 
Sql :: mysql select tables with name like 
Sql :: sql trim whitespace 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =