create table primary_key_1 (
  primary_key           char(20) primary key,
  foreign_key           char(20) not null,
  data_line             char(40)
)\g

insert into primary_key_1 values( 'first_1st', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'first_2nd', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'first_3rd', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'first_4th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'first_5th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'first_6th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'first_8th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'first_9th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'first_10th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'second_1st', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'second_2nd', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'second_3rd', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'second_4th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'second_5th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'second_6th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'second_8th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'second_9th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'second_10th', 'I don\'t know', 'xxxxx' )\g
insert into primary_key_1 values( 'first_11th', 'I don\'t know', 'xxxxx' )\g

select * from primary_key_1\g

delete from primary_key_1 where primary_key = 'second_1st'\g
select * from primary_key_1\g

select * from primary_key_1 where primary_key like '%3rd'\g
delete from primary_key_1 where primary_key like '%3rd'\g
select * from primary_key_1\g

select * from primary_key_1 where primary_key like 'first_%'\g
delete from primary_key_1 where primary_key like 'first_%'\g
select * from primary_key_1\g

update primary_key_1 set primary_key = 'third_1'
  where primary_key like 'second_10th'\g
select * from primary_key_1\g

insert into primary_key_1 values( 'second_10th', 'I don\'t know', 'xxxxx' )\g
select * from primary_key_1\g
delete from primary_key_1 where primary_key like 'second_10th'\g
select * from primary_key_1\g

insert into primary_key_1 values( 'second_10th', 'I don\'t know', 'xxxxx' )\g
select * from primary_key_1\g
delete from primary_key_1 where primary_key = 'second_10th'\g
select * from primary_key_1\g

delete from primary_key_1\g
select * from primary_key_1\g

drop table primary_key_1\g

\q
