select distinct Ab:
from r
select *c:
from r
where B = 17
select distinct *d:
from r, s
select distinct A, F
from r, s
where C = D
4.5 See the text in the book
Answer:
a:
(select *b:
from r1)
union
(select *
from r2)
select distinct *c:
from r1
where (A, B, C) in (select *
from r2)
select distinct *d:
from r1
where (A, B, C) not in (select *
from r2)
-- This can also be solved by using the except clause in SQL
select distinct r1.A, r2.B, r2.C4.6 See the text in the book
from r1, r2
where r1.B = r2.B
select distinct Ab:
from r
where B = 17
select distinct r.A, r.B, s.Cc:
from r, s
where r.A = s.A
select distinct s.A
from s, r e, r m
where s.A = e.A and s.C = m.A and e.B > m.B
update employees
set salary = salary * 1.20
where salary < 30000;
commit;
a2:
select fname, cpr, salary
from employees
where fname = 'Tina';
a3 and a4: see above.
b2:
insert into agg values ('Lars', 10, 0);
b3: see b1
b4:
update agg
set salary = NULL
where Name = 'Lars';
commit;
b5: see b1 and b3.