/* testing integrity constraints for users and likes:*/

delete from likes;
delete from users;

drop table if exists movies cascade;
\i /usr0/stu415_s13/etaralova415/loading.sql

insert into users (login_id,email,passwd) values ('anca', 'anca@cmu.edu', 'ancapass');
select count(*) from users;
/*double registration*/
insert into users  (login_id,email,passwd) values ('anca', 'anca@cmu.edu', 'ancapass');
select count(*) from users;
/*duplicate login_id, different email, pass*/
insert into users (login_id,email,passwd)  values ('anca', 'aaaau', 'aaaa');
select count(*) from users;
/*null pass -- errr, ok, may be don't care about this case*/
/*insert into users values ('anca2', 'anca@cmu.edu', NULL);
select count(*) from users;*/
/*this should be allowed:*/
insert into users  (login_id,email,passwd) values ('anca3', 'anca@cmu.edu', 'ancapass');
select count(*) from users;



insert into likes (login_id,mtitle) values ('anca', 'Armageddon');
select count(*) from likes;
/*duplicate like*/
insert into likes (login_id,mtitle) values ('anca', 'Armageddon');
select count(*) from likes;
/*this should be ok:*/
insert into likes (login_id,mtitle) values ('anca', 'TRON');
select count(*) from likes;
/*like a non-existing movie: this should NOT work!!!*/
insert into likes (login_id,mtitle) values ('anca', 'NoSuchMovie');
select count(*) from likes;




