⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exam1.txt

📁 卡耐基梅隆大学数据库教程ssd7
💻 TXT
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -