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

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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