问题 多项选择题

数据库中有表Table_priceHistory表,结构如下表所示:

字段 字段名 数据类型 可否为空 单位 备注
ID 商品编号 VARCHAR(8) 不允许 主码
GoodsName 商品名称 VARCHAR(20) 不允许
StartDate 价格生效日期 DATETIME 不允许 主码
EndDate 价格失效日期 DATETIME 不允许 主码,晚于StartDate
SaleUnitPrice 单价 MONEY 不允许
①写出创建Teachers表的SQL语句,要求语句中包含所有的约束。
② 现要查询单价最高的前三种商品的商品编号,商品名称和单价(使用TOP语句)

答案

参考答案:①CREATE TABLE Table_PriceHistory(
ID varchar(H) NOT NULL,
GoodsName varchar(B0) NOT NULL,
StartDate datetime NOT NULL,
EndDate datetime NOT NULL,
SaleUnitPrice Money NOT NULL,
CHECK(EndDate>StartDate),
PRIMARY KEY(ID,StartDate,EndDate))
SELECT TOP C WITH TIES ID, GoodsName,SaleUnitPrice
FROM Table_PriceHistory a JOIN Table_PriceHistory b ON a.ID=b.ID
ORDER BY SaleUnitPrice DESE

阅读理解

阅读理解。

     Lindsay hasn't felt like herself these days. Her friends have noticed it, too. Kia was surprised when Lindsay

refused her invitation to go shopping last Saturday. There was really no reason (理由) not to go, but Lindsay

just didn't feel like it. Instead, she spent most of Saturday sleeping.

     But staying in more than usual isn't the only change in Lindsay. She's always been a really good student,

but over the past few months she's not done so well, and she has trouble putting her heart in her study. She's

even failed some exams, and she hasn't yet handed in her homework.

     When she gets home from practice, she's not hungry for dinner. Though she usually eats a little something

with her family at last, she just doesn't have much of an appetite (胃口) --- and nothing seems to taste as

good as it used to. After dinner, Lindsay goes to her room, does a bit of homework, and goes to bed. She's

not even in the mood (心情) to talk on the phone with her friends.

     When her mother asks her what's wrong, Lindsay feels like crying but doesn't know why. Everything

seems wrong, yet nothing too bad has happened. Lindsay just feels sad all the time and can't get away from it.

Lindsay may not realize it yet, but she is depressed (郁闷的).

1. Kia is most probably _________.

A. one of Lindsay's friends

B. a good doctor

C. a new teacher

D. the writer of the story

2. Lindsay refused to go shopping with Kia because _________.

A. she had already done it

B. she didn't want to do it

C. she had to take an exam

D. she hadn't enough money

3. Lindsay's main change is in _________.

A. life habit (习惯) and study

B. doing practice and going shopping

C. interest and hobby

D. working and learning

4. The reason for Lindsay's not doing so well in study might be that _________.

A. she stayed in more than usual

B. nothing happened to her

C. she didn't talk on the phone

D. she couldn't put her heart in her study

5. What is Lindsay's main trouble?

A. She doesn't feel like eating.

B. She's lost all her friends.

C. She is depressed. 

D. She is always crying.

单项选择题