I am trying to find information about the correct RDBMS SQL queries for open source databases such as MySQL, PostgreSQL, SQLite and others. Do they have any pre-compiled lists or do I just need to comb the documentation for each database engine (and in some cases guess about the correct implementation? ALTER TABLEVs CREATE INDEX)
For example, so far I have this (incomplete) list for MySQL:
CREATE TABLE `%s` (...);
DROP TABLE IF EXISTS `%s` %s;
ALTER TABLE `%s` RENAME TO `%s`;
ALTER TABLE `%s` ADD COLUMN %s;
ALTER TABLE `%s` DROP COLUMN `%s` %s;
ALTER TABLE `%s` RENAME COLUMN `%s` to `%s`;
ALTER TABLE `%s` ADD CONSTRAINT `%s` FOREIGN KEY (`%s`) REFERENCES `%s` (`%s`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `%s` ADD CONSTRAINT `%s` UNIQUE (`%s`);
ALTER TABLE `%s` DROP CONSTRAINT `%s` %s;
CREATE INDEX `%s` USING BTREE ON `%s` (`%s`);
DROP INDEX IF EXISTS `%s` %s;
source
share