<?xml version="1.0" standalone="no"?>

<!DOCTYPE xmlsql SYSTEM "xmlsql.dtd">

<xmlsql>

<retract construct="table" name="person"/>
<retract construct="table" name="staff"/>
<retract construct="table" name="dept"/>

<update label="create dept">
CREATE TABLE dept 
(  dname VARCHAR(20) NOT NULL,
   CONSTRAINT dept_pk PRIMARY KEY (dname)
)
</update>

<update label="create staff">
CREATE TABLE staff
(  id INTEGER NOT NULL,
   name VARCHAR(20) NOT NULL,
   sex CHAR(1) NOT NULL,
   dname VARCHAR(20) NOT NULL,
   CONSTRAINT staff_pk PRIMARY KEY (id),
   CONSTRAINT staff_worksin_dept_fk FOREIGN KEY (dname) REFERENCES dept
)
</update>


<update>
INSERT INTO dept VALUES ('CS-BBK')
</update>

<update>
INSERT INTO dept VALUES ('Computing-IC')
</update>

<update>
INSERT INTO dept VALUES ('Maths-IC')
</update>

<update>
INSERT INTO staff VALUES (1,'Alex','F','CS-BBK')
</update>

<update>
INSERT INTO staff VALUES (2,'Dimitri','M','CS-BBK')
</update>

<update>
INSERT INTO staff VALUES (3,'Mike','M','Computing-IC')
</update>

<update>
INSERT INTO staff VALUES (4,'Nerissa','F','Computing-IC')
</update>

<update>
INSERT INTO staff VALUES (5,'Peter','M','Computing-IC')
</update>

<update>
INSERT INTO staff VALUES (20,'Nick','M','Maths-IC')
</update>
</xmlsql>
