(These are examples of SQL statements.) (DROP statement) drop table xxxxx; (CREATE statement) create database 'BRUMM' with buffered log; create table employee ( fname varchar(15), minit char(1), lname varchar(20) not null, person_no char(11), dno integer, start_date char(9) not null); create table department ( dname varchar(15) not null, dnumber integer, manager_no char(11), manager_start char(9) not null); create table project ( pname varchar(20) not null, pnumber integer not null, plocation varchar(15), dnum integer ); create table task ( tname varchar(20) not null, tnumber integer not null, tstart_date char(9), tend_date char(9), e_lname varchar(20), deptnum integer); (ALTER statement) alter table task add (pro_num integer); (INSERT 8 rows into table employee) insert into employee values ('Ole','' , 'Brumm', '20082100001', '1','20-Aug-21'); insert into employee values ('Kristoffer','' , 'Robin', '20082000000', '1','20-Aug-20'); insert into employee values ('Nasse','' , 'Nøff', '24122500003', '1','24-Dec-25'); insert into employee values ('Tussi','' , 'Eeyore', '25122100002', '2','25-Dec-21'); insert into employee values ('Peter','' , 'Sprett', '14102600006', '2','14-Oct-26'); insert into employee values ('Kenga','' , 'Mor', '24122500004', '2','24-Dec-25'); insert into employee values ('Lille','' , 'Roo', '24122500005', '2','24-Dec-25'); insert into employee values ('Tiger','' , 'Gutt', '20082800007', '3','20-Aug-28'); (INSERT 11 rows into table task) insert into task values ('find heffalump','1' , '29-Jul-99','29-Jul-99','Nøff','1','13'); insert into task values ('taste honey','1' , '01-Oct-99','01-Oct-99','Brumm','1','14'); insert into task values ('hopp with friends','3' , '01-Oct-99','02-Oct-99','Gutt','3','14'); update task set tnumber='2' where tname='hopp with friends'; insert into task values ('buy hats and ballons','2' , '02-Aug-99','02-Aug-99','Eeyore','2','12'); insert into task values ('bake a cake','3' , '03-Aug-99','03-Aug-99','Sprett','2','12'); insert into task values ('invite guests','1' , '01-Aug-99','01-Aug-99','Robin','1','12'); insert into task values ('welcome guests','4' , '03-Aug-99','03-Aug-99','Mor','2','12'); insert into task values ('find location','1' , '13-Jul-99','14-Jul-99','Nøff','1','11'); insert into task values ('find sticks','2' , '15-Jul-99','16-Jul-99','Nøff','1','11'); insert into task values ('build house','3' , '17-Jul-99','18-Jul-99','Nøff','1','11'); insert into task values ('house viewing','4' , '19-Jul-99','19-Jul-99','Brumm','1','11'); (INSERT 4 rows into table project) insert into project values ('tussis hus','11' ,'tistlete hjørne', '1'); insert into project values ('bursdag fest','12' ,'Robins hus', '2'); insert into project values ('heffalump møter','13' ,'seks furutrærne', '1'); insert into project values ('jakten på frokost','14' ,'treet med biene', '3'); (INSERT 3 rows into table department) insert into department values ('Human Resources','1' ,'20082000000','25-Dec-95'); insert into department values ('Operations','2' ,'14102600006','25-Dec-96'); insert into department values ('Marketing','3' ,'20082800007','25-Dec-97'); (ALTER statement to add a primary key) alter table department add (constraint pk_dnumber primary key(dnumber)); alter table task add (constraint pk_pro_num primary key(tnumber,pro_num)); alter table project add (constraint pk_pnumber primary key(pnumber)); alter table employee add (constraint pk_person_no primary key(person_no)); (Format output) set linesize 130; select * from employee; (OUTPUT) FNAME M LNAME PERSON_NO DNO START_DAT --------------- - -------------------- ----------- ---------- --------- Ole Brumm 20082100001 1 20-Aug-21 Kristoffer Robin 20082000000 1 20-Aug-20 Nasse Nøff 24122500003 1 24-Dec-25 Tussi Eeyore 25122100002 2 25-Dec-21 Peter Sprett 14102600006 2 14-Oct-26 Kenga Mor 24122500004 2 24-Dec-25 Lille Roo 24122500005 2 24-Dec-25 Tiger Gutt 20082800007 3 20-Aug-28 8 rader valgt. select * from project; (OUTPUT) PNAME PNUMBER PLOCATION DNUM -------------------- ---------- --------------- ---------- tussis hus 11 tistlete hjørne 1 bursdag fest 12 Robins hus 2 heffalump møter 13 seks furutrærne 1 jakten på frokost 14 treet med biene 3 select * from department; (OUTPUT) DNAME DNUMBER MANAGER_NO MANAGER_S --------------- ---------- ----------- --------- Human Resources 1 20082000000 25-Dec-95 Operations 2 14102600006 25-Dec-96 Marketing 3 20082800007 25-Dec-97 select * from task; (OUTPUT) TNAME TNUMBER TSTART_DA TEND_DATE E_LNAME DEPTNUM PRO_NUM -------------------- ---------- --------- --------- -------------------- ---------- ---------- find heffalump 1 29-Jul-99 29-Jul-99 Nøff 1 13 buy hats and ballons 2 02-Aug-99 02-Aug-99 Eeyore 2 12 bake a cake 3 03-Aug-99 03-Aug-99 Sprett 2 12 invite guests 1 01-Aug-99 01-Aug-99 Robin 1 12 welcome guests 4 03-Aug-99 03-Aug-99 Mor 2 12 find location 1 13-Jul-99 14-Jul-99 Nøff 1 11 find sticks 2 15-Jul-99 16-Jul-99 Nøff 1 11 build house 3 17-Jul-99 18-Jul-99 Nøff 1 11 house viewing 4 19-Jul-99 19-Jul-99 Brumm 1 11 taste honey 1 01-Oct-99 01-Oct-99 Brumm 1 14 hopp with friends 2 01-Oct-99 02-Oct-99 Gutt 3 14 11 rader valgt.