xiaohong知识库 xiaohong知识库
首页
嵌入式
前端
后端
考试
旅行
归档
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
首页
嵌入式
前端
后端
考试
旅行
归档
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 软考

    • 计算机系统

    • 程序设计语言

    • 数据结构

    • 数据库

      • 数据库一阶段学习
        • 1、考试介绍
        • 2、结构数据模型
          • 2.1、层次模型
          • 2.2、网状模型
          • 2.3、关系模型
          • 2.4、例题
        • 3、数据库的三级模式结构
        • 4、两级映像
          • 4.1、例题
        • 5、关系模型种的基本术语
        • 6、关系模型的定义
        • 7、关系完整性约束
        • 8、笛卡尔积
        • 9、传统的集合运算
        • 10、选择、投影、连接
        • 11、自然连接
        • 12、外连接
          • 13、例题
        • 13、投影、选择转sql
        • 14、笛卡尔积转sql语言
        • 15、自然连接转sql
        • 16、例题:
        • 17、数据定义语言
        • 18、where条件查询
        • 19、排序查询
        • 20、使用聚合函数
        • 21、数据分组
        • 22、表的连接查询
        • 23、外连接
        • 24、子查询
        • 25、相关子查询
          • Exists
        • 26、查询结果的并交差
        • !image-20241019191958914
        • 27、例题
        • SQL访问控制(授权)
          • 1、赋予权限
          • 2、收回权限
        • 28、例题:
        • 29、视图的创建和删除
        • 30、例题
      • 数据库二阶段学习
  • 英语

  • 可关注考试内容
  • 考试
  • 软考
  • 数据库
2024-09-09
目录

数据库一阶段学习

# 1、考试介绍

数据库的考点一般在51~56题

# 2、结构数据模型

# 2.1、层次模型

# 2.2、网状模型

# 2.3、关系模型

关系模型式一种二维表格结构来实现实体以及实体之间联系的数据模型。

# 2.4、例题

image-20241015151314512

# 3、数据库的三级模式结构

三级模式

image-20241015151542380

  • 外模式(视图)
  • 模式(基本表)
  • 内模式(数据库存储文件)

image-20241015151832810

image-20241015151906418

# 4、两级映像

image-20241015152017516

  • 数据的物理独立性:概念模式和内模式之间的映像
  • 数据的逻辑独立性:外模式和概念模式之间的映像

# 4.1、例题

image-20241015152538542

image-20241015152627549

# 5、关系模型种的基本术语

下图的关系模式为S(Sno,Sname,SD,Sage,Sex)

image-20241015152955536

image-20241015153108831

image-20241015155148192

# 6、关系模型的定义

  • 关系模型中数据的逻辑关系式一张二维表
  • 关系模型操作又:选中、投影、链接、除、并、交、差等查询操作和增加、删除操作等

# 7、关系完整性约束

image-20241015164808259

# 8、笛卡尔积

image-20241016224229822

# 9、传统的集合运算

image-20241016224339790

image-20241016224459193

# 10、选择、投影、连接

image-20241016225500988

image-20241016230117413

这个两个,自己去看视频

# 11、自然连接

image-20241016231001405

# 12、外连接

image-20241016231712628

# 13、例题

image-20241016232227949

image-20241016232618160

image-20241016232820672

image-20241016233140342

image-20241016233629646

image-20241016233925869

image-20241016234310343

image-20241016234604147

image-20241016235108652

image-20241016235344598

image-20241016235355968

# 13、投影、选择转sql

image-20241017225920495

image-20241017225938548

# 14、笛卡尔积转sql语言

image-20241017230048217

image-20241017230435953

# 15、自然连接转sql

image-20241017230604258

# 16、例题:

image-20241017231338422

image-20241017231910332

image-20241017232039205

image-20241017232152460

# 17、数据定义语言

image-20241017232324599、

# 18、where条件查询

image-20241019154544828

select * from studentTabel where score between 30 and 90;

select * from studentTable where name like "罗%"

select * from studentTable where name like "罗__"

select * from studentTable where name not like "罗"

select * from studentTable where score in (90,91,92)

select * from studentTable where score not in (90,91,92)

select * from studentTable where name ="王芳" and sex = "女"

select * from student where name is not Null

# 19、排序查询

默认为升序

降序

select * from student where 性别='男' order by 班号 desc

升序

select * from student where 性别='男' order by 班号 asc

多个排序条件

select * from student where 性别='男' order by 班号 asc , 分数 asc

# 20、使用聚合函数

image-20241019154941868

image-20241019155000233

先将课程号去重,然后在进行一个统计

image-20241019155052909

# 21、数据分组

image-20241019155451297

image-20241019160421866

image-20241019160252692

image-20241019160410463

image-20241019160459530

# 22、表的连接查询

select * from student inner join score on student.'学号' = score.'学号'

select student.姓名,score.课程号,socre.分数 from student ,score where student.'学号' = score.'学号'

image-20241019161723922

image-20241019190848154

# 23、外连接

image-20241019191053071

image-20241019191109785

image-20241019191205945

# 24、子查询

image-20241019191251982

image-20241019191323256

# 25、相关子查询

image-20241019191726223

# Exists

image-20241019191842828

# 26、查询结果的并交差

image-20241019191947583

# image-20241019191958914

# 27、例题

image-20241019193351196

image-20241019193555575

image-20241019193826071

image-20241019194049991

image-20241019194335985

image-20241019194326502


image-20241019195112318

image-20241019195127400

# SQL访问控制(授权)

image-20241019195552003

image-20241019195830435

# 1、赋予权限

image-20241019195603668

image-20241019195643114

image-20241019195700314

# 2、收回权限

image-20241019195742557

image-20241019195815639

image-20241019195839853

# 28、例题:

image-20241019195941865

image-20241019200007412

image-20241019200203539

# 29、视图的创建和删除

image-20241019200249731

image-20241019200436754

image-20241019200615277

image-20241019201017035

# 30、例题

image-20241019201247229

image-20241019201344157

编辑 (opens new window)
#软件中级设计师
上次更新: 2025/05/13, 8:05:00
大O表示法
数据库二阶段学习

← 大O表示法 数据库二阶段学习→

Theme by Vdoing | Copyright © 2024-2025 工诚云网
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式