Getting Started with databases

Source: Internet
Author: User
Tags one table

Database

Some data files that are stored on your hard disk

is organized according to the data structure. Warehouses for storing and managing data

Memory only temporarily stores some data

The common database has

IBM's DB2 orcle Sybase informix Sol Server

. NET--sql Server

PHP--mysql

Jave--oreacl

data types in SQL database

int number

Decimal (5,2) 5 indicates that a decimal length of 2 means a few digits behind the decimal point

Bit-Boolean type 1-true 0-false

DateTime-Time Date type

nvarchar (length) Max string (max)
varchar (length)

Text-long text

relational database

There are 4 kinds of constraints

PRIMARY KEY constraint;

There is no limit to the data type of the primary key column, but this column must be unique and not empty.

FOREIGN KEY constraints;

Create a constraint between two tables

One of the columns of the current table is constrained by one of the primary key columns/unique columns of the other table
The contents of the column in which the current table is constrained are not allowed to exceed the contents of the column that constrains it

The only constraint;

Unique constraint setting a column unique cannot have a repetition can have an empty;

Cheak constraints;

Constrain the expression range of a value write an expression that is not the same as C # && is and | | IS OR

Set Primary key primary key is preceded by a key

Create a simple table with the mouse

A FOREIGN KEY constraint constrains another table with one table;;

Getting Started with databases

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.