当前位置:网站首页>【习题五】【数据库原理】
【习题五】【数据库原理】
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.学号
边栏推荐
- Social community forum app ultra-high appearance UI interface
- Unicode查询的官方网站
- The solution to change the USB flash disk into a space of only 2m
- Integer case study of packaging
- temp
- I'm too lazy to write more than one character
- Exploration of sqoop1.4.4 native incremental import feature
- Swift Error Handling
- Quickly learn member inner classes and local inner classes
- 2020-10_ Development experience set
猜你喜欢
Xctf mobile--rememberother problem solving
initial、inherit、unset、revert和all的区别
社交社区论坛APP超高颜值UI界面
[download attached] password acquisition tool lazagne installation and use
雲計算未來 — 雲原生
The upward and downward transformation of polymorphism
Low code platform international multilingual (I18N) technical solution
1-2 project technology selection and structure
剑指Offer09. 用两个栈实现队列
Display time with message interval of more than 1 minute in wechat applet discussion area
随机推荐
context. Getexternalfilesdir() is compared with the returned path
Swift5.7 extend some to generic parameters
Detailed explanation of the most complete constraintlayout in history
Differences between initial, inherit, unset, revert and all
【综合题】【数据库原理】
Do you feel like you've learned something and forgotten it?
Eureka自我保护
Recovery of website address and method of Amazon account login two-step verification failure caused by mobile phone number becoming empty
LeetCode 0556. Next bigger element III - end of step 4
剑指Offer10- I. 斐波那契数列
Use Tencent cloud IOT platform to connect custom esp8266 IOT devices (realized by Tencent continuous control switch)
With pictures and texts, summarize the basic review of C language in detail, so that all kinds of knowledge points are clear at a glance?
Approve iPad, which wants to use your icloud account
【习题七】【数据库原理】
Lambda表达式
Keep learning swift
Using swift language features, write a pseudo-random number generator casually
How to stand out quickly when you are new to the workplace?
The latest version of blind box mall thinkphp+uniapp
(latest version) WiFi distribution multi format + installation framework