SQL
zoo.net
CREATE a table with an autonumber / sequence / identity / autoincrement
SQLite
DB2
Ingres
Access
Postgres
Oracle
SQL Server
MySQL
Mimer
Sybase
Sybase
An auto number field can provide a unique identifier where no other is available.
Run the
tidy
code silently
CREATE TABLE t_test( id INTEGER IDENTITY PRIMARY KEY, name VARCHAR(10) ); INSERT INTO t_test(name) VALUES ('Andrew'); INSERT INTO t_test(name) VALUES ('Gordon'); SELECT * FROM t_test;
Specific to Sybase
none
Related links:
CREATE, DROP and ALTER
CREATE a new table
DROP an unwanted table
Composite primary key
CREATE a foreign key
CREATE a VIEW.
Create a table with an autonumber field (also known as sequence, identity)
ALTER TABLE ... ADD COLUMN
ALTER TABLE ... DROP COLUMN
ALTER TABLE ... ADD constraint
CREATE TABLE problems: Invalid column name.
CREATE TABLE problems: Insufficient privileges.
CREATE TABLE problems: Table already exists.
DROP TABLE problems: Foreign key references.
CREATE TABLE problems: Foreign key references.
rename column