Skip to content

Instantly share code, notes, and snippets.

@secilreel
Created February 25, 2019 21:21
Show Gist options
  • Save secilreel/0eb73d909449faa0a6d607ea8e292712 to your computer and use it in GitHub Desktop.
Save secilreel/0eb73d909449faa0a6d607ea8e292712 to your computer and use it in GitHub Desktop.
This an SQL script creating a bookmark table in PostgreSQL
-- First, remove the table if it exists
drop table if exists bookmarks;
-- Create the table anew
create table bookmarks (
id INTEGER primary key generated by default as identity,
title text,
url text,
description text,
rating INTEGER
);
-- insert some test data
-- Using a multi-row insert statement here
insert into bookmarks (title, url, description, rating)
values
('Google', 'https://google.com', 'Internet Search Engine', 5),
('Maizel', 'https://amazon.com', 'TV Series about Female Comedians', 5),
('Facebook', 'https://facebook.com', 'Social Media Platform', 5),
('Youtube', 'https://youtube.com', 'Video Content Sharing & Streaming Service', 5),
('Twitch', 'https://twitch.tv.com', 'Video Game Streaming Service', 5),
('Baidu', 'https://baudu.com', 'Chinese Google', 4),
('Wikipedia', 'https://wikipedia.org', 'Online Encyclopedia', 5),
('Yahoo', 'https://yahoo.com', 'Alternative Search Engine', 3),
('W3Schools', 'https://w3schools.com', 'Educational Resource', 5),
('MDN', 'https://developer.mozilla.org', 'Online Web Documentation', 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment