SQL Server simple statement/backlog

Source: Internet
Author: User

Database objects: Tables table, views view, stored procedure stored Procedure, trigger trigger

Relationship: 1 relationship = 12 dimension table, 1 relationship has 1 relationship name. 1 Relationship =1 Table object

Attribute/field: Vertical column metadata group/record in a two-dimensional table: horizontal row in a two-dimensional table

Code/Keyword: a property (candidate code) in a two-dimensional table with a value that uniquely identifies a 1-tuple the attribute is a candidate code. If the 1 relationship has a number of candidates, then select the main code/Master attribute

Relational schema: Describes the relationship, which includes the relationship name, the attribute name that makes up the relationship, and the image of the attribute to the domain. = Relationship Name (property name 1, property name 2,..., property name N)

Select name, sex, entrancescore from student where entrancescore between and 600

"Out of the table only these three columns are divided into 500-600 rooms"

Create DATABASE Databse_name

Drop Database Databse_name

ALTER TABLE tabname add col1 int plus int type col1 column

ALTER TABLE TabName add primary key (col1) plus primary key

ALTER TABLE Tb_text add PRIMARY key (column 1) plus column 1 primary key (prerequisite notnull)

CREATE TABLE tabname (col1 int not null PRIMARY key) primary key Col table tabname

SELECT * into tbnew from tboldname old table build new table (primary key to be set)

SELECT * into Tbnew from Tboldname where 1=2 is built as old table type

ALTER TABLE table1 ALTER column col varchar change field col type

ALTER TABLE table1 Drop column col Delete field

ALTER TABLE table1 add col char (200) plus field

Select Top Ten * from M2box_structure1 Top 10

Select top * FROM table1 order by NEWID () random fetch 10

Select COUNT (*) as students total from student "count the total number of students and name the" total number of students "field

Select AVG (entrancescore) as average score from student

Select Max (entrancescore) as admission best results from student

SQL Server simple statement/backlog

Related Article

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.