DEV Community

Frits Hoogland for YugabyteDB

Posted on

Create sample YugabyteDB table with data

I keep finding myself looking around for a quick and convenient way to to create a table populated with data.
(the datasets are described as being free to use for testing)

Download 100,000 rows dataset.

curl -L https://github.com/datablist/sample-csv-files/raw/main/files/people/people-100000.zip > people-100000.zip
unzip people-100000.zip
Enter fullscreen mode Exit fullscreen mode

Download 1,000,000 rows dataset.

curl -L https://github.com/datablist/sample-csv-files/raw/main/files/people/people-1000000.zip > people-1000000.zip
unzip people-1000000.zip
Enter fullscreen mode Exit fullscreen mode

Create table and import data into YCQL (Cassandra compatible)

create keyspace sample;
use sample;
create table sample_data
(
index int primary key,
user_id text,
first_name text,
last_name text,
sex text,
email text,
phone text,
date_of_birth text,
job_title text
);
--copy sample_data from 'people-100000.csv' with header=true;
copy sample_data from 'people-1000000.csv' with header=true;
Enter fullscreen mode Exit fullscreen mode

Create table and import data into YSQL (PostgreSQL compatible)

create table sample_data
(
index int primary key,
user_id text,
first_name text,
last_name text,
sex text,
email text,
phone text,
date_of_birth text,
job_title text
);
--\copy sample_data from 'people-100000.csv' csv header;
\copy sample_data from 'people-1000000.csv' csv header;
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay