The method of establishing sql server Database and basic Table
This article mainly explains the "sql server database and basic table establishment method", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "sql server database and basic table establishment method"!
I. purpose of the experiment
1. Master the use of SQL SERVER query Analyzer and Enterprise Manager
2. Master the operation of creating database and table
II. Experimental contents and requirements
1. Practice creating a database using SQL statements and Enterprise Manager (Enterprise Manager)
2. Practice using SQL statements and Enterprise Manager to create database tables
III. Main instruments, equipment and materials for the experiment
1. Computer and operating system: PC, Windows 2000/xp
2. Database management system: SQL sever 2005
IV. experimental methods, steps and results test
1 topic 1. Create a database "Student situation":
2 implementation code and screenshot:
3 SQL statement
4. Create database student situation
1 topic 2. Rename the database "student situation" to "student"
2 SQL statement
3 alter database student situation modify name=student
Double-click the code to select all 12 34 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 23 24 25 26 27 29 30 31 33 33 35 36 37 38 topic 3. Create the basic table SQL statement S Table: use Student create table S (Sno char (10) primary key, Sname char (10) not null, Ssex char (2) check (Ssex=' male'or Ssex=' female'), Ssp char (20), Sdept char (20), Sbirth datetime, Sfrom varchar (30), Schg char (10) Spa char (8) default ('League member'), Snation char (8) default ('Han') Table C: use Student create table C (Cno char (10) primary key, Cname char (10) unique, Tname char (8), Cdept char (20), CCredit real check (CCredit > = 0 and CCredit=0 and Grade=0 and CCredit)