代写COMP9120 Database Management Systems Assignment 2代做Python编程

COMP9120 Database Management Systems

Assignment 2: Database Application Development

Group Assignment (13%)

Introduction

The objectives of this assignment are to gain practical experience in interacting with a relational database management system using an Application Programming Interface (API) (Python DB-API). This assignment additionally provides an opportunity to use more advanced features of a database such as functions.

This is a group assignment for teams of about 3 members, and it is assumed that you will continue in your Assignment 1 group. You should inform. the unit coordinator as soon as possible if you wish to change groups.

Please also keep an eye on your email and any announcements that may be made on Ed.

Submission Details

The final submission of your database application is due at 11:59pm on Tuesday 1th  November. You should submit the items for submission (detailed below) via Canvas.

Items for submission

Please submit your solution to Assignment 2 in the ’Assignment’ section of the unit’s Canvas site by the deadline, including EXACTLY THREE files:

•    An assignment coversheet as a PDF document (.pdf file suffix) which is available for download from this link on Canvas.

•    A SQL file  (SOTSchema.sql) containing the SQL statements  necessary to generate the database schema and sample data. This should contain the original schema and insert SQL statements, and any changes or additions you may have made.

•    A Python file (database.py) containing the Python code you have written to access the database.

Task 1: The SharePlus Online Trading (SOT) System

In this assignment, you will be working with the SOT system which is currently under development. The system still requires work in numerous areas, including interaction with the database.  Your main  task in this assignment is to handle requests for reads and writes to the database coming from the user interface (UI). We first describe the main features that the SOT system should include from a UI perspective, and then discuss where the majority of your database code needs to be implemented.

Logging In

The first form a user is presented with when starting the SOT system is Login, as shown in Figure 1. This feature is still under development and currently requires that an administrator enters their username and password to be validated prior to successfully log in to the system. Security features such as password encryption/hashing will be implemented at a later stage (and is out of scope for this assignment). Once logged in, the user is taken to the regular investment instructions list page to view their associated instructions for their customers.

Figure 1 – Login form.

Viewing Instructions List

Once a user has logged in, they are shown a list of all their associated instructions, as shown below in Figure 2. This list must be ordered such that only active instructions appear at the top. The list is also sorted by expiry date in ascending order, and customer full name in descending order. Each instruction has an amount, frequency, expiry date, customer full name, ETF name, and notes. An instruction is associated with an administrator if the administrator is allocated as the staff assisting customers with their investment instructions.

Figure 2 – Viewing Instructions List

Finding Instructions

A user can search through all investment instructions by entering a word or phrase (a ‘keyword9) in the field next to the Find button, as shown in Figure 3, and then clicking on Find. When such a keyword is specified, then the retrieved instructions and shown on the list are those that include this word or phrase in the customer9s full name, ETF name, or notes. The search must ignore case sensitivity. For example, given the search keyword ‘carie b’, Find will return all instructions that include the keyword ‘carie b’ in the customer’s full name, ETF name, or notes. Searching with a blank/empty keyword field will show all of the logged in user’s associated instructions. Any search results returned must be ordered such that instructions without an administrator would appear at the top, and by expiry date in ascending order. The search results must also exclude instructions that have expired.


Figure 3 - Finding Instructions

Adding an Instruction

Users may also add a new instruction by clicking on the Add Instruction tab in the title bar, entering investment instruction details such as amount, frequency, and customer, in the popup dialog that appears, and then clicking on Add Instruction button, as shown in Figure 4. A new regular investment instruction has a default expiry of twelve months from the current date.


Figure 4 - Adding an Instruction

Updating an Instruction

Users can also update an instruction by modifying data in the instruction details screen as shown in Figure 5, and clicking on Update Instruction button. You can access this update screen by clicking on an instruction from the list of instructions in the Instructions tab.

Figure 5 - Updating an Instruction

Database Interaction Code

The files that are needed for the Python version of assignment are as follows:

1. SOTSchema.sql: a file which contains SQL statements you need to run to create and initialise the SOT system database, before starting the application

https://canvas.sydney.edu.au/files/26926696/download?download_frd=1

2. Assignment2_PythonSkeleton.zip: a zip file encapsulating the Python project for the

SOT systemhttps://canvas.sydney.edu.au/files/26926697/download?download_frd=1

To inspect the SOT system code, you need to unzip the ZIP archive first, which will create a folder that includes the name Assignment2_PythonSkeleton. If you experience any difficulties installing and exploring the project, ask your tutor or lecturer for assistance.

The skeleton code uses a number of Python modules to implement a simple browser-based GUI for the SOT system. The main modules are the Flask framework for the GUI and the psycopg2 module for the PostgreSQL database access. Similar to tutorial 7, you will need to install the Psycopg2 module and the Flask module. The skeleton code follows the structure described below:

•  The main program starts in the main.py file. You need to use the correct username/password details as specified in tutorial 7, and then implement the missing database access functions - including any necessary SQL code statements required - in the data layer database.py.

•  The presentation layer is done via a simple HTML interface that can be accessed from a web browser.

The corresponding page templates are located in the templates/ subdirectory, their CSS style file is static/css.

•  The transition between the different GUI pages and the initialisation of the Flask framework is done in the routes.py file. It currently just invokes the pages, but there is no further business logic implemented yet.

You can run the code by running “python main.py”.  This starts a local web server and prints out some debug messages in the terminal; the GUI can then be accessed with any web browser on the same computer via   the   local    URL http://127.0.0.1:5000/ (If   that   doesn’t   work  you    can   also   try http://0.0.0.0:5000/). Please note that, to terminate the application, you will need to stop the local web server which is running in the background.

Task 2: Functions Implementation

Core Functionality

In this assignment, you are provided with a Python skeleton project that must serve as the starting point for your assignment. Your task is to provide a complete implementation for the file database.py, as well as make any modifications necessary to the database schema (i.e., SOTSchema.sql). Specifically, you need to modify and complete these five functions:

1. checkAdmCredentials (for login)

2. findInstructionsByAdm (for viewing instructions list)

3. findInstructionsByCriteria (for finding instructions)

4. addInstruction (for adding instruction)

5. updateInstruction (for updating instruction)

Note that, for each function, the corresponding action should be implemented by issuing SQL queries to the database management system. If you directly output and/or manipulate the result without issuing SQL queries, you are considered as cheating, and you will get zero point for the assignment.

Marking

This assignment is worth 13% of your final grade for the unit of study. Your group’s submission will be marked in line with the rubric that follows.

Group member participation

If members of your group do not contribute sufficiently, you should alert the unit coordinator as soon as possible. The course instructor has the discretion to scale the group’s mark for each member as follows:

Percentage of contribution

Proportion of final grade received

< 5% contribution

0%

5 - 10% contribution

20%

11 - 15% contribution

40%

16 - 20% contribution

50%

21 - 24% contribution

60%

25 - 28% contribution

80%

29 - 30% contribution

90%

> 30% contribution

100%

Note:  The above table assumes that each group will have 3 members, so, on average, around 33% contribution is expected from each member of the group. In special case, if the group has less than 3 members then the contribution percentage will be adjusted accordingly. You must justify your contribution percentage by providing detailed explanation of your contribution in the cover sheet mentioned before. Furthermore, we will run random face-to-face interviews to understand your contribution, if needed.

Marking Rubric

Your submissions will be marked according to the following rubric, with a maximum possible score of 13 points.

Part marks (0 – 1)

Full marks (1.5 – 2.5)

Login

Can correctly login the user ‘ciori’ and validate her username and password.

All valid users can be logged in

successfully, and unsuccessful user logins should be rejected.

View

Instructions List

Correctly list all instructions associated with user ‘ciori’ in the correct order (see Figure 2).

Correctly list all instructions associated with a user, in the correct order, for all possible username input from Figure 1.

Find

Correctly list instructions for keyword “carie b”

Correctly list instructions for all possible

Instruction

(see Figure 3).

keywords.

Add

Instruction

Can correctly add an instruction to the database.

Can correctly add all valid instructions to the database. Instructions entered with invalid details should be rejected.

Update

Instruction

Can correctly update the frequency of an instruction as shown in Figure 5.

Can correctly update details of all

instructions, ensuring the updated details for an instruction are valid.

Stored

Procedure

A couple of stored procedures (functions) are correctly created in the submitted SQL file.

A couple of stored procedures (functions) are correctly created in the submitted SQL file, and correctly called in two of the five specified functions.



热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图