Database-based primary key and where application

Source: Internet
Author: User

Second, lesson two

CREATE TABLE Teacher

(

TNO int PRIMARY KEY identity (TNO), -- set the primary key (primary key identity )

Tname varchar (50)

)

Go

Insert into Teacher Values (' Zhang San ')

Insert into Teacher Values (' John Doe ')

Insert into Teacher Values (' Harry ')

Go

Select *  from Teacher

Go

Delete from Teacher where tname=' Harry '

--- query

Select * from player where name=' Yorick '

--selset *( All) from table where condition

Select *  from chinastates where parentareacode=37 and root=1

--and and or or >= <=

Use Player

CREATE TABLE Xueshengxinxibiao

(

TNO int PRIMARY KEY identity (primary), -- set the primary key to 1, starting at 1 per increment

name varchar (50),

Sex int,

Age int,

cm decimaL (18,2),

kg decimal (18,2),

Idcard bigint,

addresss varchar (50),

)

Insert into Xueshengxinxibiao Values (' Liu Kai ', 1,23,172,65,372328199206190313,' Zhangdian District, Zibo, Shandong province ') --The primary key word is automatically generated (the identity), not the input

Insert into Xueshengxinxibiao Values (' yorick ', 1,23,172,65,372328199206190313,' Zhangdian District, Zibo, Shandong province ')

Insert into Xueshengxinxibiao Values (' 111 ', 1,23,172,65,372328199206190313,' Zhangdian District, Zibo, Shandong province ')

Insert into Xueshengxinxibiao Values (' 222 ', 1,23,172,65,372328199206190313,' Zhangdian District, Zibo, Shandong province ')

Select * from Xueshengxinxibiao

Update Xueshengxinxibiao Set name=' wu Zhuang guan ' where tno=3 -- put tno=3 change the line to name= ' Five Zhuang Guan '

Database-based primary key and where application

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.