cteate table student(学生编号 char(8),学生姓名 char(1) , 性别 char(2),年龄 int)
insert student values('01101101','1','男',22)
insert student values('01101101','1','男',22)
解决方案 »
- SQL求助
- 不给力的SQL SERVER啊,停止了一下之后就连接不上了。。。各位大虾帮帮忙啊
- 关于数据库查询效率的问题
- 如何得知存储过程的执行结果
- 【求助】updlock的问题
- 一个简单的问题,成功就马上给分,VB中的ADO如何调用存贮过程的返回值的Recordset.提供完整代码。
- 这样的存储过程能优化吗?
- 怪!!!求高手:SQL Server数据库所在盘如果没空间了,应用程序还正常运转,数据存哪?
- 在SqlServer2000中怎样隐藏数据库中的系统表,只显示数据表?
- 我有好几個表的觸發器有一段內容是相同的﹐可不可以把相同的部分單獨出來。
- 在线急盼指教:在Sqlserver的企业管理器中查询时出现超时的提示,但在查询分析器中查询时就能得到数据,是怎么回事?
- 怎样实现插入很多行!!!!!!!!
create table student(学生编号 char(8),学生姓名 char(1) , 性别 char(2),年龄 int)
insert student values('01101101','1','男',22)
下例显示 pubs 数据库中所创建的三个表(jobs、employee 和 publishers)的完整表定义,其中包含所有的约束定义。/* ************************** jobs table ************************** */
CREATE TABLE jobs
(
job_id smallint
IDENTITY(1,1)
PRIMARY KEY CLUSTERED,
job_desc varchar(50) NOT NULL
DEFAULT 'New Position - title not formalized yet',
min_lvl tinyint NOT NULL
CHECK (min_lvl >= 10),
max_lvl tinyint NOT NULL
CHECK (max_lvl <= 250)
)/* ************************* employee table ************************* */
CREATE TABLE employee
(
emp_id empid
CONSTRAINT PK_emp_id PRIMARY KEY NONCLUSTERED
CONSTRAINT CK_emp_id CHECK (emp_id LIKE
'[A-Z][A-Z][A-Z][1-9][0-9][0-9][0-9][0-9][FM]' or
emp_id LIKE '[A-Z]-[A-Z][1-9][0-9][0-9][0-9][0-9][FM]'),
/* Each employee ID consists of three characters that
represent the employee's initials, followed by a five
digit number ranging from 10000 through 99999 and then the
employee's gender (M or F). A (hyphen) - is acceptable
for the middle initial. */
fname varchar(20) NOT NULL,
minit char(1) NULL,
lname varchar(30) NOT NULL,
job_id smallint NOT NULL
DEFAULT 1
/* Entry job_id for new hires. */
REFERENCES jobs(job_id),
job_lvl tinyint
DEFAULT 10,
/* Entry job_lvl for new hires. */
pub_id char(4) NOT NULL
DEFAULT ('9952')
REFERENCES publishers(pub_id),
/* By default, the Parent Company Publisher is the company
to whom each employee reports. */
hire_date datetime NOT NULL
DEFAULT (getdate())
/* By default, the current system date is entered. */
)/* ***************** publishers table ******************** */
CREATE TABLE publishers
(
pub_id char(4) NOT NULL
CONSTRAINT UPKCL_pubind PRIMARY KEY CLUSTERED
CHECK (pub_id IN ('1389', '0736', '0877', '1622', '1756')
OR pub_id LIKE '99[0-9][0-9]'),
pub_name varchar(40) NULL,
city varchar(20) NULL,
state char(2) NULL,
country varchar(30) NULL
DEFAULT('USA')
)