To find the balance in account number x

Assignment Help Database Management System
Reference no: EM13949783

The Database I am creating is a Bank Database. I am using a very simple bank database, which has few tables and will provide very limited capabilities to the bank.

Bank Database:

The bank database I have created has 4 tables: Branch, Account, Depositor and Customer

The details (attributes) of the bank databases are as shown:

i) The branch table contain information about the branch location.

ii) The Account table has information about the balance and the account holder and where he is having a account(which branch).

iii) The Depositor table has information about which Account is associated with which customer.

iv) The customer table has information about the customer like his name, address etc.

1145_branch.png

Branch: Branch_name, Branch_city, City_code

Account: Account_number, Branch_name, Balance

Depositor: Customer_name, Account_number

Customer: Customer_name, Customer_street, Customer_city, Phone_number

The underlined attributes are the primary key above.
The SQL statements for creating the above tables are as following:

Branch : Create table branch
(branch_name char(20)
Branch_city char(30)
City_code int
Primary key (branch_name))

Account : Create table account
(account_number char(10)
Branch_name char(20)
balance int
Primary key (account_number))

Depositor : Create table depositor
(customer_name char(20)
account_number char(10))

Customer : Create table customer
(customer_name char(20)
customer_street char(30)
customer_city char(30)
phone_number char(10)

Primary key (customer_name))
This database may provide the following information:

i) The balance present in a customer's Account.
ii) The information about a customer holding a particular Account number X .
iii) How many Customers in the bank has balance less than a some amount Y.

The SQL statements for the above are as follow:

i) To find the balance in account number X

Select balance from from Account where account_number = X

ii) The information about a customer holding a particular Account number X .

Select customer_name, customer_street, customer_city, phone_number from
Customer where customer_name = (select customer name from Depositor
where account_number = X)

iii) How many Customers in the bank has balance less than a some amount Y.

select count(account_number) from Account where balance < Y

Sample Set :

i) Select balance from from Account where account_number = 0111123323

Output :: 2000

ii) Select customer_name, customer_street, customer_city, phone_number from
Customer where customer_name = (select customer name from Depositor
where account_number = 0111123456)

Output :: Customer_name - Hector
Customer_street - bbb
Customer_city - XYZ
Phone_number -- 1982918291

iii) select count(account_number) from Account where balance < 3000

Output :: 2

Reference no: EM13949783

Questions Cloud

Create a database for a human resources group. : State assumptions in creating the DB and underlying database objects. Use Access to create DB and tables.
Compute the coefficient of correlation r : What conclusions can you reach about the relationship between the battery capacity and the digital-mode talk time? You would expect the cell phones with higher battery capacity to have a higher talk time. Is this borne out by the data?
Outdoor recreational and casual-living activities : Design a go-anywhere, use-anywhere wind screen for outdoor recreational and casual-living activities, including sunbathing, reading, cooking, and picnicking. The wind screen must be lightweight, portable, easy to deploy, and low cost.
Cooling of computer components : 1. Answer the following true or false. Explain. (a) Work is done by a system on its surroundings if the sole effect on everything external to the system could have been the raising of a weight. (b) Cooling of computer components achieved by a fan-i..
To find the balance in account number x : The Account table has information about the balance and the account holder and where he is having a account(which branch).
Explain why highlighting non-value-added costs is important : Prepare a report that presents value-added, non-value-added, and actual costs for purchasing. Explain why highlighting the non-value-added costs is important.
What type of market structure is the supermarket industry : What type of market structure is the supermarket industry - What type of market structure is the market for vegetables provided by farmers?
Second law of thermodynamics : 1. Answer the following true or false. (a) A process that violates the second law of thermodynamics violates the first law of thermodynamics.
Prepare cost report that lists value-added costs : Prepare cost report that lists value-added costs, non-value-added costs, and actual costs for each activity. Which activities are non-value-added? Explain why. Explain why value-added activities can have non-value-added costs.

Reviews

Write a Review

Database Management System Questions & Answers

  Design a clean and normalized database

Design a clean and normalized database that handles books for a library application. You need to consider the following rules before you design the database: Analyze and identify some of the logical problems that might exist in the library system

  Display the averaged measurements every time

The application uses hash tables - for a brief introduction, refer tothese slides . While the approach used by the simulator is very basic (using a dilated simulation clock), it is has been deemed sufficient for the purpose at hand.

  Case - max in the state department

Construct a diagram using Rationale to map the arguments about a moral claim that you have identified in the article/case study and write an essay, which maps closely to the Rationale diagram that you constructed.

  Prepare table which is in first normal form

Prepare the example of table which is in first normal form but not in second normal form and example of a table which is in second normal form but not in third normal form.

  Compile a list of five system administration

Compile a list of five system administration best practices for any two operating systems.

  Explain data mining write the major characteristics and

define data mining. what are the major characteristics and objectives associated with data mining? what professions

  The focus is to write sql queries that combine data

This is the final installment of the project! The focus is to write SQL queries that combine data from both Mondial and GapMinder (GM). For most queries you will need both Mondial and GM data, so you may need to use your bridge table(s).

  Fetch customers from germany-mexico

1) Fetch all the customers that are not from region 'BC' or 'SP' 2) Show all customer contact names and titles for the business owners who are from Germany or France 3) Fetch customers from Germany, Mexico and Sweden

  Program that simulates game of rock-paper

Write a program that simulates a game of rock, paper, scissors between a human and the computer in best 2 out of 3 rounds.

  Create data warehouse for electronics store chain

Create a data warehouse for electronics store chain. Chain has 20 stores in 5 cities. Each store has different sections comprising computers, DVDs, TVs, audio, home appliances etc.

  Discuss the reasons for converting sql queries into

1. what a query execution plan?2. discuss the reasons for converting sql queries into relational algebra queries before

  Physical design and implementation it requires the use of a

physical design and implementation it requires the use of a relational database management system. strayer university

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd