CS174A Fundamentals of Database

CS174A Fundamentals of Database Systems Fall 2019
COURSE PROJECT
1 INTRODUCTION
You have been hired to develop a prototype account management system for Debts Rus State Bank. The
system is to manage all savings, checking, and pocket accounts at the bank for customers of Debts Rus. This
includes the following tasks.
• Maintaining balance information for all customer accounts,
• Maintaining information on bank customers, the owners of the accounts,
• Processing transactions (deposits, withdrawals, payments, etc.),
• Generating monthly reports and updating accounts with monthly interest, and
• Providing a simulated ATM-App (Automated Teller Machine-Application) interface.
Your system is to be implemented within the Oracle DBMS environment using Java and the JDBC interface
to the Oracle DBMS.
2 DETAILS
2.1 Accounts
An account is a repository of money owned by one or a set of customers. If there is more than one owner, one
of them is designated as the primary owner (who, among other things, will receive monthly statements) and
all other owners are co-owners who will have all owner’s privilege except for receiving month statements.
Associated with each account is a unique account ID number (an integer), and a list of transactions made
during the month. Also associated with each account is a bank branch name in which the account is held.
Accounts come in three flavors: checking, savings, and pocket. There are two sub-flavors of checking
accounts: student checking and interest checking. There is only one kind of savings accounts and one kind
of pocket accounts.
The following rules apply to all accounts:
1. When a checking or savings account is first created, it must have a balance of at least $1,000 (this should
be recorded in the transaction history as a deposit).
2. When a pocket account is created the customer must already have a checking or savings account with a
CS174A留学生作业代写、Database Systems作业代做
positive balance. The customer also selects the account (checking or savings) to be linked to the pocket
account.
3. No transaction can make an account balance to go below $0.00; every transaction that removes more
than the available balance must fail.
4. Each transaction that makes a checking or savings account balance to $0.01 or less automatically closes
the account. When an account is closed, the account is not removed from the database until after a final
statement is generated (at the end of the month). No transactions (including deposits) are permitted on a
closed account.
5. At the end of each month, all open accounts earn interest on their balances. The rate of interest varies
with the type of account.
1
2.2 Checking Accounts
In addition to the general account rules, all checking accounts observe the following rules:
1. Interest checking has an initial 3.00% annual rate (for simplicity, the monthly interest rate is just the
annual rate divided by 12) but can be changed. It should be simple to change these values in your
prototype system (bank policies change quite often). Student checking earns no interests, i.e., has a fixed
0.00% annual rate.
2. The following transactions are valid on a checking account: deposit, withdrawal, transfer, wire, writecheck,
and accrue-interest.
2.3 Savings Accounts
Savings accounts observe the following rules in addition to the general account rules:
1. The initial annual interest rate is 4.80%.
2. The following transactions are valid on a savings account: deposit, withdrawal, transfer, wire, and
accrue-interest. Note that no checks can be written for a savings account.
2.4 Pocket Accounts
Pocket accounts are used to make flexible payments (e.g., from cell phones) to vendors, or other customer’s
pocket accounts. The general account rules and the follow rules apply:
1. The interest rate is always 0.0%.
2. A flat $5 monthly fee is applied on the first transaction of the month. The monthly fee is waived if there
are no transactions in the month,
3. The following transactions are valid on a savings account: top-up, purchase, collect, and pay-friend.
2.5 Customers
A customer is an individual with a name, a (unique) tax identification number, and an address. Every
customer has a set of (jointly) owned accounts. A customer should be only kept in the system if he or she
owns one or more accounts.
Also associated with each customer is a unique PIN (Personal Identification Number), which is a 4-digit
string (i.e., leading 0 is acceptable). The PIN is used by the customer to access the accounts she/he owns
using an ATM-App (interface). The PIN should be private data: it should not be possible to write a program
(e.g., SQL) that reads the PIN value for a customer. Rather, only two functions should have access to an
account’s PIN, VerifyPin(PIN) and SetPin(OldPIN, NewPIN). The function VerifyPin(PIN) returns true if
PIN is the correct PIN for the customer. SetPin(OldPIN, NewPIN) changes a customer’s PIN to NewPIN, if
OldPIN is the customer’s current PIN. When a new customer is created in the system, the PIN is initialized
to 1717.
2.6 Transactions
Transactions are actions that move money into and out of accounts, and from one account to another. A
transaction can be generated by interaction of a customer with an ATM-App, or by an action taken by a
bank teller.
The following transaction types are allowed in the system:
2
Deposit: Add money to the checking or savings account balance.
Top-Up: Move a specified amount of money from the linked checking/savings account to the pocket account.
Withdrawal: Subtract money from the checking or savings account balance.
Purchase: Subtract money from the pocket account balance.
Transfer: Subtract money from one savings or checking account and add it to another. A transfer can only
occur between two accounts that have at least one owner in common. If the transfer was requested by a
customer, she or he must be an owner of both accounts. Furthermore, the amount to be moved should
not exceed $2,000.
Collect: Move a specified amount of money from the pocket account back to the linked checking/savings
account, there will be a 3% fee assessed.
Pay-Friend: Move a specified amount of money from the pocket account to a specified customer’s pocket
account.
Wire: Subtract money from one savings or checking account and add it to another. The customer that
requests this action must be an owner of the account from which the money is subtracted. There is a 2%
fee for this action.
Write-Check: Subtract money from the checking account. Associated with a check transaction is a check
number. (Note that a check cannot be written from all account types.)
Accrue-Interest: Add money to the checking or savings account. The amount added is the monthly interest
rate times the average daily balance for the month (e.g., an account with balance $30 for 10 days and $60
for 20 days in a 30-day month has an average daily balance of $50, not $45!). Interest is added at the end
of each month.
Associated with every transaction is the date of the transaction and the account(s) involved (in addition
to any information specific to the transaction; e.g., check number). This information will be included in the
monthly statement for each account.
Transactions may fail for various reasons. For example, a transaction fails if any of the accounts involved
are closed or if more money is deducted than is available in the account.
All successful transactions on an account should be recorded for the account and printed in the monthly
statement for the account.
2.7 ATM-App Interface
Your system needs to provide a simulated ATM-App (Automated Teller Machine or mobile application)
interface. (For simplicity, these two interfaces are combined for this project.) The ATM-App interface
should query for a PIN. If the PIN is successfully verified, the ATM-App should allow the customer to make
any of the following transactions:
• Deposit, top-up,
• Withdrawal, purchase,
• Transfer (between accounts with a common owner only), collect,
• Wire, pay-friend.
If the customer owns more than one account, she should be prompted for the account(s) the transaction
should access.
3
Optionally, you may want to include a “quick cash” option, which automatically withdraws some preselected
amount(s) from a pre-selected account. If there is no pre-selected amount or account, no withdrawal
should occur. Similarly, a “quick refill” option can be provided for pocket accounts.
2.8 Bank Teller Interface
The Bank Teller Interface allows bank employees to manage customer accounts. The following options
should be available:
Enter Check Transaction: Submit a check transaction for an account.
Generate Monthly Statement: Given a customer, do the following for each account she owns (including
accounts which have closed but have not been deleted): generate a list of all transactions which have
occurred in the last month. This statement should list the names and addresses of all owners of the
account. The initial and final account balance is to be included. If the sum of the balances of the
accounts of which the customer is the primary owner exceeds $100,000, a message should be included
in the statement to warn the customer that the limit of the insurance has been reached.
List Closed Accounts: Generate a list of all accounts which have closed in the last month.
Generate Government Drug and Tax Evasion Report (DTER): By federal law, deposits over $10,000
for a single customer in all (owned or jointly owned) accounts within one month must be reported to the
government. Generate a list of all customers which have a sum of deposits, transfers and wires during
the current month, over all owned accounts (active or closed), of over $10,000. (How to handle joint
accounts?)
Customer Report: Generate a list of all accounts associated with a particular customer and indicate whether
the accounts are open or closed.
Add Interest: For all open accounts, add the appropriate amount of monthly interest to the balance. There
should be a record in your database that interest has been added this month. So a repeated “Add Interest”
transaction would report a warning and do nothing else.
Create Account: Given an account type and other necessary information (e.g. owners, initial balance),
create a new account with the specified characteristics. Note that this operation may introduce new
customers to the bank. You may consider a create customer operation, but as far as the bank operations
are concerned, customer creation is a part of account creation.
Delete Closed Accounts and Customers: Remove from the database all closed accounts and remove all
customers who do not own any accounts (because their accounts have closed).
Delete Transactions: Delete the list of transactions from each of the accounts, in preparation for a new
month of processing.
2.9 Set Dates and Interest Rates
The following operations should also be provided in your system. They may not a functional part of your
system but they are needed to test and debug your system.
• Set a new date, you can assume that the new date is later than all dates recorded in the database, and
• Set a new interest rate for a given type of accounts.
You may assume that the bank is open every day.
4
3 REQUIREMENTS
Your prototype system should have user interface(s) for the ATM-App and Bank Teller interfaces. It is not
necessary to have your interfaces accessible from a web browser, even though access through the web seems
logical and desirable. In designing the GUIs of your system, keep in mind the principle of “simple” and
“functional”. You will not earn extra credits with fancy GUIs. On the contrary, if your system does not
function as specified, you will lose points.
You must store all information of your system in a database system managed by the Oracle DBMS. That
is when your system is not running or crashed or shutdown, all data are in the database and nothing is stored
in any files. When your system restarts, all previous actions done on your system must be remembered.
Again, you should not use files. Your system should be implemented in Java using JDBC to connect to your
database managed by the Oracle DBMS.
The course project is to be completed by each group consisting of 2 students. Everyone in the group
is expected to know all details of the implementation up to the level of being able to answer questions
concerning design decisions.
4 EARLY PROJECT REPORT
Each group should submit an early project report by Monday, November 4. The report has to address the
issues in making major design decisions. In particular, you should discuss the following points that will help
understanding the requirements of the project and main steps towards completing the project.
1. Identify as many integrity constraints as you can on your initial ER diagram. You may describe the
constraints in English.
2. Design an ER diagram for the application described in the project and express as many integrity constraints
you have identified as possible.
3. Translate the ER diagram into relation schemas and do not forget the integrity constraints you have
identified.
4. Indicate which integrity constraints that your relational database schema is able to incorporate; identify
additional integrity constraints if possible.
5. Discuss briefly how you will deal with a violation of each of the integrity constraints identified.
6. Provide an initial system design. You can choose appropriate means to describe your system design, e.g.,
class diagrams, diagram of functional components, etc.
7. List the task divisions and list each member’s responsibility.
Please typeset your report (you may draw figures by hand), a revised version of your report will be a part
of the final project report.
5 Project Evaluation
Project evaluation of all teams will be conducted in the 10th week, i.e., during the week of December 2.
Details will be announced later.
5

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

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

时间: 2024-11-19 09:47:06

CS174A Fundamentals of Database的相关文章

MySQL 使用B+树

概述 首先需要澄清的一点是,MySQL 跟 B+ 树没有直接的关系,真正与 B+ 树有关系的是 MySQL 的默认存储引擎 InnoDB,MySQL 中存储引擎的主要作用是负责数据的存储和提取,除了 InnoDB 之外,MySQL 中也支持 MyISAM 作为表的底层存储引擎. 我们在使用 SQL 语句创建表时就可以为当前表指定使用的存储引擎,你能在 MySQL 的文档 Alternative Storage Engines 中找到它支持的全部存储引擎,例如:MyISAM.CSV.MEMORY 

Android Application Fundamentals——Android应用程序基础知识

Application Fundamentals--应用程序基础知识 Key classes--关键类 Activity Service BroadcastReceiver ContentProvider Intent In this document--在这篇文章中 Application Components--应用程序组件 Activating components: intents--激活组件:意图 Shutting down components--关闭组件 The manifest

Database Backup and Recovery Basics2

1.6.Automatic Disk-Based Backup and Recovery: The Flash Recovery Area 创建不同备份和恢复文件的组件对每个文件系统的大小没有任何了解.使用Automatic Disk-Based Backup and Recovery,你可以创建一个闪回恢复区,使备份文件的管理自动化.在磁盘上选择一个位置,为存储空间提供一个更大的边界,同时设置一个备份策略,那么数据库在那块空间管理用做备份的存储.归档日志和其他与恢复相关的文件.oracle建议

安卓官方开发文档API GUIDE(1.1)Application Fundamentals 应用基础

Application Fundamentals Android apps are written in the Java programming language. The Android SDK tools compile your code-along with any data and resource files-into an APK: an Android package, which is an archive file with an .apk suffix. One APK

Google 官方文档解析之——Application Fundamentals

Android apps are written in the java programming language.The Android SDK tools compile your code-along with any data and resource file-into an APK:an Android package,which is an archive file with an .apk suffix.One APK file contains all the contents

OCA认证考试指南(1Z0-061)Oracle Database 12c SQL 基础

这篇是计算机类的优质预售推荐<OCA认证考试指南(1Z0-061)Oracle Database 12c SQL 基础>. Oracle认证大师(OCM)最新作品,OCA认证考试官方用书,涵盖了1Z0-061考试的所有OCA目标. 内容简介 <OCA认证考试指南(1Z0-061):Oracle Database 12c SQL基础 旨在帮助读者备战Oracle Certifi ed Associate Oracle Database 12c SQL Fundamentals I考试.书中

数据库设计(三)11 important database designing rules which I follow

原文地址:https://www.codeproject.com/Articles/359654/important-database-designing-rules-which-I-fo 麻辣个??的,好像在哪儿看到过这篇文章的中文版的,世风日下,人心不古啊,各种抄袭啊. 原文的锚点不知道是太长了,还是格式有问题,这里要改一下. Table of Contents Introduction Rule 1: What is the nature of the application (OLTP

oracle database resident connection pooling(驻留连接池)

oracle在11g中引入了database resident connection pooling(DRCP).在此之前,我们可以使用dedicated 或者share 方式来链接数据库,dedicated方式是oracle数据库默认的链接方式,无需过多的配置,而且关于dedicated的bug也是非常少的,因此,通常情况下,建议使用dedicated方式来链接数据库.但是,在服务器资源有限,并且同时连接数据库的用户量非常大时,dedicated方式就无能为力了.假设并发用户为5000,每个d

Oracle Database 12c Release 1下载安装(自身经历)

1.访问Oracle官网:https://www.oracle.com/index.html,下载Oracle Database 12c Release 1 (注意:File1和File2都要下载!!不然后期安装会报一堆错误,可参考:http://www.2cto.com/database/201503/386272.html) 2.将文件解压,把winx64_12102_database_2of2文件夹中database\stage\components目录下的所有文件夹,复制到winx64_