Here is the table
SQL> SQL> drop table offerings; Table dropped.-- from w ww .ja v a2 s. c o m SQL> create table offerings( 2 course VARCHAR2(6) not null, 3 begindate DATE not null, 4 trainer NUMBER(4) , 5 location VARCHAR2(8)) ; SQL> SQL> insert into offerings values ('SQL',date '1999-04-12',7902,'DALLAS' ); SQL> insert into offerings values ('JSON',date '1999-08-10',7004,'CHICAGO'); SQL> insert into offerings values ('SQL',date '1999-10-04',7001,'SEATTLE'); SQL> insert into offerings values ('SQL',date '1999-12-13',7001,'DALLAS' ); SQL> insert into offerings values ('JAVA',date '1999-12-13',7004,'SEATTLE'); SQL> insert into offerings values ('XML',date '2000-02-03',7001,'DALLAS' ); SQL> insert into offerings values ('JAVA',date '2000-02-01',7011,'DALLAS' ); SQL> insert into offerings values ('PLS',date '2000-09-11',7008,'DALLAS' ); SQL> insert into offerings values ('XML',date '2000-09-18',NULL,'SEATTLE'); SQL> insert into offerings values ('JSON',date '2000-09-27',7902,'DALLAS' ); SQL> insert into offerings values ('ERM',date '2001-01-15',NULL, NULL ); SQL> insert into offerings values ('PRO',date '2001-02-19',NULL,'DALLAS' ); SQL> insert into offerings values ('RSD',date '2001-02-24',7008,'CHICAGO'); SQL>
Write SQL to get which courses have been held in Chicago and/or in Seattle?
SQL> SQL> select distinct course 2 from offerings 3 where location in ('CHICAGO','SEATTLE'); COURSE-- www. j a v a2 s .c o m ------ JAVA XML SQL JSON RSD SQL>