SQL Server Statement command

Source: Internet
Author: User

Create database db001;


--Create a table

Create Table Job (

ID char (TEN) not null,name char (100) is not null,address Char

);


--Delete Table

drop table jobtable2;


--Inserting values

Use db0001

Go

Insert into job values (' 1 ', ' 2 ', ' 3 ');

INSERT into job values (' 2 ', ' 2 ', ' 2 ');


--Inserting values

Use db001

INSERT into job values (' 2 ', ' 2 ', ' 2 ');

INSERT into job values (' 10001 ', ' zhangsan ', ' sex ');


--Create a table

CREATE TABLE CJTB (id char), name char (30), sex char

);


--Inserting values

INSERT into CJTB values (' 10002 ', ' zhangsan ', ' sex ')

INSERT into CJTB values (' 10003 ', ' zhangsan ', ' sex ')

INSERT into CJTB values (' 10004 ', ' zhangsan ', ' sex ');

Insert into CJTB (id,name,sex) VALUES (' 10005 ', ' Lisi ', ' sex ');


--Modifying values

UPDATE CJTB SET name = ' Wangmazi ' WHERE id = ' 6 ';


--Enquiry Form

SELECT * from CJTB;


--Create a view

CREATE VIEW V_customer

As SELECT ID, name, sex

From CJTB;


This article is from the "technical Daniel help you take care of" blog, please be sure to keep this source http://zhaoshilei.blog.51cto.com/6455149/1925101

SQL Server Statement command

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.