SQL Common Statements

Source: Internet
Author: User

Select *  from PersonSelect distinctName from PersonSelect *  fromPersonwhereName='Huangcongcong'Select *  fromPersonwhere  Year>1991Select *  fromPersonOrder  byIDSelect *  fromPerson limit5Select *  fromPerson Name like"%Cong%"Select *  fromPerson Name like"[!HC]%"Select *  fromPersonwhereNameinch('Huangcongcong','huangbingbing')Select *  fromPersonwhereNamebetween 'huangbingbing'  and 'Huangcongcong'SelectName asXingming from PersonSelect *  fromPersonwhereName is NULLSelect *  intoPerson_back from PersonInsert  intoPerson (name, Year)Values('huangbingbing',1992)UpdatePersonSet  Year=1990 whereName='huangbingbing'Delete  fromPersonwhereName='Huangcongcong'Delete *  from PersonDelete  from PersonCreate Databasemy_dbCreate TablePerson (IDint  not NULL Primary Key Check(ID>0) auto_increment, namevarchar( -) not NULL, Addressvarchar( -)default 'Shanghai', Cityvarchar( -),    Foreign Key(ID)References Order(ID))Alter Table PersonAdd Unique(ID)Alter Table PersonDrop IndexIDAlter Table PersonAdd Primary Key(ID)Alter Table PersonDrop Primary KeyAlter Table PersonAdd Foreign Key(ID)References Order(ID)Alter Table PersonDrop Foreign KeyAlter Table PersonAdd Check(ID>0)Alter Table PersonDrop constraint CheckAlter Table PersonAdd constraintChk_personCheck(ID>0)Alter Table PersonDrop constraintChk_personAlter Table PersonAlterCitySet default 'Shenzhen'Alter Table PersonAlterCityDrop defaultCreate IndexPersonindex onPerson nameAlter Table PersonDrop IndexPersonindexAlter Tablepersonauto_increment= -Create ViewPersonviewSelect *  fromPerson

SQL Common Statements

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.