SQL Quick Guide
SQL is standard language for access databases. SQL (Structured Query Language) is use for storing, manipulating and retrieving data from database. There are many relational database management system that use SQL as standard database system. For example: MySQL, SQL Server, MS Access, Oracle, etc.
Tables
A table is composed of records and fields that hold data. All data in one table having relation as the table name. Tables are called datasheets too.
Records
A record is composed of fields. One record is contain different fields that have the same ID. Records are also called row.
Fields
A Field is composed of one data. A Field is the intersection between a row and a column. If you have 2 rows and 2 columns, then you have 4 fields.
Some common syntax of SQL:
SQL Select:
SQL Where:
Tables
A table is composed of records and fields that hold data. All data in one table having relation as the table name. Tables are called datasheets too.
Records
A record is composed of fields. One record is contain different fields that have the same ID. Records are also called row.
Fields
A Field is composed of one data. A Field is the intersection between a row and a column. If you have 2 rows and 2 columns, then you have 4 fields.
Some common syntax of SQL:
SQL Select:
SELECT column_1, column_2, ...column_nSQL Insert:
FROM table_name;
INSERT INTO table_name ( column_1, column_2, ...column_n )SQL Update:
VALUES ( value_1, value_2, ...value_n );
UPDATE table_name SETSQL Delete:
column_1 = value_1, column_2 = value_2, column_n = value_n
WHERE column = value;
DELETE FROM table_name
WHERE column = value;
SQL Where:
WHERE column= value;SQL Order By:
ORDER BY column { ASC | DESC };SQL Create Table:
CREATE TABLE table_name {SQL Drop Table:
column_1 datatype (size),
column_2 datatype (size);
column_n datatype (size);
PRIMARY KEY (one or more columns);
}
DROP table_name;SQL Alter Table:
ALTER TABLE table_name { ADD | MODIFY | DROP } column { datatype };SQL Create Database:
CREATE DATABASE database_name;SQL Drop Database:
DROP DATABASE database_name;