联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Database作业Database作业

日期:2018-11-30 10:11

1)Given relation R(A,B,C,D,E)with functional dependencies{AB→C,C→D,D→E}.

a.Show how to determine the candidate key

b.What is the reason that R is not BCNF?

c.Show ALL steps needed to decompose R into BCNF relations,if possible.

2)Many of the No-SQL systems that support large-scale parallel execution guarantee

“eventual consistency”rather than the ACID properties.What does this mean? Explain

briefly how this can produce different results compared to a parallel SQL system that

guarantees the ACID properties.

3)Consider the seschedules involving 3 transactions:

S1:r1(x);r2(y);r1(z);r3(z);r2(x);r1(y)

S2:r1(x);w2(y);r1(z);r3(z);w2(x);r1(y)

S3:r1(x);w2(y);r1(z);r3(z);w1(x);r2(y)

S4:r1(x);r2(y);r1(z);r3(z);w1(x);w2(y)

For each schedule,draw the precedencegraph and decide if the schedule is

conflict-serializable.

4)Given three simple tables with FDsA→ B,B→ C,C→ D

Create tablet 1(ainteger,binteger);

Create tablet 2(binteger,cinteger);

Create tablet 3(cinteger,dinteger);

data is provided in 3 CSV files for importing,or 3 SQL“insert”files

a.create the tables as defined above and import the data (10Krows)using

LOAD DATA(or equivalent).SQL insert statements are provided as an alternative.

Consider these three different but equivalent queries.

--1

select a fromt 1

where mod(a,5)=0 and bin

(select b fromt 2

where cin(SELECT c FROM t3 where mod(d,5)=0));

--2

select t1.a from t1,t2,t 3where

t1.b=t2.b and t2.c=t3.c and mod(t1.a,5)=0 and mod(t3.d,5)=0;

--3

select t1.a from(t1 join t2 on t1.b=t2.b)join t3 on t2.c=t3.c

where mod(t1.a,5)=0 and mod(t3.d,5)=0;

b.Which one of the above select statements has the best execution

Hmwk7,page2

performance? Explain your decision,supported by facts,not just opinion.

5)Consider an internet voting system where a voter must enter a PIN which is checked

to ensure it isvalid and not already used.Two tables are used:PIN(number,if_voted)

and VOTES(can didate,count).Consider anewread-only transaction that outputs the

entire vote tally table.Discuss the issues involved in selecting the appropriate isolation

level to ensure correctly reporting the voting results.

For example:


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp