SQL Database Beginner Notes

Source: Internet
Author: User
Tags create index ibm db2 one table

Do the web just use SQL and PHP, library borrow carcass, come one night crash

"SQL must know" notes

General syntax, related classification execution Program (DBMS):

Apache Open Office Base

Adobe ColdFusion

IBM DB2

MariaDB

Microsoft Access

Microsoft ASP

Microsoft ASP

Microsoft Query

Microsoft SQL Server

Mysql

Oracle

Oracle Express

Php

PostgreSQL

Sqlite

ODBC Data source

SQL statement syntax (language will be different)

ALTER table to update existing tables

COMMIT transaction writes to the database

Create index creates indexes on more than one column

Create PROCEDURE creating a stored procedure

CREATE table creates a new database table

Create view creates a multiple view

Delete Deletes more than one row

Drop Permanently Delete database objects

INSERT adds a row to the table

Insert Select Inserts a SELECT result into the table

SELECT to retrieve data from more than one table

ROLLBACK Undo a transaction block

Update updates one or more rows

SQL data type

String

CHAR 1~255 a fixed-length string of characters, specified at the time of creation

NCHAR supports multibyte or Unicode characters, special char

Text variable length

NVARCHAR a special form of text that supports multibyte or Unicode characters

numeric data

BIT single bits value, 0 or 1, switch flag

DECIMAL fixed-point or variable-precision floating-point value

float Float Value

int 4 byte integer value, -214783648~214783648

REAL 4-byte floating-point value

SMALLINT 2-byte integer, -32768~32768

TINYINT 1 byte integer value, 0~255

Money is suitable for storing currency values

Date Time

Date datetime value

DateTime Date Time value

smalldatetime accurate to minute

Time value

Binary data types

Binary fixed-length binary (255b~8000b)

Long RAW variable length binary number, up to 2GB

RAW fixed-length binary data up to 255B

VARBINARY variable-length binary data (255B to 8000B)

SQL Database Beginner Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.