Techy Talky & American Trucking! | Live!

10:36 AM 0 Comments A+ a-

Techy Talky & American Trucking! | Live @6:00PM Central Time!

3:02 PM 0 Comments A+ a-

G27 Truck Shifter Mod | My Tech Vlog

1:46 PM 0 Comments A+ a-

SQL Quick Guide

8:40 PM 0 Comments A+ a-

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:
SELECT column_1, column_2, ...column_n
FROM table_name;
SQL Insert:
INSERT INTO  table_name ( column_1, column_2, ...column_n )
VALUES ( value_1, value_2, ...value_n );
SQL Update:
UPDATE table_name SET
column_1 = value_1, column_2 = value_2, column_n = value_n
WHERE column = value;
SQL Delete:
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 {
column_1 datatype (size),
column_2 datatype (size);
column_n datatype (size);
PRIMARY KEY (one or more columns);
}
SQL Drop Table:
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;