DAT 560G: Database Design and SQL Fall 2024 #3SQL

SpringBoot+Vue+MySQL 高校学科竞赛平台 完整可运行版(源码+文档) 本项目基于SpringBoot+Vue+MySQL构建高校学科竞赛管理平台,覆盖学生、教师、领队教师、管理员四大角色,实现竞赛发布、报名、刷题、评分、公示等全流程闭环管理。系统架构清晰,技术主流,配套完整源码、数据库脚本、万字论文、开题报告、答辩PPT及部署文档,支持一键运行,适用于毕业设计、课程设计及院系二次开发,真正实现“开箱即用”。 阅读详情

Java Python DAT 560G: Database Design and SQL

Fall 2024, Mini A

Assignment #3: SQL Part 2

Instructions

1. This is an individual assignment. You may not discuss your approach to solving these questions with anyone (or Generative AI), other than the instructor or TA.

2. Please include only your Student ID on the submission.

3. The only allowed material is:

a. Class notes

b. Content posted on the LMS

c. Textbook

4. You are not permitted to use other online resources.

5. There will be TA office hours. See the course schedule.

Background

The North American Disasters Database is a comprehensive repository designed to document and analyze various disasters that have occurred across North America. From natural calamities such as hurricanes, earthquakes, and wildfires to human-made incidents like industrial accidents and environmental crises, this database aims to provide a detailed record of significant events that have impacted North America.

Types relation contains the following information about each type of disaster in the database:

• Type of each disaster. This is the primary key.

• Natural indicates whether this type of disaster is natural or caused by people (man-made)

• Mode: what causes this type of disaster

• Size: the typical size of the disaster, in square miles

• Frequency: Every how many years the event can be expected.

Types (Type, Natural, Mode, Size, Frequency)

Places relation describes the cities where disasters may occur. It captures information about the cities and states where disasters occur, including geographic, demographic, and economic data. NOT all cities have disasters. It includes the following attributes.

• City: Name of the city. This is the primary key.

• State: Name of the state.

• Region: Name of the region within the US.

• Size: Geographic size of the city in square miles.

• Population: Number of people living in the city.

• Income: Average income of the residents in the city, in dollars.

• Homeowners: Percentage of houses that are owned by the occupants rather than rented.

• Budget: The city's annual budget.

• FoundingDate: The date when the city was founded.

• ManagerFirstName: The first name of the emergency manager in the city.

• ManagerLastName: The lastname of the emergency manager in the city.

• Gender: Gender of the emergency manager.

• Salary: Annual salary of the emergency manager.

• StartingDate: The date when the emergency manager started their position.

Places (City, State, Region, Size, Population, Income, Homeowners, Budget, FoundingDate,

ManagerFirstName, ManagerLastName, Gender, Salary, StartingDate, Environmental, Quality)

Teams relation records details about the response teams, including their budget, size, and the demographics of their members. There can be more than one response team for a city. If a city has disasters, then it must have at least one team. Some of the cities that do not have disasters may not have any response teams.

• Team: Unique identifier for the response team.

• City: Name of the city where the response team is based. This is a foreign key, to the places relation

• Organization: The organization to which the response team belongs.

• Budget: The annual budget of the response team, in dollars

• FirstDate: The date when the response team was first established.

• Employees: The number of employees in the response team.

• ManagerFirstName: The first name of the manager of the response team.

• ManagerLastName: The lastname of the manager of the response team.

• Gender: Gender of the manager.

• Salary: Annual salary of the manager in dollars.

• Female: Percent of the team that is female.

• Minority: Percent of the team that is minorities.

• ServiceArea: This is the part of the city that this team serves. Can have values of either: All, North, South, East, West.

Teams (Team, City, Organization, Budget, FirstDate, Employees, ManagerFirstName, ManagerLastName, Gender, Salary, Female, Minority, ServiceArea)

TeamSkills relation lists the specific skills possessed by these teams, providing insight into their capabilities. Not all teams need to have skills. Some teams can have several skills. Different teams will have different numbers of skills.

• Team: Unique identifier for the response team. This is a foreign key.

• Skill: Specific skill possessed by the response team. This is part of the multi-attribute key

TeamSkills (Team, Skill)

Disasters relation documents the details of each disaster event, including the type, location, response team involved, and the impact in terms of duration, casualties, property damage, and the number of responders. It includes the following information:

• Type: The type of disaster. Foreign Key that refers to the Type in the CauseTypes table.

• City: Name of the city where the disaster occurred. This is a foreign Key referring to Places.

• Team: Unique identifier for the response team that responded to the disaster. Foreign key referring to Teams relation.

• Name: A unique name or identifier for the disaster. This is part of the multi-attribute key.

• Date: The date when the disaster occurred.

• Year: The year when the disaster occurred.

• Month: The month when the disaster occurred.

• Duration: The duration of the disaster, in hours.

• Casualties: The number of casualties resulting from the disaster.

• PropertyDamage: The estimated property damage caused by the disaster, in US dollars.

• Responders: The number of responders involved in addressing the disaster.

Disasters (Type, City, Team, Name, Date, Duration, Casualties, PropertyDamage, Responders, Year, Month)

Relations

Types (Type, Natural, DAT 560G: Database Design and SQL Fall 2024 Assignment #3SQL Mode, Size, Frequency)

Places (City, State, Region, Size, Population, Income, Homeowners, Budget, FoundingDate,

ManagerFirstName, ManagerLastName, Gender, Salary, StartingDate, Environmental, Quality)

Teams (Team, City,    Organization,   Budget,    FirstDate,   Employees,    ManagerFirstName,

ManagerLastName, Gender, Salary, Female, Minority, ServiceArea)

TeamSkills (Team, Skill)

Disasters (Type, City, Team,  Name, Date,  Duration, Casualties, PropertyDamage, Responders,

Year, Month)

Assignment

Each of these questions is 10 points. Submit answers to these online on Canvas, by 6 am the day of the lab. They are automatically graded.

1)   Find all cities that have more than 2 disasters. List the cities that have the most disasters first down to those who only have the fewest.

2) List all of the skills related to teams that responded to Dam failures after 2010. Please only list the skill once.

3)   In order to compare gender differences in manager salaries, please list the average salary for team managers by gender. Only include teams with average budgets greater than $5 million for teams established after 2010, and not in the state of California. Do not include teams with null values for their team manager’sgender.

4) In order to find an experienced team manager with spills,find all managers who have experience with 2 or more disasters with an oil spill, train spill, or truck spill. Include the manager’sfirst and lastname, team, and the number of disasters the manager has overseen. Sort the list with the most experienced first.

5) List the cities in this database that have NOT been affected by disasters.

6) Find the types of disasters with six or fewer occurrences in this database.

Each of these questions is 5 points. Submit answers to these on Canvas before the next lab session. They will be graded by TAs.

For each question, submit your SQL code and a screenshot of the results. If the results are too long, partial results are fine. Include relevant attributes for each result, to explain that the result is correct. Do NOT include many unnecessary attributes. Do NOT use SELECT *.

7) Find the cities with less than 5 disasters. Include the population, state, region, and number of disasters.

8)   Is there a city that has a population over 900,000 and has had both natural as well as man-made disasters? List it then. In your query results, make sure each row contains a unique city/Natural- type combination. Also list the city name and population.

9) Are there any pairs of teams that have responded to the same type of disaster and the same city? List team pairings only once and include the city name in your results.

10) Find teams with less than 150 employees and more than 70 females. List the team, the number of disasters, and the average number of responders.

11) Find cities with more than two disasters, populations greater than 500,000, and disaster recovery teams led by female managers. List the name of the city only once in your results.

12) Please identify how many disasters happened in each city ofCalifornia that occurred in October or January, had populations LESS THAN 500,000, and casualties above 900. Include the city, number of casualties, the population, and the date of the disaster in your answer.

13) Find the minimum population and the average budget for states with less than five disasters. List the state, number of disasters, minimum population, and average budget—order by state name         

深度解构事务码 SQF:Support Query Framework 与 ABAP 静态分析实战 某制造企业在年度审计前,需要确认自定义发票过账程序 ZFI_INV* 系列是否存在硬编码公司代码与未捕获异常。技术团队在字段填入ZFI_INV*后,勾选与规则,执行扫描。SQF 生成的 ALV 报告列出 42 个警告,其中 17 条与抛出 CX_SY_NO_HANDLER 相关,8 条涉及动态 SQL 注入风险。结果导出至 Excel 供开发整改,并在 ATC 阶段验证修复。此过程较手工逐个执行 Code Inspector 节省超 80 % 时间。 阅读详情

相关推荐

Ubuntu环境下读取罗技G29方向盘信息

Ubuntu环境下读取罗技G29方向盘信息

工大机器人工作室 3486

177.Agent-LangGraph-MCP的构成说明

MCP架构通过MCP主机、客户端与服务器的协同,实现工具、资源与提示词的统一管理。MCP服务器提供Tools、Resources、Prompts能力,MCP客户端则负责发现、调用与读取,使Agent可按需获取上下文。其核心在于将工具从Agent中抽离,封装为可复用的服务,提升灵活性与可维护性,推动AI应用高效协作。

计算机王的博客 315

模拟ic入门——设计一个单极运放(一)单级运算放大器设计基础

主要介绍了单级运放的基本理论和使用场景

qq_64956710的博客 3751

Docker Compose:搭建本地多服务开发环境

从一个 Java API、PostgreSQL 和 Redis 开始,配置服务名、端口、环境变量、健康检查、数据卷和依赖关系。理解 Compose 文件如何被解析、项目如何隔离,以及哪些数据不能依赖“重建容器”保留,能够把个人开发环境整理成团队可复用的启动入口。

m0_62221377的博客 478

从原理图到PCB:Cadence Allegro 17.4网表同步全流程详解(含第三方网表配置)

本文详细解析了Cadence Allegro 17.4中从Orcad原理图到PCB布局的网表同步全流程。核心内容包括标准的第一方网表同步步骤,以及针对第三方网表导入时关键的封装库路径配置方法,并提供了常见同步错误的排查思路,帮助工程师高效、准确地完成设计数据传递,确保PCB设计顺利开局。

salt9的博客 657

apache 403错误 Forbidden解决方法

当网页打开提示以下错误时,即出现了403错误。 Forbidden You don't have permission to access / on this server. 403 Forbidden 资源不可用。服务器理解客户的请求,但拒绝处理它。通常由于服务器上文件或目录的权限设置导致。通常情况可能(但不限于此)的原因有: 原因1:apache配置文件中没有对站点目录的权限许可,这通...

lmseo5hy的博客 1501

AI全栈实战 | 3.9-01 爬虫入门:requests 加 BeautifulSoup 三分钟跑通,但 90% 的人栽在这 4 个“礼貌“问题上

⚠️:本文内容仅用于。请遵守目标站点的服务条款与相关法律法规,不得对目标服务造成负担,不得采集、传播个人隐私数据。技术是中性的,边界在你手里。爬虫的入门技术(requests 发请求 + BeautifulSoup 解析)三分钟就能学会。真正区分"会用爬虫"和"会做爬虫的人"的,是这篇我们跑通"请求→解析→存储"的最小闭环,然后重点把"合规与礼貌"这根弦给你绷上。

源码获取 | 运行部署 | 定制二开修改,如果回复不及时请耐心等待,请见谅。 442

GIS常用符号化色带(超级色带)根据python制作

GIS自带的色带比较单一,今天分享一款色带,应用之后大家出图的时候可以选择更多的配色,符号化/点击色块/样式引用/将样式添加至列表即可。色带类型比较多,大家可以自己尝试下不同的风格。简单符号化一下,看看效果。以中国县级行政区划为例,

J_Giser的博客 2640

spring boot 4集成SQLLite,及其SQLLite的建库

spring boot 4集成SQLLite,及其SQLLite的建库

weixin_41463944的博客 237

把 SAP GUI 做成可维护的应用:Module Pool 基础与 Table Control 深入实战

SAP Module Pool 与 Table Control 开发要点 摘要:Module Pool 作为 SAP GUI 交互的核心技术,由程序、屏幕(Dynpro)和流逻辑(Flow Logic)组成,通过 PBO/PAI 事件驱动数据流。Table Control 是其中处理多行数据的核心控件,其开发关键在于: 正确理解 PBO/PAI 数据流机制 掌握 CXTAB_CONTROL 结构的关键属性(LINES、TOP_LINE 等) 合理设置列控制属性(CXTAB_COLUMN) 采用 LOOP W

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 247

[Dify实战] 在 Dify 官网环境使用 File Translator 插件实现 Office 文档翻译(支持 DOCX/XLSX/PPTX)

摘要:Dify平台的FileTranslator插件可实现Office文档一键翻译,保留原格式和结构。该插件支持Word、Excel、PPT等文件格式,无需额外密钥,直接复用Dify配置的大模型。安装后,用户可在Workflow中调用插件,设置目标语言等参数完成翻译。输出文件自动命名,保留原格式。适用于跨国协作、海外营销等场景,显著提升多语言办公效率。该插件简化了文档翻译流程,是企业用户和开发者的实用工具。

技术小甜甜:传播可落地技术,帮助个人和企业降低解决真实场景问题的成本 544

【基于 WebSocket 的多用户网页五子棋】—— 数据管理模块

但行好事,莫问前程

qq_42996461的博客 260

Python 爬虫教程:抓取视频平台数据(观看量、评论数、点赞数等)

爬虫(Crawler)是通过编写程序模拟浏览器行为,从互联网上抓取并提取信息的技术。爬虫的核心任务是模拟用户访问网页,获取网页内容并解析出我们需要的数据。爬虫技术被广泛应用于搜索引擎、数据分析、电商价格监控、内容抓取等领域。Bilibili和YouTube。这两个平台都提供丰富的用户生成内容(UGC),且在中国和全球范围内都非常流行。Bilibili:以二次元文化为主的视频平台,用户活跃,视频内容丰富。Bilibili的网页数据较为简单,可以通过传统的HTML解析抓取。YouTube。

2201_76125261的博客 1856

OpenClaw 深度调查:把 AI 助手做成你自己的控制平面

对 openclaw/openclaw 的完整技术尽调:Gateway 架构、Agent 运行时、工具与沙箱、30 个消息通道、181 个插件、安全信任边界、工程代价与采用建议。17 章 / 10 张图,全部数字标注口径,数据截至 2026-10-31。

厚积薄发 349

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

IDEA 简介:从零认识 IntelliJ IDEA

IDEA 全称,是由 JetBrains 公司开发的一款主流 Java 集成开发环境(IDE)。它集代码编辑、编译、调试、测试、版本控制、构建管理等功能于一体,被大量 Java 开发者视为日常开发的首选工具。所谓 IDE(Integrated Development Environment,集成开发环境),就是把写代码所需的各类工具整合到同一个界面中。相比只用文本编辑器加命令行编译,IDE 能显著减少重复操作,让开发者把精力集中在业务逻辑上。

ztI10的博客 185

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

TransactionInactiveError:await 之后事务已经不活跃了

TransactionInactiveError 出现于 IndexedDB 事务已结束(非 active 状态)时调用 put、get 等操作。常见于 await 后或 setTimeout 中执行请求,因任务已完成,事务已提交或进入 finished 状态。请求必须在创建事务的同一任务中挂起,否则无效。解决方法:在 onsuccess 回调内同步发起后续操作,或提前将所有请求挂入事务。避免在异步上下文中使用事务操作,确保请求在事务活跃期内完成。

qq_40822000的博客 159

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

Docker部署linkding:HTTPS与数据备份

部署私人书签库,除了让页面能够打开,还需要考虑几个实际问题:重建容器后数据是否保留、登录和保存是否正常、升级前怎样备份,以及出现 502 或 CSRF 错误时从哪里检查。本文使用 Docker Compose 部署 linkding,采用默认 SQLite 数据库,通过 Caddy 提供 HTTPS,并完成账户创建、数据持久化验证和备份。如果重建后账户或书签消失,应先检查是否换了项目目录、改了挂载路径,或者启动了另一套实例,不要急着重新初始化。遇到权限问题,应根据日志确认具体目录和运行用户,再调整权限。

tedcloud123的博客 194

云计算课程小组PPT汇报任务书

36人分为6组,每组6人;形式:生活案例调研 + 理论解读;汇报时长7‑9min;PPT建议10‑14页。

Michelle8023的博客 227

企业官网源码与数据资产交接:四项权利、五组自动检查

企业官网源码交接不仅要看压缩包,还要核域名、云资源、构建脚本、数据库恢复、权限与密钥。

sweetofmine1的博客 187

软件项目交付时,源代码之外还应该交付哪些技术资料?

软件项目交付时,除可运行程序外,还应核对源代码、数据库结构、接口文档、部署运维、测试验收和账号资产。本文从实际交付环节拆解完整资料清单,并说明合同如何约定交付范围、知识产权与维护边界。

chengduyoushu的博客 308

Java 项目实战:交友项目后台系统——网关统一鉴权与 B 端管理后台

本次改造通过引入SpringCloud Gateway实现网关统一鉴权与路由,新建mf-admin管理端复用C端域服务(Dubbo调用),实现管理员登录与用户管理四件查询。核心套路:网关白名单+双体系JWT(同工具不同payload)、管理端零直连业务库、分页形态区分(MySQL自动count/Mongo手动count)、浏览器端独立聚合。踩坑12条,附自检清单与后续改造方向,可复用于多角色后台系统。

Wang的专栏 70

大表 ALTER TABLE 怎么做?NineData OnlineDDL 配置与执行实践

介绍NineData OnlineDDL大表变更实践,涵盖执行策略、切表控制、拷贝批次与可视化进度追踪。

dbasenewbie的博客 295

Axum 初步入门学习笔记

)自定义错误实现后,可以直接作为Result的ErrAxum 是一个构建在 Tokio、Tower、Hyper 之上的 Rust Web 框架,核心能力是:Router 路由、Extractor 提取器、Tower 中间件、IntoResponse 响应机制、State 共享状态。那张分层架构图是“地图”不是“说明书”:它帮你建立全局观,但 Service、Repository、数据库、Redis、MQ 都是你自己在 Handler 内部调用的业务/基础设施层,不是 Axum 自带的。

weixin_43219667的博客 206

MySQL报Too many open files?句柄耗尽的排查与参数配置

文章讲清 max_connections 与 open_files_limit 两个额度、句柄被谁占走、分区表为什么最容易踩,给出从 error log 到 /proc/pid/limits 的定位顺序与句柄预算算法。

「一个在数据库赛道上边学边分享的学妹」——聚焦国产数据库/信创方向、分享学习笔记、踩坑经验和行业观察。 338

SQL Server 数据库双备份:简化配置,兼顾本地留存与异机归档

本文针对中小企业SQLServer数据库备份难题,提出简化配置与本地+异机双副本方案。传统原生备份依赖手动脚本,存在配置复杂、传输易中断、日志分散、静默失败等问题。推荐使用图形化工具实现备份、本地留存与异机同步一体化管理,支持断点续传、加密传输、自动清理与版本控制,降低运维负担。双副本策略提升数据安全性,本地快速恢复,异地防硬件故障。建议定期验证恢复流程,确保备份可用性。

2501_93776716的博客 313

Redis 入门详解:核心特性、重要文件与全局命令实战

本文系统介绍了Redis的核心特性、重要文件及全局命令。Redis凭借内存存储、C语言实现和单线程设计,具备极高的读写性能;支持持久化(RDB/AOF)、主从复制与集群架构,适用于缓存、排行榜、计数器等场景,但不适合存储海量冷数据。文中还解析了常见面试题,如为何快速、单线程原理、持久化机制、KEYS *禁用原因及过期键处理策略,强调其在高并发场景下的优势与局限。

2303_77004089的博客 208
上一篇: ECON1002 Introductory Macroeconomics Semester 2 2024Matlab
下一篇: CCT109H5F LEC0101 Contemporary Communication Technologies Fall 2024Java
wx___codinghelp
博客等级 码龄2年 807粉丝 101原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值