-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassets.sql
More file actions
36 lines (31 loc) · 950 Bytes
/
assets.sql
File metadata and controls
36 lines (31 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
DROP DATABASE IF EXISTS library;
CREATE DATABASE library;
\c library;
CREATE TABLE assets (
ID SERIAL PRIMARY KEY,
media VARCHAR,
type VARCHAR,
title TEXT,
author TEXT[],
source TEXT,
category TEXT[]
);
INSERT INTO assets (media, type, title, author, source, category)
VALUES (
'book',
'tutorial',
'Ruby on Rails Tutorial: Learn Web Development with Rails',
'{"Michael Hartl"}',
'https://www.railstutorial.org/book',
'{"Rails", "Web Development", "Ruby"}'
);
INSERT INTO assets (media, type, title, author, source, category)
VALUES (
'book',
'tutorial',
'Node: Up and Running',
'{"Tom Hughes-Croucher", "Mike Wilson"}',
'http://chimera.labs.oreilly.com/books/1234000001808/index.html',
'{"Node", "NodeJS", "Web Development", "JavaScript"}'
);
--UPDATE assets SET media='video', type='talk', title='Node: Up and FLYING'::text, author='{"Tom Brady", "Mike Jones"}', source='http://google.com'::text WHERE id = 2;