当前位置:网站首页>【習題五】【數據庫原理】
【習題五】【數據庫原理】
2022-07-03 12:50:00 【愛笑的冷面鬼】
一. 單選題
1.在SQL的SELECT語句中,能實現投影操作的是( )。
A. SELECT
B. FROM
C. WHERE
D. GROUP BY
正確答案: A
2.SQL集數據查詢、數據操縱、數據定義和數據控制功能於一體,語句ALTER TABLE實現下列哪類功能( )。
A. 數據查詢
B. 數據操縱
C. 數據定義
D. 數據控制
正確答案: C
3.下列SQL語句中,( )不是數據操縱語句。
A. INSERT
B. CREATE
C. DELETE
D. UPDATE
正確答案: B
4.SQL中,下列涉及空值的操作,不正確的是( )。
A. AGE IS NULL
B. AGE IS NOT NULL
C. AGE = NULL
D. NOT (AGE IS NULL)
正確答案: C
5.若用如下的SQL語句創建了一個錶S:
CREATE TABLE S
(SNo CHAR (6) NOT NULL,SName CHAR(8) NOT NULL,SEX CHAR(2),AGE INTEGER)
現向S錶插入如下行時,哪一行可以被插入( )?
A. (‘991001’ , ‘李明芳’, 女, ‘23’)
B. (‘990746’, ‘張為’, NULL, NULL)
C. (NULL, ‘陳道一’, ‘男’, 32)
D. (‘992345’, NULL, ‘女’, 25)
正確答案: B
6.假定學生關系是S(SNo,SName,Sex,Age),課程關系是C(CNo,CName,Teacher),學生選課關系是SC(SNo,CNo,Grade)。要查找選修“數據庫”課程的“男”學生姓名,將涉及的關系是( )。
A. S
B. SC,C
C. S,SC
D. S,C,SC
正確答案: D
7.在SQL中,修改數據錶結構應使用的命令是( )。
A. ALTER
B. CREATE
C. CHANGE
D. DELETE
正確答案: A
8.已知學生、課程和成績三個關系如下:學生(學號,姓名,性別,班級)、課程(課程名稱,學時,性質)、成績(課程名稱,學號,分數)。若打印學生成績單,包括學號、姓名、課程名稱和分數,應該對這些關系進行( )操作。
A. 並
B. 交
C. 乘積
D. 連接
正確答案: D
二. 簡答題
1.設教學數據庫school中有如下關系模式,分別用SQL語句完成下列各題。
student(學號,姓名,性別,出生日期,班號)
course(課程號,課程名,任課教師)
score(學號,課程號,分數)
(1)查詢student錶中所有記錄的姓名、性別和班號列。
(2)以課程號昇序,分數降序顯示score錶的所有記錄。
(3)查詢所有學生的姓名、課程號和分數列。
正確答案:
(1)查詢student錶中所有記錄的姓名、性別和班號列。
SELECT 姓名,性別,班號 FROM student
(2)以課程號昇序,分數降序顯示score錶的所有記錄。
SELECT * FROM score ORDER BY 課程號 ASC,分數 DESC
(3)查詢所有學生的姓名、課程號和分數列。
SELECT student.姓名,score.課程號,score.分數 FROM student,score
WHERE student.學號=score.學號
边栏推荐
- Xctf mobile--app3 problem solving
- initial、inherit、unset、revert和all的区别
- Xctf mobile--rememberother problem solving
- Differences between initial, inherit, unset, revert and all
- Flinksql can directly create tables and read MySQL or Kafka data on the client side, but how can it automatically flow and calculate?
- Analysis of a music player Login Protocol
- 剑指Offer09. 用两个栈实现队列
- Using swift language features, write a pseudo-random number generator casually
- Simple use and precautions of kotlin's array array and set list
- Define a list, store n integers, and calculate the length, maximum value, minimum value and average value of the list
猜你喜欢

剑指Offer10- I. 斐波那契数列

Idea packages the web project into a war package and deploys it to the server to run
![[review questions of database principles]](/img/c3/81d192a40bcc4f5d72fcbe76c708bb.png)
[review questions of database principles]

剑指Offer06. 从尾到头打印链表

Public and private account sending prompt information (user microservice -- message microservice)

【数据库原理复习题】

Analysis of a music player Login Protocol

4. Wireless in vivo nano network: electromagnetic propagation model and key points of sensor deployment

The latest version of lottery blind box operation version

The latest version of blind box mall thinkphp+uniapp
随机推荐
Seven second order ladrc-pll structure design of active disturbance rejection controller
【习题六】【数据库原理】
写一个简单的nodejs脚本
Swift Error Handling
Node.js: express + MySQL的使用
Sword finger offer07 Rebuild binary tree
Swift5.7 扩展 some 到泛型参数
剑指Offer04. 二维数组中的查找【中等】
【习题七】【数据库原理】
4. 无线体内纳米网:电磁传播模型和传感器部署要点
The latest version of blind box mall thinkphp+uniapp
初入职场,如何快速脱颖而出?
Differences between initial, inherit, unset, revert and all
并网-低电压穿越与孤岛并存分析
Bert running error: attributeerror: module'tensorflow contrib. tpu' has no attribute 'InputPipelineConfig'
Apache Mina Development Manual
Public and private account sending prompt information (user microservice -- message microservice)
Nodejs+Express+MySQL实现登陆功能(含验证码)
01_ Using the concurrent tool class library, is thread safety safe
【综合题】【数据库原理】