问题 单项选择题

设有关系R=(A,B,C) ,与SQL语句select distinct A from R where B=17等价的关系代数表达式是________。

A.пAB=17()

B.σB=17(пA()

C.σB=17(пA,C()

D.пA,CB=17()

答案

参考答案:A

解析:
[评析] 投影:对R的投影操作,实际上是从R中选择出若干属性列组成新的关系,记做:пA(R)={t[A]|t∈R}, A为R的属性列。
选择:又称为限制,它是关系R中满足给定条件的诸元组,记做:σF(R)={t|t∈R∧F(t)='真'},其中F表示选择条件。
对于选项A,先从关系R中选择B=17的元组,然后输出A列,它与SQL语句等价,而对于选项B,先对R进行投影,形成一个只有属性A的关系,在该关系中无法执行σB=17,运算,它不能与SQL语句等价。

完形填空
完形填空。
      I was driving around downtown (市中心) one afternoon in the winter. I   1   a red light and stopped. As
I was   2  , I saw a young guy standing on my left. He was   3   in the face and holding a cardboard sign with
some   4   on it. When you're in the heart of downtown, it's pretty   5   to see homeless people asking for   6  .
Generally, I would pass them, but this time when I glanced over the sign, I   7  
      I can't remember what the sign said exactly, but it was something like:"  8   money / food, have stomach
cancer, homeless, anything helps."
      I didn't know why, but for some   9   this particular sign struck me. The  10  had just turned green, and
there was a line of lunch rush hour traffic behind me. I went back and forth in my  11  a hundred times in that
next  12  about whether I should do something. "Should I help?  13  on? Should I do something?"
      I didn't. I did nothing.
      The traffic moved  14 , and I went with it. About a block or two away, my heart had sunk simply for this
guy. I felt so  15  for him. So, I decided to go back and ask him  16  I could buy him lunch and hear his story. 
      It took me about five minutes to  17  and back on to the same street where I had seen him. It was just five
minutes-but he was  18 .
      "Where did he go so fast?" I wondered. So, there was  19  left to do except drive on.
      If you get a special nudge (想做的事) from inside you,  20  consider acting on it. Don't miss out-for
yourself and for that other person.
( )1. A. came across
( )2. A. resting    
( )3. A. dirty      
( )4. A. writing    
( )5. A. unfortunate 
( )6. A. equipment  
( )7. A. laughed    
( )8. A. Spare      
( )9. A. reason      
( )10. A. face        
( )11. A. body        
( )12. A. hour        
( )13. A. Drive      
( )14. A. outside     
( )15. A. wonderful    
( )16. A. when        
( )17. A. turn up    
( )18. A. gone        
( )19. A. anything    
( )20. A. seriously   
B. came from  
B. walking    
B. pale        
B. saying      
B. rude        
B. advice      
B. returned    
B. Need        
B. purpose    
B. sign        
B. pocket      
B. second      
B. Work        
B. upward      
B. bad        
B. where      
B. turn around      
B. caught      
B. something  
B. finally    
C. came up with 
C. waiting     
C. happy       
C. feeling     
C. special     
C. money       
C. continued   
C. Keep         
C. goal         
C. light       
C. stomach     
C. day         
C. Come         
C. forward     
C. easy         
C. how         
C. go away     
C. dead         
C. nothing     
C. usually     
D. came up to  
D. talking     
D. proud       
D. painting    
D. common      
D. power       
D. stopped     
D. Collect     
D. condition                     
D. car         
D. head        
D. week        
D. Hold        
D. backward    
D. important   
D. if          
D. go around   
D. blind       
D. everything  
D. jokingly    
单项选择题 A1型题