问题 问答题

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

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

答案

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

完形填空
完形填空 。
     Health is far more important than wealth (财富) and wisdom (智慧). Good health makes us enjoy
our     1     and achieve what we hope for in our future life. But poor health makes us become     2     
interested in everything around us.  How to stay healthy is very important to
everyone,     3     we have lots of good medicine. When we discuss this, we must pay attention to some
rules in mind. 
     Firstly, it is very important for us to     4     more fruit and vegetables because they provide vitamins,
and they can keep us in good health. Secondly, we have to     5     a balanced diet and regular eating
habits.  Proper nutrition (营养) is important for good health.  Don't eat food     6     lots of sugar and fat.
Eat plenty of food high in protein(蛋白质). Thirdly, we'd better do morning exercises every day. Enough
sports can make our bodies strong.     7    , we shouldn't have too much work pressure. Getting too tired
all the time may make us become weak when we meet some sudden accidents, and it can also make us
__8     get sick. Finally, we have to     9     those bad habits that make us unhealthy, such as drinking and
smoking.
     In a word, if we pay attention to the things according to the rules    10     above, we'll lead a healthy
life and become as fit as we wish.
( )1. A. room          
( )2. A. a few        
( )3. A. because      
( )4. A. give          
( )5. A. keep          
( )6. A. of            
( )7. A. Except        
( )8. A. differently  
( )9. A. set up        
( )10. A. broken      
B. book      
B. a little  
B. though    
B. sell      
B. get        
B. in        
B. Besides    
B. impossibly
B. hand out  
B. produced  
C. life      
C. more      
C. but        
C. buy        
C. make      
C. without    
C. And        
C. hard      
C. give up    
C. mentioned  
D. family  
D. less    
D. so      
D. eat      
D. take    
D. with    
D. Even    
D. easily  
D. use up  
D. spoken  
选择题