select * from table_names; select username from dba_users; select distinct owner table_name from dba_tables; select * from emprestimos where nome_f = 'Madureira'; select * from clientes where nome_c = gerente; select correntistas.nome_c, correntistas.cidade_c from clientes, correntistas where clientes.nome_c = correntistas.nome_c and gerente = 'João'; select nome_c from correntistas where rua in (select rua from correntistas where nome_c = 'Pedro') and cidade_c in (select cidade_c from correntistas where nome_c = 'Pedro'); select nome_c from correntistas where rua in (select rua from correntistas where nome_c = 'Pedro') and cidade_c in (select cidade_c from correntistas where nome_c = 'Pedro'); select saldo from depositos where saldo in (select max(saldo) from depositos); select emprestimos.nome_c from emprestimos where emprestimos.nome_f = 'Madureira' union all select depositos.nome_c from depositos where depositos.nome_f = 'Madureira'; select e.nome_c from emprestimos e where e.nome_f = 'Madureira' union all select d.nome_c from depositos d where d.nome_f = 'Madureira'; select depositos.nome_c from depositos where depositos.nome_f = 'Madureira' minus select emprestimos.nome_c from emprestimos where emprestimos.nome_f = 'Madureira'; select correntistas.nome_c, correntistas.cidade_c from correntistas, emprestimos where correntistas.nome_c = emprestimos.nome_c; select nome_f from filiais where cidade_f = 'Rio de Janeiro'; select nome_c, nome_f from depositos where nome_f in ( select nome_f from filiais where cidade_f = 'Rio de Janeiro'); Os dois comando abaixo copiam uma tabela; 1)criação create table contas( NOME_F VARcHAR2(20) , cONTA_# NUMBER(10), NOME_c VARcHAR2(20), SALDO NUMBER(10)); 2)preenchimento insert into contas (select * from depositos); Sugestão Luciana: select df.nome_c, df.nome_f from depositos df where not exists (select * from filiais where cidade_f = 'Rio de Janeiro' and not exists (select * from depositos dd where dd.nome_c = df.nome_c and dd.nome_f = filiais.nome_f)); Soluções Silberchatz: select distinct s.nome_c, s.nome_f from depositos s where (select t.nome_f from depositos t where s.nome_c = t.nome_c) contains (select nome_f from filiais where cidade_f = 'Rio de Janeiro'); 'A solução anterior não funciona select distinct s.nome_c, s.nome_f from depositos s where not exists ((select nome_f from filiais where cidade_f = 'Rio de Janeiro') minus (select t.nome_f from depositos t where s.nome_c = t.nome_c));