数据库系统基础教程第二章答案 下载本文

内容发布更新时间 : 2024/5/5 10:08:46星期一 下面是文章的全部内容请认真阅读。

Exercise TABLE PC ( );

model CHAR(30), speed DECIMAL(4,2), ram INTEGER, hd INTEGER,

price DECIMAL(7,2)

Exercise TABLE Laptop ( );

model CHAR(30), speed DECIMAL(4,2), ram INTEGER, hd INTEGER,

screen DECIMAL(3,1), price DECIMAL(7,2)

Exercise TABLE Printer (

model CHAR(30), color BOOLEAN,

type CHAR (10), price DECIMAL(7,2)

);

Exercise TABLE Printer DROP color;

Exercise TABLE Laptop ADD od CHAR (10)

Exercise TABLE Classes ( class CHAR(20), type CHAR(5), country CHAR(20), numGuns INTEGER, bore DECIMAL(3,1), displacement INTEGER

);

Exercise TABLE Ships ( name CHAR(30), class CHAR(20),

launched INTEGER

DEFAULT ‘none’;

);

Exercise TABLE Battles ( );

name CHAR(30), date DATE

Exercise TABLE Outcomes ( );

ship CHAR(30), battle CHAR(30), result CHAR(10)

Exercise TABLE Classes DROP bore;

Exercise TABLE Ships ADD yard CHAR(30);

Exercise

R1 := σspeed ≥ (PC) R2 := πmodel(R1)

model

1005 1006 1013 Exercise R1 := σhd ≥ 100 (Laptop)

R2 := Product (R1) R3 := πmaker (R2)

maker E A B R4 := πmodel,price (R1)

F G R5 := πmodel,price (R2) R6: = πmodel,price (R3) R7 := R4 R5 R6

Exercise R1 := σmaker=B (Product PC)

R2 := σmaker=B (Product Laptop) R3 := σmaker=B (Product Printer)

model 1004 1005 price 649 630 1006 2007

1049 1429 Exercise

R1 := σcolor = true AND type = laser (Printer) R2 := πmodel (R1)

model Exercise

3003 3007

R1 := σtype=laptop (Product) R2 := σtype=PC(Product) R3 := πmaker(R1)

R4 := πmaker(R2) R5 := R3 – R4

maker Exercise R1 := ρPC1(PC)

F

G

R2 := ρPC2(PC)

R3 := R1 = AND <> R2

R4 := πhd(R3)