I'm trying to find information about the correct RDBMS SQL queries for open source databases like MySQL, PostgreSQL, SQLite, and others. Are their any pre-assembled lists out there or do I just need to comb the documentation for each database engine (and in some cases guess as to the correct implementation? ALTER TABLE
vs CREATE INDEX
)
For example, so far I have this (partial) 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;
I never see some similar, but you can get EBNF for ANSI SQL
http://savage.net.au/SQL/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With