CO532留学生作业代写、代做SQL编程语言作业、SQL实验作业代写、代做Data Model作业帮做Haskell程序|代写Python程序

CO532 Assessment 3Here is one solution to Assessment 2Conceptual Data ModelAssumptions A student may have attended no training session A chef may not have supervised a training session A student may have not yet cooked for an event At least one friend needs to attend the cook-and-dine event A kitchen can be used by 0 or more sessions. A kitchen can be used by 0 or more events.Relational SchemaPrimary keys are underlined and foreign keys are in italic. No foreign keys are allowed to be null.Student(studentId, name, streetAddress, city, postcode, phoneNum)TrainingSession(date, time, buildingName, roomNum, studentId, empId)CookAndDineEvent(date, time, grade, buildingName, roomNum, studentId)Kitchen(buildingName, roomNum)Chef(empId, name, phoneNum, email, qualification)Friend(friendId, name, email, dietaryConstraints)EventAttending(friendId, date, time, buildingName, roomNum)ConstraintsUnique Constraints:TrainingSession (date, time, studentId) (date, time, empId)CookAndDineEvent Unique Constraints (studentId)Domain Constraints: grade: {A, B, C, D, E, F} qualification: {certificate, associate degree, bachelor, master, none}Not Null Attributes: Student: name Friend: name Chef: name, phoneNum, email, qualificationTASK 1 (40%) From the above information, implement the database tables in PostgreSQL, choosing sensible data types for eachcolumn. Ensure you maintain referential integrity. Implement all the above domain constraints and unique columns.Add appropriate not null constraints to attributes. Ensure your data types and constraints allow for sensible futuredata to be added to the database in the future.Insert the following data into the tables. Do not add any data except this.StudentstudentId Name streetAddress city postcode phoneNum1 Sue Faffer 12 Meryl Street Canterbury CT6 8UJ +44 1227-968-52872 Chris Driver 3a Carla Lane Herne Bay CT4 9KL NULL3 Olive Kemp 1 Cecil Road Canterbury CT6 8UJ 01227871000 extension 1054 Sue Faffer 14 Meryl Street Canterbury CT6 8UJ 1227943979TrainingSessionDate Time buildingName roomNum studentId empId10/01/2019 10:00:00 farm house 2 1 100111/01/2019 12:00:00 annex 1 1 100112/01/2019 10:00:00 annex 1 1 100213/01/2019 12:00:00 farm house 2 4 100305/02/2019 10:00:00 farm house 1 1 100305/02/2019 10:00:00 farm house 2 2 100205/02/2019 10:00:00 annex 2 3 1001CookAndDineEventdate Time Grade buildingName roomNum studentId06/02/2019 18:00:00 A annex 1 405/02/2019 12:00:00 B farm house 2 103/05/2019 12:00:00 NULL annex 1 2KitchenbuildingName roomNumannex 1annex 2farm house 1farm house 2farm house 3ChefempId name phoneNum email qualification1001 Sally Smith +44 1227 871 194 [email protected] certificate1002 Ben Driver 0779 601423 [email protected] none1003 Jane Smith 01227 8812061 [email protected] certificateFriendfriendid Name Email dietaryConstraints2 Yasser Crimp [email protected] Allergic to Nuts1 Jane Smith NULL NULL3 Ben Blimp [email protected] None5 Chris Driver [email protected] No4 Jim Smith [email protected] Gluten free only.EventAttendingfriendId date Time buildingName roomNum2 03/05/2019 12:00:00 annex 14 03/05/2019 12:00:00 annex 11 05/02/2019 12:00:00 farm house 22 06/02/2019 18:00:00 annex 13 06/02/2019 18:00:00 annex 1TASK 2 (10% Each query) Answer each of the below with a single PostgreSQL query. For queries that return information, return only the dataspecified and use only the information provided in the question: the queries must utilize the information given, do nothard code ids or other information that is not explicitly given. Ensure the queries will work with any future data, notjust the data given.2.1) List the Chef name, phoneNum, date and time for all TrainingSessions. Sort alphabetically by Chef name first, thenearliest in terms of date and time first.2.2) For each student with training sessions in the farm house, give the number of such training sessions, studentname and studentId.2.3) Give the student name, dietaryConstraints, date and time for all cookAndDineEvents that Yasser Crimp will beattending.2.4) Give the Student name, TrainingSession date and times for all students who do not have a CookAndDineEvent.2.5) List the date, time, student name and studentId for all activities (both Training Sessions and CookAndDineEvents).2.6) For the TrainingSessions with all Chefs who are qualified with a certificate and which are in farm house roomNum2, change the location to be in farm house roomNum 3.SubmittingSubmit via Moodle. The deadline is given there.Submit one file in plain text format. It must have a .txt extension.In the file you should provide: The PostgreSQL commands that you used to create the tables (in the order you created them). The PostgreSQL commands that you used to insert the data (in the order you inserted the data).The PostgreSQL commands to run the queries.Code that does not work will get 0 marks. Any non-executable text must be in comments, for example, either on linesstarting with “--” or between java-like /* … */ blocks. Put a comment indicating the question number beforeeach query from Task 2 (e.g. “-- 2.1”).Late submissions will get 0 marks.I will not be available on the day of submission for questions, make sure you get any queries to me before then.Peter Rodgers 本团队核心人员组成主要包括硅谷工程师、BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(CO532留学生作业代写、代做SQL编程语言作业、SQL实验作业代写、代做Data Model作业帮做Haskell程序|代写Python程序)