Skip to content

Instantly share code, notes, and snippets.

@rbannal86
Created November 4, 2019 19:59
Show Gist options
  • Save rbannal86/f6c24dbcb4fea6371664c915e6f2a01b to your computer and use it in GitHub Desktop.
Save rbannal86/f6c24dbcb4fea6371664c915e6f2a01b to your computer and use it in GitHub Desktop.
Bookmarks Database SQL
drop table if exists bookmarks;
create table bookmarks (
id INTEGER primary key generated by default as identity,
name text NOT NULL,
url text NOT NULL,
description text,
rating INTEGER NOT NULL,
CHECK(rating > 0 AND rating < 6)
);
insert into bookmarks (name, url, description, rating)
values
('reddit', 'www.reddit.com', 'a whole bunch of stuff', 5),
('chewy', 'www.chewy.com', 'a site for animals', 4),
('bing', 'www.bing.com', 'like google', 2),
('google', 'www.google.com', '', 5),
('yahoo', 'www.yahoo.com', 'big mistake', 1),
('ask jeeves', 'www.ask.com', 'does this still exist?', 5),
('white house', 'www.whitehouse.gov', 'white house website', 1),
('next door', 'www.nextdoor.com', 'my neighbors are stupid', 2),
('yelp', 'www.yelp.com', 'garbage for garbage people', 1),
('opentable', 'www.opentable.com', '', 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment