CS2855 Assessed

CS2855 Assessed Coursework 2
This assignment must be submitted via the anonymous submission script
Due date: Tue 3 Dec 2019 at 14:00
Learning outcomes assessed
This assignment covers basic SQL queries and definition, as well as functional
dependencies (FDs, for short), normalisation of relational databases
and (lossless-join) decomposition of tables.
The assessed learning outcomes are implementing a relational model in
SQL and developing queries of different complexity, and understanding of
the basic notions and applications of table normalisation.
Instructions
You must submit two files:
1. For the SQL part (Part 1), you must submit a text file named
“queries.sql” that contains the SQL queries in order. Comment
lines can be added to the file as lines beginning with the double
dash (“- -”) symbol.
2. For the normalisation part (Part 2), submit a PDF file, with a clearly
written solution. Solutions that are presented in an unclear format
(i.e., not a PDF), low-resolution pictures, or haphazard handwriting
will not be marked (since we will not be able to asses their correctness).
代写CS2855留学生作业、代做SQL程序语言作业
NOTE: All the work you submit should be solely your own work. Coursework
submissions are routinely checked for this.
1
Assignment
Part 1: SQL
Consider the following relational model that represents part of an online
shop’s database:
product(prod id, product name, product price, product manufacturer)
customer(cust id, customer name, customer address)
rating(prod id, cust id, rating date, rating stars)
Foreign Key: prod id references prod id in product table
Foreign Key: cust id references cust id in customer table
sale(sale id, prod id, cust id, sale quantity, sale cost)
Foreign Key: prod id references prod id in product table
Foreign Key: cust id references cust id in customer table
These schemas represent product information, including sales. Customers
can provide ratings for products in a 0 to 5 stars fashion. It is
possible for clients to rate the same product more than once.
1. Give an SQL definition of this database, including the referentialintegrity
constraints that should hold (such as foreign keys), taking
care for attributes that should not be null.
2. Define queries in SQL to obtain the following information:
(a) The names of all products manufactured by ‘Samsung’, in ascending
ordered by price.
(b) The names of all products that had at least one rating of 3 or
more stars. No duplicate names should be returned.
(c) For all products, their name, average star rating, and most recent
rating date. The results should be in descending order of average
star rating.
(d) For all cases in which the same customer rated the same product
more than once, and in some point in time gave it a lower rating
2
than before, return the customer name, the name of the product,
and the lowest star rating that was given.
Part 2: Normalisation
Question 3. Let F be the following collection of functional dependencies
for relation schema R = (A, B, C, D, E):
(i) Compute three non-trivial new FDs in the closure F + of F (i.e., FDs
that are not already in F and also are not trivial). Describe briefly how
you computed these new FDs (namely, how you applied Armstrong’s
axioms, step by step, to computed them).
(ii) Provide at least one candidate key for R, and briefly explain how
you obtained it (namely, explain briefly why it is indeed a candidate
key).
Question 4. Let ebay prod vendor=(prod id, price, model num, vendor,
delivery price, storage) be a relation scheme. And let the following be
the FDs that hold on ebay prod vendor:
prod id → price model num
vendor storage → deliveray price
Decompose ebay prod vendor into a (set of) relational schemes via a
lossless-join decomposition, and explain why it is indeed a lossless-join decomposition
(namely, show briefly that the criterion for lossless-join decomposition
described in class holds on your relations).
Question 5. Let R = (A, B, C, D) be a relation schema and let F = {C →
D, C → A, B → C} be a set of FDs. Is R in Boyce-Codd normal form
(BCNF) with respect to F? If it is explain why, otherwise decompose R
into a set of schemas in BCNF.
3
Marking criteria
This coursework is assessed and mandatory and is worth 5% of your total
final grade for this course. Some marks will be given if the approach was
correct even if the final answer is not complete.

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或 微信:codehelp

原文地址:https://www.cnblogs.com/simplebluejava/p/11978657.html

时间: 2024-08-08 13:13:50

CS2855 Assessed的相关文章

HDU-1171 Big Event in HDU (多重背包)

Problem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Software College in 2002.The splitting is absolutely a big

HDU1171--Big Event in HDU(多重背包)

Big Event in HDU   Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1139 Accepted Submission(s): 444 Problem Description Nowadays, we all know that Computer College is the biggest department in HD

USACO 1.3 Ski Course Design

Ski Course Design Farmer John has N hills on his farm (1 <= N <= 1,000), each with an integer elevation in the range 0 .. 100. In the winter, since there is abundant snow on these hills, FJ routinely operates a ski training camp. Unfortunately, FJ h

Software Engineering: 2. Project management

resources:"Software Engineering" Ian Sommerville For most projects, important goals are: Deliver the software to customer at the agreed time. Keep overall costs within budget. Deliver software that meets the customer's expections. Maintain a hap

HDU 1171 Big Event in HDU (多重背包变形)

Big Event in HDU Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 27961    Accepted Submission(s): 9847 Problem Description Nowadays, we all know that Computer College is the biggest department

唾液中的HBV

Hepatitis B virus (HBV) is a double-shelled DNA virus thatcan be spread by extremely small volumes of blood and,as such, is a potential risk during the provision of dentaltreatment. Markers of infection include intact virion(Dane particle), surface a

隐匿性乙肝病毒感染:一种秘密行动

Journal of Viral Hepatitis Occult Hepatitis B Virus Infection: A Covert Operation F. B. Hollinger, G. Sood Disclosures Summary and Introduction Summary Detection of occult hepatitis B requires assays of the highest sensitivity and specificity with a

hdu 1171 Big Event in HDU

Big Event in HDU Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 22611    Accepted Submission(s): 7942 Problem Description Nowadays, we all know that Computer College is the biggest department

美国政府关于Google公司2013年度的财务报表红头文件

请管理员移至新闻版块,谢谢! 来源:http://www.sec.gov/ 财务报表下载↓ 此文仅作参考分析. 10-K 1 goog2013123110-k.htm FORM 10-K UNITED STATES SECURITIES AND EXCHANGE COMMISSION Washington, D.C. 20549     FORM 10-K (Mark One)       ý ANNUAL REPORT PURSUANT TO SECTION 13 OR 15(d) OF TH