100% found this document useful (1 vote)
85 views27 pages

DB Final Project

This document provides information about developing an ATM system, including: - It lists group members Kanza Tanveer and Alishba Sajid who are submitting the project. - It outlines the various sections that will be covered in the project such as problem statement, introduction, purpose, requirements, case study, and creation of tables in the database. - It provides high-level descriptions of some of these sections, including defining an ATM, the history and purpose of ATMs, functional and non-functional requirements, and an example case study of a bank introducing ATM services.

Uploaded by

Rida Qureshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
85 views27 pages

DB Final Project

This document provides information about developing an ATM system, including: - It lists group members Kanza Tanveer and Alishba Sajid who are submitting the project. - It outlines the various sections that will be covered in the project such as problem statement, introduction, purpose, requirements, case study, and creation of tables in the database. - It provides high-level descriptions of some of these sections, including defining an ATM, the history and purpose of ATMs, functional and non-functional requirements, and an example case study of a bank introducing ATM services.

Uploaded by

Rida Qureshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

TOPIC:

“ATM SYSTEM”
Group Members:
Kanza Tanveer(3074)
Alishba Sajid(3035)

Submitted To: Ma’am Asma Khatoon


Course Title: Introduction to Database
INDEX:
1) Problem statement
2) Introduction
a. Definition of ATM
b. History of an AT/M
3) Purpose
4) Scope
5) Requirements
a. Functional requirements
b. Non-Functional requirements
6) Case study
7) Creation
8) Insertion
9) queries
PROBLEM STATEMENT

When they came into being, ATMs were treated to be a boon for the general public. There was
no need to stand in queues in banks to withdraw money, no need to go the branch for years
even to get a cheque deposited, cash deposited or for getting the cheque book issued.

1. When ATM were first developed there were only few ATM’s and people had to
travel long distance to access ATM.
2. People who were not familiar to the ATM machines they faced a lot of problems for accessing
it.
3. There were many security issues faced before ATM was introduced and after its
introduction some security issues were solved.
4. Some ATMs display the message “Your request cannot be processed now”, the meaning of
which has to be interpreted by the customer only. It can mean that the ATM does not have
sufficient funds, or that your account has some problem, or it may also mean that the server
of the bank is not working.
5. The servers of the banks working so slowly that it is difficult to understand if the problem is
with the machine or the bank’s server.

INTRODUCTION:

Definition of ATM:

“It is an electronic telecommunication device that provides a customer of a financial institution


with the ability to perform financial transaction without the need for a human clerk or bank
teller”.

History of ATM:

1. Alex Robertson has been credited with developing and building the first automatic teller
machine in USA.
2. The first ATM called Bankograph was installed in Barkley bank in north London on
27,june 1967.
3. After that it was later countries like japan, Sweden, UK credited in developing first cash
machine.
PURPOSE
ATMs are a safe and convenient way to manage your money. There are millions of ATMs
worldwide and you can use many ATMs 24 hours a day, 7 days week. Some allow you to select
the language you want to use. To reduce labor costs for the bank and increase availability of
banking service in a safe and cost effective method. For people who at work themselves when

the banks are open, and can only get there after the banks are closed. It is accurate. Flexible

account access allows client to access their account at their ease.

SCOPE

 ATMs performance can be increased in term of speed and memory.


 A speaking voice alarm can be used to indicate unauthorized person accessing the ATM.
 The system can be made to communicate with modems and mobile phones

REQUIREMENTS

Functional requirements:

These requirements are observable tasks or processes that must be performed by the system
under development. For example, functional requirements of an automated teller machine,

“Must process withdrawals and dispense cash to the customer”.

Functional requirements for ATM are:

 Correct card number and Validity of card:


 The ATM system shall check the card number whether it matches or not.
 The ATM shall check the validity of the inserted card. It should be valid for working
of card.
 Valid PIN:
 The ATM should validate the PIN entered by the user. A user is given 3 chances to
remember his/her password if the pin entered is wrong.
 Limited money
 An ATM allows the user to transact a limited amount of money in one day.
 Withdraw money
 Aborting the transaction:
 A user must be able to abort a transaction in progress by pressing the CANCEL
button instead of responding to request from the machine.
 Denial of all the services:
 If the user is unable to successfully enter the pin 3 times, the service will be denied
for particular card.

Non-Functional requirements:

These requirements are qualities or standards that the system under development must have, or
comply with, but which are not tasks that will be automated by the system.

Non-functional requirements of an ATM are:

 Scope:
 The scope of this project is to allow the users to get access to their account using PIN.
 Functionality:
 One customer at a time can access their account in ATM machine.
 Reliability
 The ATM machine must be able to read or scan the card and the PIN properly and
identify the customer account.
 Performance:
 The ATM machine supports only one customer at a time. The speed and accurate
transaction decides the performance factor. The screen must be clearly visible to the
user.
 Security:
 The PIN of the card guarantee the security of the customer’s account. The ATM must
not store any of his data in the database. The customer with PIN and a valid card is
allowed to do all transaction.
CASE STUDY:
A bank wishes to introduce ATM. ATM provide limited facilities to customers. Customer may
get ATM card on request. User may view their balance or transfer or withdraw money using
these cards. Cards may be used to access many accounts and an account may be accessed using
different cards.
CREATION OF TABLES:
........................................................................Database.......................................................
create database atmbnksystm
use atmbnksystm
........................................................................accounts.......................................................
create table accounts
(account_number int primary key,
account_type varchar(20),
account_password varchar(30) unique)
........................................................................Atm.....................................................
create table Atm
(atm_id int primary key,
atm_bnak_nmae varchar(30) default 'HABIB BNAK',
atm_address varchar(30) not null,
atm_bank_id int default '1234')
........................................................................bank.....................................................
create table bank
(bank_id int primary key,
bank_name varchar(30) not null,
bank_address varchar(30))
.......................................................................cards.....................................................
create table cards
(card_number int primary key,
card_bank_name varchar(30) default 'HABIB BANK',
card_expiry_date datetime)
........................................................................transactions.....................................................
create table transcations
(transaction_id int primary key,
transaction_type varchar(30))
........................................................................customers.....................................................
create table customers
(customer_id int primary key,
first_name varchar(30) not null,
mid_name varchar(30),
last_name varchar(30),
house_no varchar(10),
street_no int,
city varchar(30),
phone_no int,
customer_cardno int foreign key references cards(card_number),
cutsomer_accountno int foreign key references accounts(account_number))
........................................................................insertion.....................................................
create table insertions
(insertion_no int primary key,
I_atm_id int foreign key references Atm(atm_id),
I_card_number int foreign key references cards(card_number))
........................................................................performs.....................................................
create table performs
(perform_no int primary key,
p_customer_id int foreign key references customers(customer_id),
p_transaction_id int foreign key references transcations(transaction_id))
........................................................................facilitates.....................................................
create table facilitates
(facilite_no int primary key,
f_atm_id int foreign key references Atm(atm_id),
f_customer_id int foreign key references customers(customer_id))

INSERTION:
..................................................................insertion of Accounts.....................................................
insert into accounts
values(12341244,'saving account','alishba'),
(12341245,'current account','lishi'),
(12341457,'current account','neeshi'),
(12341545,'current account','mahrukh'),
(12342563,'current account','lecchi'),
(12343456,'saving account','AL'),
(12345479,'saving account','iru'),
(12345787,'current account','kanza'),
(12345963,'current account','amarah'),
(12346646,'current account','behn'),
(12346643,'current account','teddy')
select * from accounts

........................................................................insertion of Atm.....................................................
insert into Atm(atm_id,atm_address)
values(1203,'grand trunk road Islamabad'),
(1586,'saddar rawalpindi'),
(1596,'central road rawalpindi'),
(5423,'jail road Islamabad'),
(6542,'qasimabad rawalpindi'),
(6656,'railway road Islamabad')
select * from ATM

........................................................................insertion of bank.....................................................
insert into bank
values(1234,'HABIB BANK','ISLAMABAD')
select * from bank

........................................................................insertion of cards.....................................................
insert into cards(card_number,card_bank_name,card_expiry_date)
values(12345678,'Habib Bank','2018-04-14'),
(21045484,'Habib Bank','2018-11-27'),
(34389826,'Habib Bank','2018-09-09'),
(36784360,'Habib Bank','2018-11-09'),
(49739502,'Habib Bank','2018-05-15'),
(51055735,'Habib Bank','2018-07-16'),
(59248025,'Habib Bank','2018-11-04'),
(72907442,'Habib Bank','2018-03-30'),
(73070188,'Habib Bank','2018-02-01'),
(94744228,'Habib Bank','2018-05-14')
select * from cards
.................................................................insertion of customers.....................................................
insert into customers
values(10024883,'Aliyan','khan','butt','d4',16,'Islamabad',32155782,12345678,12346646),
(12012585,'Muhammad','fawad','awan','l10',17,'Abbottabad',34156181,21045484,12341245),
(12035468,'Amir','ali','Tanoli','j8',18,'Islamabad',59612123,49739502,12341244),
(12345780,'Shahid','khan','afridi','b2',34,'Abbottabad',32455240,51055735,12342563),
(12468500,'Azhar','khan','jadoon','h7',41,'Gujrat',32456719,59248025,12345479),
(14478900,'Yousaf','ali','khan','c3',65,'Rawalpindi',234567987,94744228,12345787),
(31424557,'Muhammad','zain','khattak','a1',45,'Islamabad',23459877,36784360,12341545),
(44577895,'Umar','raza','sheikh','e5',62,'Rawalpindi',87654322,34389826,12346643)
select * from customers
insert into
customers(customer_id,first_name,last_name,house_no,street_no,city,phone_no,customer_cardn
o,cutsomer_accountno)
values(1987643,'Amir','jamshad','k5',25,'islamabad',32568795,73070188,12341457)

............................................................insertion of transactions.....................................................
insert into transcations
values(87654,'withdraw'),
(987654,'transfer funds'),
(7654387,'deposit'),
(543234,'bill payment')
select * from transcations

...............................................................insertion of facilitates.....................................................
insert into facilitates
values(1,1203,10024883),
(2,1596,12468500),
(3,1586,10024883),
(4,6656,12035468),
(5,1203,31424557),
(6,5423,44577895),
(7,5423,31424557),
(8,6542,14478900)
select * from facilitates

.................................................................insertion of insertions.....................................................
insert into insertions
values(1,1596,21045484),
(2,1586,36784360),
(3,5423,21045484),
(4,1596,72907442),
(5,6542,49739502),
(6,6656,21045484),
(7,6656,72907442),
(8,1596,94744228)
select * from insertions

............................................................insertion of performs.....................................................
insert into performs
values(1,12345780,987654),
(2,10024883,87654),
(3,14478900,7654387),
(4,12345780,543234),
(5,14478900,987654),
(6,12035468,87654),
(7,12345780,7654387),
(8,12012585,987654)
select * from performs
where p_transaction_id=543234

QUERIES:
...................................................Simple data retrieval queries.....................................................
1) select first_name,mid_name,last_name,house_no,street_no
from customers
where (customer_id=12468500)

2) select * from Atm


where atm_id=5423

.......................................................................From two tables.....................................................


select first_name,mid_name,last_name,transaction_type
from customers,transcations,performs
where
customers.customer_id=performs.p_customer_id
and
performs.p_transaction_id=transcations.transaction_id
and
customer_id=12345780
........................................................................Distinct data.....................................................
select distinct p_customer_id
from performs

select distinct I_atm_id


from insertions

select distinct city


from customers

........................................................................Update....................................................
update customers
Set first_name='usman'
where customer_id=12345780

select * from customers


........................................................................Top.....................................................
select top 3
* from customers

select top 50 percent * from Atm

.......................................................................Alias.....................................................

select first_name as customer_name ,city as customer_city ,phone_no as customer_phone_no


from customers

.........................................Cancatenation with same data type.....................................................

select atm_bnak_nmae + ' , ' + atm_address as atm_data


from Atm
................................................................... IN .....................................................
select atm_bnak_nmae,atm_address
from Atm
where atm_id in(1203,5423,6542)

...................................................................... OR....................................................................
select p_customer_id,p_transaction_id
from performs
where p_transaction_id=87654 or p_customer_id=14478900

...................................................................... AND...................................................................
select first_name,last_name,mid_name,city,phone_no
from customers
where city='Islamabad' and mid_name='khan'

...................................................................... NOT ................................................


select card_number,card_bank_name,card_expiry_date
from cards
where card_number <> 49739502
....................................................................... NOT IN ................................................
select card_number,card_bank_name,card_expiry_date
from cards
where card_number not in (49739502,51055735,12345678)

.......................................................................Between.....................................................................
select atm_id,atm_bnak_nmae,atm_address
from Atm
where atm_id between 1586 and 5423

.......................................................................LIKE.....................................................................
select first_name,city
from customers
where city like'%abad'
select account_number,account_type
from accounts
where account_type like 's%'

....................................................................... NULL.....................................................................
select first_name,mid_name,last_name,city
from customers
where mid_name is null or first_name='Amir'

.......................................................................ALTER.....................................................................
alter table cards
alter column card_expiry_date date

...................................................................... DROP.....................................................................
drop table bank

.......................................................................UNION.....................................................................
select customer_id as id_data, first_name as name
from customers
union
select card_number, card_bank_name
from cards
.......................................................................INTERSECTION......................................................
select p_customer_id
from performs
intersect
select customer_id
from customers

.......................................................................MINIMUM................................................................
SELECT MIN(atm_id) AS atm_data
FROM Atm;

.......................................................................MAXIMUM...............................................................
SELECT MAX(card_number) AS atm_data
FROM cards

.......................................................................COUNT....................................................................
SELECT COUNT(f_customer_id) as facilitate_count
FROM facilitates
WHERE f_customer_id=10024883;

.......................................................................AVERAGE................................................................
....
SELECT AVG(f_customer_id) as facilitate_avg
FROM facilitates

.......................................................................SUM...................................................................

select SUM (insertion_no) as insertion_sum


from insertions

............................................................GROUP BY...................................................................

SELECT COUNT (customer_id) as customercount , city


FROM customers
GROUP BY city;

......................................................................Order by...................................................................

SELECT COUNT (customer_id) as customercount , city


FROM customers
GROUP BY city
ORDER BY customercount DESC;
......................................................................HAVING...................................................................
SELECT COUNT (customer_id) as customercount , city
FROM customers
GROUP BY city
HAVING COUNT(customer_id) < 3

......................................................................EXIST...................................................................
SELECT atm_bnak_nmae,atm_address,atm_id
FROM Atm
WHERE EXISTS (SELECT facilite_no FROM facilitates WHERE f_atm_id = Atm.atm_id
AND facilite_no < 5);

.....................................................................CROSS_JOIN............................................................................
select transcations.transaction_type,customers.first_name,customers.city
from customers
cross join transcations
........................................................................EQUI_JOIN...........................................................................
SELECT *
from customers
join cards
on customers.customer_cardno=cards.card_number

...........................................................................Left_JOIN...........................................................................
SELECT *
FROM customers
LEFT JOIN performs ON customers.customer_id = performs.p_customer_id;
........................................................................Right _JOIN......................................................................
SELECT *
FROM customers
RIGHT outer JOIN cards ON customers.customer_cardno=cards.card_number

--............................................................................INNER_JOIN...........................................

select * from customers


inner join accounts
on customer_id=10024883
…………………………………..cancatenation with different data type...................................

select concat (card_number, ' , ',card_expiry_date ) as card_data


from cards

- ...............................................................Describe...................................................................

sp_help cards

.
..........................................................STORE PROCEDURE...........................................................
......................................................................FOR ATM..................................................................
create procedure atm_procedure
as
begin
select atm_bnak_nmae,atm_address
from Atm
where atm_id in(1203,5423,6542)
end
exec atm_procedure

.......................................................................FOR CROSS JOIN...................................................


create procedure cross_procedure
as
begin
select transcations.transaction_type,customers.first_name,customers.city
from customers
cross join transcations
end
exec cross_procedure
.................................................................FOR BUILT_IN_FUNCTION.....................................
create procedure count_procedure
as
begin
SELECT COUNT (customer_id) as customercount , city
FROM customers
GROUP BY city
ORDER BY COUNT(customer_id) DESC;
end
exec count_procedure

.....................................................................................VIEW............................................................
...
create view customers_data
as
select atm_bnak_nmae,atm_address
from Atm
where atm_id in(1203,5423,6542)
SELECT * FROM customers_data

....................................................................VARIABLE...................................................................
....
declare @ATM_ID INT=5423
select Atm.atm_id
from Atm
where atm_id > @ATM_ID
-
.............................................................FUNCTIONS........................................................................
-.............................................................FOR ATM........................................................................

create function dbo.atmval(@ATM_ID INT)


returns int
begin
declare @a int
select @a =Atm.atm_id
from Atm
where atm_id > @ATM_ID
return @a
end
select dbo.atmval(6542) as atm_id

............................ TRANSACTIONS PERFORMED BY CUSTOMER.........................................

create function dbo.transactioncount(@Cust_ID INT)


returns varchar
begin
declare @a varchar
select @a= count( transaction_type)
from customers,transcations,performs
where
(customers.customer_id=performs.p_customer_id
and
performs.p_transaction_id=transcations.transaction_id
and
@Cust_ID=customer_id)
return @a
end
select dbo.transactioncount(12345780) as transact_type
NEW

--CREATE FUNCTION dbo.facilitate_counts(@atm_id int)


--returns varchar
--as
--begin
--declare @a varchar
--select @a=count(f_customer_id)
--from customers,Atm,facilitates
--where
--(Atm.atm_id=facilitates.f_atm_id
--and
--facilitates.f_customer_id=customers.customer_id
--and
--@atm_id=atm_id)
--return @a
--end
select dbo.facilitate_counts(1203) as countf

VARIABLES

declare @a varchar
select customers.first_name
from customers
where first_name like 'F%'

You might also like