The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Can I get the English query as well as the sql for the nine sample queries.
Part 2 Â
Project 2 Financial Data Transactions
Â
Â
Over the course of a single day, billions of financial transactions occur. There is an important need to keep track of all the data for the financial firms, the customers who buy and sell, and the government who needs to makes sure that everything is running by the law.
Â
Customers:
The customer database needs to have the customer name, product name and item bought. The above is a foreign key Customer_ID. Then there is needs to be place for the customer’s holding positions as well as the remaining positions.
There then needs to be a primary key with Payment Method (Payment_Method_Code). This is used to show many different banks that the customer needs to fund their account.
Â
Â
Financial Firms:
When a financial transaction occurs, there are least two counterparties: the multiple buyers and the multiple sellers called Customer_ID. Then there needs a place for price to make sure the amount is bought and sold is listed to the customer who did those things.
Â
Government:
The government needs to make sure that that taxes are collected from the sale of securities. The dates of these transactions are needed to make sure that the transactions happened during the same calendar year.
Â
Â
Â
Customers
|
Attribute Name |
Data Type |
Size |
Constraint/ Domain |
Cascading Problems |
|
Customer_ID |
Varchar |
12 |
Varchar(12) |
Primary key |
|
Payment_Method_Code |
Varchar |
12 |
Varchar(12) |
null |
|
Customer_name |
Char |
35 |
Char(30) |
Not null |
|
Product name |
Char |
35 |
Char(30) |
Not null |
|
Item_bought_name |
Varchar |
25 |
Varchar(25) |
Not null |
Â
Â
Â
Primary keys:Customer_ID
Â
Foreign keys: Account_ID-references Account ID in government table,
Indices: CREATE INDEX Customer_name
ON Customers (Customer_name); UPDATE INDEX Customer_name
ON Customers (Customer_name); DELETE INDEX Customer_name
ON Customers (Customer_name);
Â
Financial Firms
|
Attribute Name |
Data Type |
Size |
Constraint/ Domain |
Cascading Problems |
|
Tranaction_ID |
varchar |
12 |
Varchar(12) |
Primary key |
|
Customer_ID |
Varchar |
12 |
Varchar(12) |
Foreign key |
|
price |
Currecy |
Double |
Currency(double) |
Not null |
|
Item_sold_name |
Varchar |
25 |
Varchar(25) |
Not null |
|
Customer_name |
Varchar |
25 |
Varchar(25) |
Not null |
Â
Primary Keys: Transaction_ID
Â
Foreign Keys Customer_ID-references Customer_ID in customers table
Indices: CREATE INDEX Item_sold_name ON Financial Firms (Item_sold_name);
UPDATE INDEX Item_sold_name ON Financial Firms (Item_sold_name); DELETE INDEX Customer_name
ON Financial Firms (Item_sold_name);
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Government
|
Attribute Name |
Data Type |
Size |
Constraint/ Domain |
Cascading Problems |
|
Account_ID |
Varchar |
12 |
Varchar(12) |
Primary key |
|
Account_name |
Char |
35 |
Varchar(35) |
Not null |
|
Date |
Date |
Dd/mm/yy |
Date(dd/mm/yy) |
Not null |
|
Transaction_ID |
Varchar |
12 |
Varchar(12) |
Foreign key |
|
social security number |
Varchar |
12 |
Varchar(12) |
Not null |
Â
Â
Primary Keys: Account_ID
Â
Foreign Keys Tranaction_ID-references Transaction ID in Finacial firms
Indices: CREATE INDEX Account_name ON Government (Account_name);
UPDATE INDEX Transaction_Type ON Government (Transaction_Type);
DELETE INDEX Transaction_Type ON Government (Transaction_Type);
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
User 1:
Query 1:Name:abc
Question:Â Select payment method code and product_name

Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Query 2:
Select customer name where transaction id is given

Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Query 3:

Â
Â
Â
Â
Â
Â
Â
Â
                                                                                      Â
Â
Â
User:2
Select product name and item bought name

Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Select price and item sold

Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Select account name where transaction id given

Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
User:3
Select payment method code where customer id of finance is given

Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Select all from financial after input id

Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Select account name where transact id input


----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly