讲解:Database:CS3307 Books For EveryoneSQL

根据E-R图,为Books For Everyone程序构建对应的数据库结构。OverviewFor this assignment you will implement and query a database from a supplied ER Diagram and Schema. You will be required to write the SQL statements to create the database structures, to fill the database with data and to run queries on the data.Learning Outcomes AssessedThe following course learning outcomes are assessed by completing this assessment:A1.design and implement a relational database using a database management systemA2.utilise a query language tools and techniques to obtain data and information from a databaseK5. describe relational algebra and its relationship to Structured Query Language (SQL)S1.interpret entity-relationship diagrams to implement a relational databaseS2.demonstrate skills in designing and building a database application using a commercially available database management system development toolS3.use a query language for data manipulationAssessment DetailsBooks For Everyone (BFE) is a company that sells books and e-books. The company has provided you with a standard solution for the conceptual data model (the ER diagram). You have been commissioned to continue your role (in your capacity as a Database Management System consultant) and to write the SQL statements to create the database and its tables, add data, and provide answer to some of their everyday queries. The database should be created based on the ER diagram provided at the end of this document. Some sample data are also provided to be used for inserting data to tables. You are required to insert sufficient data to test the reports given below.To implement the databaseTranslate the ER diagram provided into a relational schema using the correct notations and standards for this course. It should include:a. Table namesb. Attribute names and field types (as required by XAMPP)c. Primary and foreign keys identifiedCreate a text file called nnnn_create.sql (where nnnn is your student number). The file should include:a. The SQL statements to create a database called bfe_nnnn (where nnnn is your student ID)b. The SQL statements to create the tables and the relationships between them.Create a text file called nnnn_insert.txt (where nnnn is your student number). The file should include:a. The SQL statements to load sufficient data into each table you have created to test the queries given below. Sample data has been provided, but you will need to include further data to test the requirements. You should add at least one record to the existing test data for each table (you will lose marks if you only insert the sample data).b. You are required to include your name as one of the customers (you don’t have to have your address if you don’t want to), but you MUST have your name and give your student id as the phone number.Create a text file called nnnn_query.txt (where nnnn is your student number). The file should include the SQL statements necessary to display the following reports:a. List all details of all tDatabase代写:CS3307 Books For Everyone代做留学生SQL语言he wholesalers, sorted by suburb in ascending order.b. List all the titles of all the books in inventory with their wholesaler’s name, email, phone number and suburb.c. List all the authors who are based in USA and who have a biography on file. Print their name as ONE column with a suitable heading, and show the number of books written by the author in inventory.d. List all of the inventory by category. Display the title and the category of each, sort in descending order of title.e. List all reviews with reviewer name and review date and title of inventory item. Also Include book title, author name and surname. Order by reviewer name.f. List all categories that have no inventory items.g. Delete the all customers from postcode 3353.h. Change the price of the inventory Item “A Brief History of Time” to $15.99.i. List all the books and e-books with their authors. Print the name of the authors and their roles in one column for each with an appropriate title.Insert an e-book as follows: the title is “Astrophysics for People in a Hurry” (category Science) written by Neil deGrasse Tyson in 2017.j. The author is based in USA, and no details are on file yet for this author. The e-book price is $18 for the Kindle version, and the abstract is: “What is the nature of space and time? How do we fit within the universe? How does the universe fit within us? There’s no better guide through these mind-expanding questions than acclaimed astrophysicist and best-selling author Neil deGrasse Tyson.”.k. Find the fulfilled orders made since 1st July 2017. List customer name and surname, date of order, number of items ordered and total price.l. Find the book which was ordered most often. List the author name and surname and date published.Your documentation should include:A title page clearly stating your name and student ID and your tutor’s name.A copy of the relational schema you have developed from the ER diagram provided. Ensure that you ist any assumptions you have made.A copy of the three files you are required to create included in the document (ie nnnn_create.txt, nnnn_insert.txt and nnnn_query.txt - where nnnn is your student number).Full APA referencing of any resources you have used to complete your submissionYou should submit the following:The documentation file described above EITHER as a MS word file or a PDF. If you are using a mac, please submit in a PDF so I can be sure of opening it. If you submit a compressed archive, please use zip only.The nnnn_create.txt file (where nnnn is your student number).The nnnn_insert.txt file (where nnnn is your student number).The nnnn_query.txt file (where nnnn is your student number).Please note that the SQL files must be either .txt or .sql because I will be running them. If they are in a word or pdf file there will be extra characters that will prevent the files from running without errors and THIS WILL COST YOU MARKS!The assignment is to be submitted via the Assignment 2 submission box in Moodle. This can be found in the Assessments section of the course Moodle shell.转自:http://ass.3daixie.com/2019011414390095.html

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,098评论 5 476
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,213评论 2 380
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 149,960评论 0 336
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,519评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,512评论 5 364
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,533评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,914评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,574评论 0 256
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,804评论 1 296
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,563评论 2 319
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,644评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,350评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,933评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,908评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,146评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,847评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,361评论 2 342

推荐阅读更多精彩内容