· 6 years ago · Apr 18, 2019, 10:44 AM
1drop table if exists bookmarks;
2
3create table bookmarks (
4 id INTEGER primary key generated by default as identity,
5 title text not null,
6 url text not null,
7 description text,
8 rating INTEGER
9);
10
11alter table bookmarks
12 add constraint rating_range
13 check (rating > 0 and rating < 6);
14
15insert into bookmarks (title, url, description, rating)
16values
17 ('google', 'google.com', 'test', 4),
18 ('google1', 'google.com', 'test', 4),
19 ('google2', 'google.com', 'test', 4),
20 ('google3', 'google.com', 'test', 4),
21 ('google4', 'google.com', 'test', 4),
22 ('google5', 'google.com', 'test', 4),
23 ('google6', 'google.com', 'test', 4),
24 ('google7', 'google.com', 'test', 4),
25 ('google8', 'google.com', 'test', 4),
26 ('google9', 'google.com', 'test', 4);