A Gentle Introduction to
SQL
GISQ: How To: CREATE and DROP
Please "Tidy up" after you have finished.
CREATE a new table
DROP an unwanted table
Composite primary key, foreign key and index
CREATE a VIEW.
CREATE a new table
CREATE TABLE t_test (a INTEGER PRIMARY KEY ,b VARCHAR(10) )
oracle
access
mysql
DROP an unwanted table
DROP TABLE t_test
oracle
access
mysql
Composite primary key, foreign key and index
We must explicitly specify that the components of the key are non NULL
CREATE TABLE t_test (a INTEGER NOT NULL ,b VARCHAR(10) NOT NULL ,c REAL ,d VARCHAR(50) ,FOREIGN KEY(d) REFERENCES cia(name) ,PRIMARY KEY (a,b) ,INDEX (a,c) )
oracle
access
mysql
CREATE a VIEW.
A view is a named SELECT statement.
MySQL does not support views.
Planned implementation
CREATE VIEW v_europe AS SELECT name, population FROM cia WHERE region='Europe'
oracle
access
mysql