关键词不能为空

当前您在: 主页 > 英语 >

数据库系统基础教程第二章答案

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-01-29 04:04
tags:

-faw

2021年1月29日发(作者:物权)


Exercise 2.2.1a



For relation Accounts, the attributes are:




acctNo, type, balance



For relation Customers, the attributes are:




firstName, lastName, idNo, account



Exercise 2.2.1b




For relation Accounts, the tuples are:




(12345, savings, 12000),



(23456, checking, 1000),



(34567, savings, 25)



For relation Customers, the tuples are:




(Robbie, Banks, 901-222, 12345),



(Lena, Hand, 805-333, 12345),



(Lena, Hand, 805-333, 23456)



Exercise 2.2.1c




For relation Accounts and the first tuple, the components are:




123456


?


acctNo



savings


?


type



12000


?


balance



For relation Customers and the first tuple, the components are:




Robbie


?


firstName



Banks


?


lastName



901-222


?


idNo



12345


?


account



Exercise 2.2.1d




For relation Accounts, a relation schema is:




Accounts(acctNo, type, balance)




For relation Customers, a relation schema is:




Customers(firstName, lastName, idNo, account)



Exercise 2.2.1e




An example database schema is:



Accounts (



acctNo,



type,



balance


)


Customers (



firstName,



lastName,



idNo,



account


)



Exercise 2.2.1f




A suitable domain for each attribute:




acctNo


?


Integer



type


?


String



balance


?


Integer



firstName


?


String



lastName


?


String



idNo


?


String (because there is a hyphen we cannot use Integer)



account


?


Integer



Exercise 2.2.1g




Another equivalent way to present the Account relation:



acctNo


balance


type


34567


25


savings


23456


1000


checking


12345


12000


savings








Another equivalent way to present the Customers relation:



idNo


firstName


lastName


account


805-333


Lena


Hand


23456


805-333


Lena


Hand


12345


901-222


Robbie


Banks


12345



Exercise 2.2.2




Examples of attributes that are created for primarily serving as keys in a relation:



Universal Product Code (UPC) used widely in United States and Canada to track products in stores.



Serial Numbers on a wide variety of products to allow the manufacturer to individually track each product.



Vehicle Identification Numbers (VIN), a unique serial number used by the automotive industry to identify vehicles.



Exercise 2.2.3a




We can order the three tuples in any of 3! = 6 ways. Also, the columns can be ordered in any of 3! = 6 ways. Thus, the number of presentations is 6*6 = 36.



Exercise 2.2.3b




We can order the three tuples in any of 5! = 120 ways. Also, the columns can be ordered in any of 4! = 24 ways. Thus, the number of presentations is


120*24 = 2880



Exercise 2.2.3c




We can order the three tuples in any of m! ways. Also, the columns can be ordered in any of n! ways. Thus, the number of presentations is n!m!



Exercise 2.3.1a




CREATE TABLE Product (



maker


CHAR(30),



model


CHAR(10) PRIMARY KEY,



type CHAR(15)


);



Exercise 2.3.1b




CREATE TABLE PC (



model CHAR(30),



speed DECIMAL(4,2),



ram INTEGER,



hd INTEGER,



price DECIMAL(7,2)


);



Exercise 2.3.1c




CREATE TABLE Laptop (



model CHAR(30),



speed DECIMAL(4,2),



ram INTEGER,



hd INTEGER,



screen DECIMAL(3,1),



price DECIMAL(7,2)


);



Exercise 2.3.1d




CREATE TABLE Printer (



model CHAR(30),



color BOOLEAN,



type CHAR (10),



price DECIMAL(7,2)


);



Exercise 2.3.1e




ALTER TABLE Printer DROP color;



Exercise 2.3.1f



ALTER TABLE Laptop ADD od CHAR (10)


DEFAULT ‘none’;




Exercise 2.3.2a




CREATE TABLE Classes (



class CHAR(20),



type CHAR(5),



country CHAR(20),



numGuns INTEGER,



bore DECIMAL(3,1),



displacement INTEGER


);



Exercise 2.3.2b




CREATE TABLE Ships (



name CHAR(30),



class CHAR(20),



launched INTEGER


);



Exercise 2.3.2c




CREATE TABLE Battles (



name CHAR(30),



date DATE


);



Exercise 2.3.2d




CREATE TABLE Outcomes (



ship CHAR(30),



battle CHAR(30),



result CHAR(10)


);



Exercise 2.3.2e




ALTER TABLE Classes DROP bore;



Exercise 2.3.2f




ALTER TABLE Ships ADD yard CHAR(30);



Exercise 2.4.1a






R1 := σ


speed ≥ 3.00


(PC)


R2 :=


π


model


(R1)





model



1005



1006



1013



Exercise 2.4.1b




R1 := σ


hd ≥ 100


(Laptop)


R2 := Product


(R1)


R3 :=


π


maker


(R2)





maker



E



A



B



F



G



Exercise 2.4.1c




R1 := σ


maker=B


(Product


R2 := σ


maker=B


(Product


R3 := σ


maker=B


(Product


R4 := π


model,price


(R1)


R5 := π


model,price


(R2)


R6: = π


model,price


(R3)


R7 := R4


R5



model


1004


1005


1006


2007


R6


PC)


Laptop)


Printer)


price


649


630


1049


1429



Exercise 2.4.1d






R1 := σ


color = true AND type = laser


(Printer)


R2 := π


model


(R1)




model




3003



3007




Exercise 2.4.1e






R1 := σ


type=laptop


(Product)


R2 := σ


type=PC


(Product)


R3 := π


maker


(R1)


R4 :=


π


maker


(R2)


R5 := R3



R4





maker



F



G



Exercise 2.4.1f





R1 := ρ


PC1


(PC)



R2 := ρ


PC2


(PC)



R3 := R1



( = AND <> )


R2



R4 := π


hd


(R3)




hd



250



80



160




Exercise 2.4.1g





R1 := ρ


PC1


(PC)



R2 := ρ


PC2


(PC)



R3 := R1



( = AND = AND < )


R2



R4 := π


,


(R3)







1004


1012




Exercise 2.4.1h





R1 :=

π


model



speed ≥ 2.80


(PC))



π

< p>
model



speed ≥ 2.80


(Laptop))



R2 := π


maker,model


(R1


Product)



R3 := ρ


R3(maker2,model2)


(R2)





Exercise 2.4.1i






R1 := π


model,speed


(PC)



R2 := π


model,speed


(Laptop)




R4 := R2


(maker = maker2 AND model <> model2)


R3


R5 := π


maker


(R4)



maker



B


E


R3 := R1


R2


R4 := ρ


R4(model2,speed2)


(R3)


R5 := π


model,speed


(R3



(speed < speed2 )


R4)


R6 := R3



R5


R7 := π


maker


(R6


Product)


maker


B



Exercise 2.4.1j





R1 := π


maker,speed


(Product


PC)



R2 := ρ


R2(maker2,speed2)


(R1)



R3 := ρ


R3(maker3,speed3)


(R1)



R4 := R1



(maker = maker2 AND speed <> speed2)


R2


R5 := R4



(maker3 = maker AND speed3 <> speed2 AND speed3 <> speed)


R3


R6 := π


maker


(R5)



maker



A



D




E



Exercise 2.4.1k





R1 := π


maker,model


(Product


PC)



R2 := ρ


R2(maker2,model2)


(R1)



R3 := ρ


R3(maker3,model3)


(R1)



R4 := ρ


R4(maker4,model4)


(R1)



R5 := R1



(maker = maker2 AND model <> model2)


R2



R6 := R3



(maker3 = maker AND model3 <> model2 AND model3 <> model)


R5



R7 := R4



(maker4 = maker AND (model4=model OR model4=model2 OR model4=model3))


R6



R8 := π


maker


(R7)




maker




A



B



D



E




Exercise 2.4.2a




π

< br>model


σ


speed≥


3. 00


PC



Exercise 2.4.2b




< br>π


maker


σ


hd ≥


100


Product


Laptop



Exercise 2.4.2c





π


model,price



π


model,price



π


model,price



σ


maker=B


σ


maker=B


σ


maker=B


Printer



Exercise 2.4.2d



Product


Lap top


Product


PC


Produ ct



π


model



σ


color = true AND type = laser


Printer


Exercise 2.4.2e




< br>–


π


maker


π


maker


σ


type=PC


σ


type=laptop


Product

< br>


Exercise 2.4.2f




Product



π


hd



( = AND <> )


ρ


PC2


ρ


PC1


PC



Exercise 2.4.2g




PC



π


,


( = AND = AND < )


ρ


PC2


ρ


PC1


PC


Exercise 2.4.2h




PC



π


maker


(maker = maker2 AND model <> model2)


ρ


R3(maker2,model2)


π


maker,mode l


Product


π


model


π


model


σ


sp eed ≥


2.80


σ


speed ≥


2.80


PC



Exercise 2.4.2i




Laptop



π

maker



Product


π< /p>


model,speed



(speed < speed2 )


ρ


R4(model2,speed2)


π


model,speed


π


model,speed


PC



Exercise 2.4.2j




Laptop


-faw


-faw


-faw


-faw


-faw


-faw


-faw


-faw



本文更新与2021-01-29 04:04,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/583479.html

数据库系统基础教程第二章答案的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文