List common SQL queries for open source databases?

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;
+5
source share
3 answers

I never see this, but you can get EBNF for ANSI SQL

http://savage.net.au/SQL/

+4

ActiveRecord . commom . SQL. Win .

, . Postgresql : http://www.postgresql.org/docs/9.0/static/sql-commands.html.

Postgresql . .

CREATE TABLE "%s"."%s" (...);
0

, , - O/R, Hibernate. .hbm.xml hbm2ddl= auto . show_sql DML/DDL, ...

, O/R, , . , , DDL, .

, ;)

0

All Articles