exam1.txt
来自「卡耐基梅隆大学数据库教程ssd7」· 文本 代码 · 共 62 行
TXT
62 行
SSD7 Exam1 答案
这是第一次考试的答案
1.
1). select A
from R;
2). select *
from R
where B=13;
3). select R.A,R.B
from R,S
where R.C = S.D;
2.
1). ename project dept
Kasper Spreadsheet Admin
Mohan Spreadsheet Admin
Lin Forecast Admin
Lin Spreadsheet Admin
2). The operation cannot be performed, because of the different numbers of column in table R and S.
3). Null
4.
1). alter table ORDERS
alter column Received set not null;
2). alter table ORDERS
add constraint CK_ORDERS check (Shipped>Received);
5.
1). select Pno
from PART
where (UnitPrice > 10 and
UnitPrice < 25);
2). select INVOICE.Pno,INVOICE.sum(Qty) as Qty,INVOICE.sum(BilledPrice) as BilledPrice
from INVOICE,ORDERS
where ORDERS.Received like '%98' and ORDERS.Pno=INVOICE.Pno
group by (INVOICE.Pno)
order by sum(BilledPrice) asc;
3). select *
from PART
where Pno in (
select Pno
from INVOICE
where Ono in(
select Ono
from ORDERS
where Received not like '%98'));
6.
alter table EMPLOYEE
add constraint FK_EMPLOYEE_DEPARTMENT foreign key (dname) reference DEPARTEMENT(name) not null;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?