问题 问答题

在学籍管理中,设有4个表,关系模式分别为:

STUDFNT(SNO,SNAME,SEX,BIRTHDAY,CLASS)

TEACHER(TNO ,TNAME, SEX,BIRTHDAY,PROFESSION,DEPARTMENT)

COURSE(CNO,CNAME, TNO)

SCORE(SNO,CNO,DEGREE)

说明:

学生关系模式中:SNO:学号;SNAME:姓名;SEX:性别;BI]RTHDAY:出生日期;CLASS:班级;

教师关系模式中:TNO:教师号;TNAME:姓名;SEX:性别;BIRTHDAY:出生日期;PRO-FESSION:职称;DEPARTMENT:所在系;

课程关系模式中:CNO:课程号;CNAME:课程名;TNO:任课教师号;

成绩关系模式中:SNO:学号;CNO:课程号;DEGREE:分数。

请用SQL查询语句实现下列操作:

1)显示教师所有的单位,即不重复的DEPARTMENT列。

2)显示STUDENT表中“95031”班或性别为“女”的同学记录。

3)以CNO升序,DEGREE降序显示SCORE表的所有记录。

4)显示“95031”班的学生人数。

5)显示SCORE表中至少有5名学生选修的并以3开头的课程号的平均分。

6)显示最低分大于70,最高分小于90的SNO列。

7)显示选修“3 -105”课程的成绩高于“109”号同学成绩的所有同学的记录。

8)显示SCORE表中选学多门课程的同学中分数为非最高分成绩的记录。

9)列出学号为“108”的同学同年出生的所有学生的SNO、SNAME和BIRTHDAY。

10)显示“张三”教师任课的学生成绩。

答案

参考答案:

A)SELECT DISTICT DEPARTMENT FROMTEACHER;

B)SELECT* FROM STUDENT WHERE CLASS=‘IE0CA’OR SEX=‘女’;

C)SELECT* FROM SCORE ORDER BY CNOASC,DEGREE DESC;

D)SELECT COUNT(*) FROM STUDENTWHERE CLASS=‘IE0CA’:

E)SELECT CNO, AVG(DEGREE) FROM SCORE WHERE CNO like‘C%’ GROUP BY CNO HAV-ING COUNT(*)>E;

F)SELECT SNO FROM SCORE GROUP BY SNOMIN(DEGREE>G0 AND MAX(DEGREE)<I0;

G)SELECT X.CNO,X.SNO,X.DEGREE FROMSCORE X,SCORE Y WHERE X.CNO=‘C-A0E’ANDX. CNO=Y.CNO AND Y.SNO=‘A0I’ANDX.DEGREE>Y.DEGREE:

H)SELECT A.SNO,A.DEGREE,A.CNO FROMSCORE A, SCORE B WHERE A.SNO=B.SNO ANDA.DEGREE<B.DEGREE:

I)SEIECT SNO, SNAME,BIRTHDAY FROMSTUDENT WHERE YEAR(BIRTHDAY)=(SELECTYEAR(BIRTHDAY)FROM STUDENT WHERE SNO=“A0H”):

A0)SELECT CNO, SNO, DEGREE FROM SCORE WHERE CNO=(SELECT X.CNO FROM COURSEX, TEACHER Y WHERE X.TNO=Y.TNO ANDY.TNAME=‘张三’)。

解析:

主要考查了SQL的数据查询功能、数据定义功能和数据操纵功能。这类问题主要是考查对SE-LECT FROM WHERE语句的掌握。

完形填空
完形填空。
     Science seems to be getting closer to answering a very old mystery. Homing pigeons can be   1   hundreds
of miles from their homes. When they are let to go to   2   again, they find their way home. Because of this
special ability to  3  , pigeons have been used   4   messengers for hundreds of years.
     Today people even breed homing pigeons for   5   at a sport. The birds are shipped to some chosen   6   a
few hundred miles away. Then all of them are let to go together. The winner is the bird that gets home   7  . A
good race can make it home from 500 miles away   8   a single day.
     The mystery of the homing pigeons is how they   9   directions and how they find home. The first part seems
to be pretty well   10  , and we know of two ways that pigeons tell directions. First, they use the sun.
Experiments show that homing pigeons can tell    11   by the sun. What happens when the   12   is darkly
overcoat by clouds and no one can   13  where the sun is? Then the pigeons still find their way home.
     Naturally, people have wondered whether pigeons might have a built-in compass   14   that would tell them
about the direction of the  15   magnetic(磁的)field. Many different kinds of experiments were   16  . Here's
what the scientists decided   17   they had made experiments many times. When pigeons can see the sun, they
use it as their    18  means of direction-finding. When they can't see the sun, they use some   19  way to sense
direction from the earth's magnetic field.
     But how do pigeons know  20   direction is toward home? What do they use that we would call a map? These are other questions to be answered.
( )1. A. carried       
( )2. A. escape      
( )3. A. find home   
( )4. A. by            
( )5. A. performing    
( )6. A. place         
( )7. A. fast          
( )8. A. on            
( )9. A. tell          
( )10. A. explained  
( )11. A. courses    
( )12. A. sun        
( )13. A. see          
( )14. A. anything   
( )15. A. earth’s     
( )16. A. carried      
( )17. A. before       
( )18. A. important    
( )19. A. quick        
( )20. A. what       
B. taken           
B. get             
B. sense directions
B. as             
B. directing      
B. port           
B. quickly        
B. at             
B. recognize      
B. answered       
B. roads          
B. heaven         
B. find          
B. something      
B. sun’s          
B. done           
B. when           
B. major          
B. strange        
B. where          
C. shipped       
C. fly             
C. send messages
C. for           
C. showing       
C. city          
C. safely        
C. in            
C. realize       
C. shown         
C. directions    
C. land          
C. notice        
C. someone       
C. planet’s     
C. taken          
C. while         
C. main          
C. special       
C. how           
D. brought              
D. run                   
D. make friends     
D. to                
D. racing              
D. country             
D. first              
D. over            
D. know                
D. understood          
D. ways                 
D. sky                
D. observe           
D. anyone               
D. destination’s    
D. had                  
D. after              
D. most               
D. easy                
D. which           
单项选择题