syntax for building a table
SQL Server Data type
https://technet.microsoft.com/zh-cn/library/ms187752 (v=sql.110). aspx
Creating data Tables
The datasheet has been built, but no data has been manually entered for several tests.
Back to Script page query
Batch statement:
Go is a flag for batch processing, which means that SQL Server compiles these SQL statements into an execution unit to improve execution efficiency.
It is generally the business requirements and code writers who decide to put some logically related business statements in the same batch.
Go is a batch command for SQL Server that only the code Editor can recognize and process, and editing other applications cannot use the command.
Because each batch is independent, it does not affect the operation of SQL code in other batches when a batch error occurs.
Create a score sheet, student management form, Class table .... Examples of system requirements:
Use studentmanagedb go if exists (SELECT * from sysobjects where name = ' Students ') drop table Students Go-Create student information datasheet CREA Te table Students (studentid int identity (10000,1),--Learning number studentname varchar () NOT NULL,--name Gender char (2) Not NULL,--sex birthday datetime NOT null,--Birth date Studentidno numeric (18,0) NOT null,--ID number age int not null,--year Age PhoneNumber varchar (m), studentaddress varchar (+), ClassId int NOT null-class foreign key) go--Create class table if exists (SE Lect * sysobjects where name= ' studentclass ') drop table studentclass go create table studentclass (classId int Primary key,--class number ClassName varchar () NOT NULL) go--Create a score table if exists (SELECT * from sysobjects where name= ' Scorel ist ') drop table scorelist go create table scorelist (Id int identity (1,1) primary key, StudentID int NOT null,-- The extra key CSharp int NULL, SQL Server int null, updatetime datetime NOT NULL-update time) Go--Create administrator table if exists (select * from sysobjects whereName= ' Admins ') drop table Admins go create table Admins (Loignid int identity (1000,1) primary key, Loignpwd Varcha R () NOT NULL,--login password adminname varchar () NOT NULL) go--Query datasheet SELECT * FROM Students