PostgreSQL SQL

create table todo_user (

user_id varchar(10) not null primary key

, name varchar(20) not null

, password varchar(10) not null

);

create table todo_item (

id int not null primary key

, name varchar(30) not null

, user_id varchar(10) not null

, expire_date date not null

, finished_date date

);


grant all on todo_user to test;

grant all on todo_item to test;


insert into todo_user (user_id, name, password) values(

'test', 'test user', 'test');

insert into todo_item (id,name,user_id,expire_date,finished_date) values(

1,'test todo 01','test','2016/10/01', null);

insert into todo_item (id,name,user_id,expire_date,finished_date) values(

2,'test todo 02','test','2016/10/01', '2016/09/19');