第1个回答 2011-10-18
CREATE DATABASE SM
GO
CREATE TABLE Student
(
id int not null primary key,
stuNum varchar(10) not null,
classNum varchar(10) not null
)
GO
不得不说提问的人真心懒 这么简单的东西还想要到答案复制粘贴
第2个回答 2011-10-21
-- =============================================
-- Create Database SM
-- =============================================
IF EXISTS (SELECT *
FROM master..sysdatabases
WHERE name ='SM')
DROP DATABASE SM
GO
CREATE DATABASE SM
GO
-- =============================================
-- Create table Student
-- =============================================
IF EXISTS(SELECT name
FROM sysobjects
WHERE name ='Student'
AND type = 'U')
DROP TABLE Student
GO
CREATE TABLE Student (
student_id int primary key,
class_id int not null,
student_name varchar(20),
student_age int,
student_sex char(2),
)
GO本回答被网友采纳