当前位置:网站首页>【习题五】【数据库原理】
【习题五】【数据库原理】
2022-07-03 12:03: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.学号
边栏推荐
- 【ManageEngine】IP地址扫描的作用
- 【数据库原理复习题】
- elastic_ L02_ install
- The foreground uses RSA asymmetric security to encrypt user information
- CNN MNIST handwriting recognition
- It feels great to know you learned something, isn‘t it?
- Display time with message interval of more than 1 minute in wechat applet discussion area
- 4. 无线体内纳米网:电磁传播模型和传感器部署要点
- Do you feel like you've learned something and forgotten it?
- 基于同步坐标变换的谐波电流检测
猜你喜欢

Differences between initial, inherit, unset, revert and all

LeetCode 0556. Next bigger element III - end of step 4

Self made pop-up input box, input text, and click to complete the event.

云计算未来 — 云原生
![Sword finger offer04 Search in two-dimensional array [medium]](/img/c4/002c951f8d914aaea4f4133685ebd1.png)
Sword finger offer04 Search in two-dimensional array [medium]

Idea packages the web project into a war package and deploys it to the server to run

Social community forum app ultra-high appearance UI interface

电压环对 PFC 系统性能影响分析

剑指Offer04. 二维数组中的查找【中等】

ncnn神经网络计算框架在香橙派OrangePi 3 LTS开发板中的使用介绍
随机推荐
Applet wxss introduction
Sword finger offer04 Search in two-dimensional array [medium]
Kubectl_ Command experience set
【计网】第三章 数据链路层(2)流量控制与可靠传输、停止等待协议、后退N帧协议(GBN)、选择重传协议(SR)
(最新版) Wifi分销多开版+安装框架
剑指Offer07. 重建二叉树
GCN thinking - word2vec directly calculates text classification
【ArcGIS自定义脚本工具】矢量文件生成扩大矩形面要素
RedHat5 安装Socket5代理服务器
Dix règles de travail
How to stand out quickly when you are new to the workplace?
Recovery of website address and method of Amazon account login two-step verification failure caused by mobile phone number becoming empty
Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!
2020-09_ Shell Programming Notes
(latest version) WiFi distribution multi format + installation framework
temp
Enter the length of three sides of the triangle through the user, and calculate the area of the triangle, where the length is a real number
Unicode查询的官方网站
Swift Error Handling
TOGAF认证自学宝典V2.0