当前位置:网站首页>【习题五】【数据库原理】
【习题五】【数据库原理】
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.学号
边栏推荐
- Recovery of website address and method of Amazon account login two-step verification failure caused by mobile phone number becoming empty
- 剑指Offer03. 数组中重复的数字【简单】
- TOGAF认证自学宝典V2.0
- Glide question you cannot start a load for a destroyed activity
- 【数据库原理复习题】
- Analysis of a music player Login Protocol
- Export the entire Oracle Database
- Kotlin notes - popular knowledge points asterisk (*)
- The best shortcut is no shortcut
- 剑指Offer10- I. 斐波那契数列
猜你喜欢

Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!

【数据库原理复习题】

Integer case study of packaging

Drop down refresh conflicts with recyclerview sliding (swiperefreshlayout conflicts with recyclerview sliding)

2021 autumn Information Security Experiment 1 (password and hiding technology)

initial、inherit、unset、revert和all的区别

(latest version) WiFi distribution multi format + installation framework

How to convert a decimal number to binary in swift

低代码平台国际化多语言(i18n)技术方案

Xctf mobile--app3 problem solving
随机推荐
Implement verification code verification
Recovery of website address and method of Amazon account login two-step verification failure caused by mobile phone number becoming empty
[embedded] - Introduction to four memory areas
Social community forum app ultra-high appearance UI interface
Applet wxss introduction
雲計算未來 — 雲原生
context. Getexternalfilesdir() is compared with the returned path
Express abstract classes and methods
Approve iPad, which wants to use your icloud account
强大的头像制作神器微信小程序
Bert running error: attributeerror: module'tensorflow contrib. tpu' has no attribute 'InputPipelineConfig'
剑指Offer05. 替换空格
The latest version of blind box mall thinkphp+uniapp
十條職場規則
How to stand out quickly when you are new to the workplace?
Everything comes to him who waits
Swift return type is a function of function
Ali & ant self developed IDE
Sword finger offer09 Implementing queues with two stacks
Official website of Unicode query