Eine Einführung in
|
| SQLite | ||
If you have access to the SQL code which created the table the primary key can be seen easily. The primary key may be specified in one of two ways:
CREATE TABLE cia (name PRIMARY KEY, population INTEGER)or, where the primary key is composite:
CREATE TABLE casting(movieid INTEGER,
actorid INTEGER,
PRIMARY KEY (movieid, actorid)
)
If this is not possible then implementation specific commands may work. | ||
| Specific to SQLite | ||
| none | ||
| DB2 | ||
If you have access to the SQL code which created the table the primary key can be seen easily. The primary key may be specified in one of two ways:
CREATE TABLE cia (name PRIMARY KEY, population INTEGER)or, where the primary key is composite:
CREATE TABLE casting(movieid INTEGER,
actorid INTEGER,
PRIMARY KEY (movieid, actorid)
)
If this is not possible then implementation specific commands may work. | ||
| Specific to DB2 | ||
| none | ||
| MS Access | ||
If you have access to the SQL code which created the table the primary key can be seen easily. The primary key may be specified in one of two ways:
CREATE TABLE cia (name PRIMARY KEY, population INTEGER)or, where the primary key is composite:
CREATE TABLE casting(movieid INTEGER,
actorid INTEGER,
PRIMARY KEY (movieid, actorid)
)
If this is not possible then implementation specific commands may work. | ||
| Specific to MS Access | ||
| none | ||
| PostgreSQL | ||
If you have access to the SQL code which created the table the primary key can be seen easily. The primary key may be specified in one of two ways:
CREATE TABLE cia (name PRIMARY KEY, population INTEGER)or, where the primary key is composite:
CREATE TABLE casting(movieid INTEGER,
actorid INTEGER,
PRIMARY KEY (movieid, actorid)
)
If this is not possible then implementation specific commands may work. | ||
| Specific to PostgreSQL | ||
| The array returned indicates which fields contribute to the primary key. {1,2} means that the first and second field of casting contribute to the primary key. | ||
| Oracle | ||
If you have access to the SQL code which created the table the primary key can be seen easily. The primary key may be specified in one of two ways:
CREATE TABLE cia (name PRIMARY KEY, population INTEGER)or, where the primary key is composite:
CREATE TABLE casting(movieid INTEGER,
actorid INTEGER,
PRIMARY KEY (movieid, actorid)
)
If this is not possible then implementation specific commands may work. | ||
| Specific to Oracle | ||
| We can use the system tables: all_constraints and all_cons_columns. For a primary key the constraint_type is 'P'. We also need the all_cons_columns view to find the actual columns. | ||
| MS SQL Server | ||
If you have access to the SQL code which created the table the primary key can be seen easily. The primary key may be specified in one of two ways:
CREATE TABLE cia (name PRIMARY KEY, population INTEGER)or, where the primary key is composite:
CREATE TABLE casting(movieid INTEGER,
actorid INTEGER,
PRIMARY KEY (movieid, actorid)
)
If this is not possible then implementation specific commands may work. | ||
| Specific to MS SQL Server | ||
| none | ||
| MySQL | ||
If you have access to the SQL code which created the table the primary key can be seen easily. The primary key may be specified in one of two ways:
CREATE TABLE cia (name PRIMARY KEY, population INTEGER)or, where the primary key is composite:
CREATE TABLE casting(movieid INTEGER,
actorid INTEGER,
PRIMARY KEY (movieid, actorid)
)
If this is not possible then implementation specific commands may work. | ||
| Specific to MySQL | ||
| none | ||
| Sybase | ||
If you have access to the SQL code which created the table the primary key can be seen easily. The primary key may be specified in one of two ways:
CREATE TABLE cia (name PRIMARY KEY, population INTEGER)or, where the primary key is composite:
CREATE TABLE casting(movieid INTEGER,
actorid INTEGER,
PRIMARY KEY (movieid, actorid)
)
If this is not possible then implementation specific commands may work. | ||
| Specific to Sybase | ||
| none | ||
| Mimer SQL | ||
If you have access to the SQL code which created the table the primary key can be seen easily. The primary key may be specified in one of two ways:
CREATE TABLE cia (name PRIMARY KEY, population INTEGER)or, where the primary key is composite:
CREATE TABLE casting(movieid INTEGER,
actorid INTEGER,
PRIMARY KEY (movieid, actorid)
)
If this is not possible then implementation specific commands may work. | ||
| Specific to Mimer SQL | ||
| none | ||