top | item 45660719

(no title)

kevinqi | 4 months ago

my only minor critique is using lorem ipsum examples. It tends to make me want to gloss over instead of reading; I prefer seeing realistic data. other than that, it's a really cool post

discuss

order

kragen|4 months ago

You may be interested in http://canonical.org/~kragen/sw/dev3/exampledb.py -sql -n 2 example.sql:

    begin;
    insert into cust (id, name, company, streetaddress, city, state, zip) values (1, 'Jacqueline Gagnon', 'Baker Group', '218 Miller Dr.', 'Riverside', 'KS', '51859');
    commit;
    begin;
    insert into cust (id, name, company, streetaddress, city, state, zip) values (2, 'Wayne Bennett', 'FF Petroleum LLC', '4375 Moore Dr.', 'Mount Vernon', 'MS', '98270');
    select setval('cust_id_seq', 2);
    commit;
    begin;
    insert into product (id, name, unitprice) values (1, 'Biological blue steel doll', 30.4);
    commit;
    begin;
    insert into product (id, name, unitprice) values (2, 'Gray cotton electronic boxers, size L', 13.3);
    insert into product (id, name, unitprice) values (3, 'Blue cotton intimate blazer, ages 2–5', 37.3);
    insert into product (id, name, unitprice) values (4, 'Daily beige steel car', 14.6);
    insert into product (id, name, unitprice) values (5, 'Black spandex daily blazer, size L', 24.1);
    insert into product (id, name, unitprice) values (6, 'Blue wool dynamic briefs, ages 3–10', 79.0);
    insert into product (id, name, unitprice) values (7, 'Blue spandex ultrasonic dress, child’s size', 31.9);
    insert into product (id, name, unitprice) values (8, 'Gold wool daily boxers, ages 3–10', 8.85);
    insert into product (id, name, unitprice) values (9, 'Red cotton utility boxers, ages 2–5', 28.9);
    insert into product (id, name, unitprice) values (10, 'Gray polyester ultrasonic briefs, ages 3–10', 15.3);
    -- ...
It also creates the tables, including invoice and lineitem tables. It's still a bit of a dull accounting example, rather than something like food, superheroes, social networks, zoo animals, sports, or dating, but I think the randomness does add a little bit of humor.

Although now we have LLMs, and maybe they'd do a better job.

WD-42|4 months ago

Was going to post the same thing. Lorem Ipsum makes the data too hard to distinguish. I get that due to the dynamic nature of the examples the text needed to be generated, but Latin isn't the best choice IMO.

Otherwise great article, thank you!

doublerabbit|4 months ago

It's the same for me when foo and bar are used as examples.