Sqlqueries 1
Sqlqueries 1
Create the following tables set the primary and foreign key references on the table. Insert the
following rows in the table.
Salepeople
Filelds Type and Width Constraints
SNUM Number(4) Primary Key
SNAME Varchar2(10) NOT NULL
CITY Varchar2(10)
COMM Number(4,2)
Customers
Filelds Type and Width Constraints
CNUM Number(4) Primary Key
CNAME Varchar2(10) NOT NULL
CITY Varchar2(10)
RATING Number(3)
SNUM Number(4) FOREIGN KEY
NOT NULL
Orders
Filelds Type and Width Constraints
ONUM Number(4) Primary Key
AMT Number(8,2)
ODATE Date
CNUM Number(4) FOREIGN KEY
SNUM Number(4) FOREIGN KEY
Salespeople
SNUM SNAME CITY COMM
1001 Peel London .12
1002 Serres San Jose .13
1004 Motika London .11
1007 Rifkin Barcelona .15
1003 AxelRod New York .10
1005 Fran London .26
Customers
CNUM CNAME CITY RATING SNUM
2001 Hoffman London 100 1001
2002 Giovanni Rome 200 1003
2003 Liu San Jose 200 1002
2004 Grass Berlin 300 1002
2006 Clemens London 100 1001
Advanced Computing Training School / BC 1 / DAC JAN 99
SQL and SQL Queries / Page No. 1
2008 Cisneros San Jose 300 1007
2007 Pereira Rome 100 1004
Orders
ONUM AMT ODATE CNUM SNUM
3001 18.69 10/03/96 2008 1007
3003 767.19 10/03/96 2001 1001
3002 1900.10 10/03/96 2007 1004
3005 5160.45 10/03/96 2003 1002
3006 1098.16 10/03/96 2008 1007
3009 1713.23 10/04/96 2002 1003
3007 75.75 10/04/96 2002 1003
3008 4723 .00 10/05/96 2006 1001
3010 1309.95 10/06/96 2004 1002
3011 9891.88 10/06/96 2006 1001