SQL Populate table with random data

Viewed 75128

I have a table with two fields:

  1. id(UUID) that is primary Key and
  2. description (var255)

I want to insert random data with SQL sentence. I would like that description would be something random.

PS: I am using PostgreSQL.

4 Answers

The following worked for me:

create table t_random as select s, md5(random()::text) from generate_Series(1,5) s;
Related