SQL

From Organic Design wiki
Revision as of 21:29, 3 June 2018 by Nad (talk | contribs) (See also)
Broom icon.svg The content of this article requires cleaning up to meet OD's quality standards. Check the wiki best practices for guidelines on improving article and categorisation quality.

SQL (Structured Query Language) is a computer language used to create, retrieve, update and delete data from relational database management systems. SQL has been standardised by both ANSI and ISO.

SQL is commonly spoken either as the names of the letters ess-cue-el, or like the word sequel. The official pronunciation of SQL according to ANSI is ess-cue-el. However, each of the major database products (or projects) containing the letters SQL has its own convention: MySQL is officially and commonly pronounced "My Ess Cue El"; PostgreSQL is expediently pronounced postgres (being the name of the predecessor to PostgreSQL); and Microsoft SQL Server is commonly spoken as Microsoft-sequel-server. See MediaWikiLite for information about SQLite support in MediaWiki, or MSSQL for information about Microsoft SQL Server support. We're now using MariaDB for our SQL server which is a drop-in replacement for MySQL but is fully open source and more efficient too.

Backup & restore

See backup for details about this as it's doesn't outside the SQL environment so doesn't belong in this article. But don't forget to set the default character set to the same as the dump used when you import the data!

To restore only a single database from a full dump use the following:

mysql -D DBNAME -o DBNAME < dump.sql

Fixing crashed tables

To fix a crashed table just use repair TABLENAME from the MySQL command line, or to automatically scan all tables and fix them run the following from the shell.

mysqlcheck --auto-repair DBNAME -u USER -p

Dealing with duplicates on import

See Backup

Documentation

MySQL vs MSSQL

MySQL News & Information

RODBC

Using RODBC to interact with R requires the user to configure the system as described in the file README after installing RODBC.

See

Towards SQL for P2P environments

Database procedures

See also