Write a SQL query to get a list of all buildings and the number of open requests (Requests in which status equals 'Open'). -- TABLE Apartments +-------+------------+------------+ | AptID | UnitNumber | BuildingID | +-------+------------+------------+…
Building #11 is undergoing a major renovation. Implement a query to close all requests from apartments in this building. -- TABLE Apartments +-------+------------+------------+ | AptID | UnitNumber | BuildingID | +-------+------------+------------+ |…
Write a SQL query to get a list of tenants who are renting more than one apartment. -- TABLE Apartments +-------+------------+------------+ | AptID | UnitNumber | BuildingID | +-------+------------+------------+ | 101 | A1 | 11 | | 102 | A2 | 12 | |…
六.(本题10分)  设 $n$ 阶复方阵 $A$ 的特征多项式为 $f(\lambda)$, 复系数多项式 $g(\lambda)$ 满足 $(f(g(\lambda)),g'(\lambda))=1$, 证明: 存在 $n$ 阶复方阵 $B$, 使得 $g(B)=A$. 证明  设 $P$ 为非异阵, 使得 $$P^{-1}AP=J=\mathrm{diag}\{J_{r_1}(\lambda_1),\cdots,J_{r_k}(\lambda_k)\}$$ 为 Jordan 标准型, 我们…
15.7 Imagine a simple database storing information for students' grades. Design what this database might look like and provide a SQL query to return a list of the honor roll students (top 10%), sorted by their grade point average. 在一个简化的数据库中我们有三个表,St…
15.6 Draw an entity-relationship diagram for a database with companies, people, and professionals (people who work for companies). 在公司Companies工作的人是专家Proferssionals,所以人和专家是ISA("is a")的关系,每个专家有例如等级,和工作经验和其他从人Person继承来的属性.一个专家一次只能为一个公司工作,而一个公司可以雇佣…
15.5 What is denormalization? Explain the pros and cons. 逆规范化Denormalization是一种通过添加冗余数据的数据库优化技术,可以帮助我们减少关系数据库中耗时的交Join.在一般的规范化的数据库中,我们将数据存在不同的表中是为了减少冗余数据,所以我们会尝试着每条数据在数据库中只有一份. 比如说,在一个规范化的数据库中,我们有Courses表和Teachers表,每个Courses表的一项都会保存teacherID,但是没有teac…
15.4 What are the different types of joins? Please explain how they differ and why certain types are better in certain situations. Join是用来联合两个表的,每个表至少需要有一列是相同的,不同的Join类型会返回不同的结果.我们来看一个例子,有两个表,普通饮料和无卡饮料如下: -- TABLE RegularBeverages +-----------+------…
/* * UVA_630.cpp * * Created on: 2013年11月4日 * Author: Administrator */ #include <iostream> #include <cstdio> #include <map> #include <string> #include <algorithm> using namespace std; int main(){ int t; scanf("%d",&…
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required. For example,Given [[0, 30],[5, 10],[15, 20]],return 2. 这道题是之前那道Meeting Rooms的拓展,那道题只让我们是…