MS SQL server Create a Scalar UDF that receives a social security number of a client, and calculates and returns the total balance in the client’s accounts:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

MS SQL server

Create a Scalar UDF that receives a social security number of a client, and calculates and returns the total balance in the client’s accounts:

CLIENT
CLIENTTRANSACTION
SSNO FirstName LastName Gender DOB
City
Address
ClientSSNo AcccountNo TransactionType TransactionDate Ammount
1/1/2002 Los Angeles 164 Hollywood Blvd.
172 West Brooklyn
1/1/1930Los Angeles 196 East Sunset Blvd.
1Bruce
Willis
male
1A01
withdrawal
4/15/2021
500
2 Milla
Jovovich
female 1/1/1975 New York
3Clint
Eastwood male
1A02
deposit
4/16/2021
2000
4Turkan
Soray
female 1/1/1945 San Diego
22 Coast Street
1A02
withdrawal
5/22/2021
800
1/1/1955 San Fransisco 941 Oakland Street
1/1/1943 Las Vegas
1/1/1937 Los Angeles
1/1/1940Texas
1/1/2003 New York
1/1/1937San Diego
1/1/1949 Las Vegas
1/1/1949 Los Angeles 505 Venice
5Kevin
Costner
male
2A03
withdrawal
3/11/2021
500
6Robert
De Niro
male
56 Jackpot Street
withdrawal
4/1/2021
2A03
250
7Yilmaz
Guney
male
46 Vermont Blvd.
2A03
deposit
5/13/2021
1000
8AI
Pacino
male
808 First Street
9 Danny
male
2A06
deposit
4/29/2021
3000
Devito
78 Freedom Street
10Jack
Nicholson male
ЗА04
deposit
4/29/2021
2000
99 Coastal Highway
42 Strip
11Tarik
Akan
male
4A05
withdrawal
3/11/2021
200
12 Kadir
Inanir
male
4A05
withdrawal
4/9/2021
500
4A05
deposit
4/18/2021
5000
ACCOUNT
4A05
withdrawal
5/22/2021
500
AccountNo AccountType OwnerSSNo Balance
5A06
deposit
3/30/2021
2000
checking
savings
checking
savings
savings
checking
A01
1
1200
5A06
deposit
4/30/2021
1500
A02
1
8200.5
5A07
deposit
2/1/2021
2000
АОЗ
3000
5A07
deposit
5/15/2021
6000
A04
9000
A05
4 45000.75
6A09
withdrawal
4/12/2021
100
A06
7100
6A09
withdrawal
4/13/2021
200
A07
savings
5
1355
6A09
withdrawal
4/14/2021
500
A08
savings
checking
checking
savings
savings
checking
checking
savings
checking
ckecking
9825
6A09
withdrawal
4/15/2021
100
A09
624
A10
7
2920
7A10
deposit
5/7/2021
2000
A11
7
950
8A12
withdrawal
5/22/2021
500
A12
8
43.65
10A05
deposit
3/12/2021
350
A13
10
7900
10A13
deposit
2/26/2021
2000
A14
11
2700
10A13
withdrawal
5/20/2021
1100
A15
11
8200.45
A16
12
30000
11A14
withdrawal
4/15/2021
500
A17
4 10000.25
12A16
deposit
4/16/2021
2000
Transcribed Image Text:CLIENT CLIENTTRANSACTION SSNO FirstName LastName Gender DOB City Address ClientSSNo AcccountNo TransactionType TransactionDate Ammount 1/1/2002 Los Angeles 164 Hollywood Blvd. 172 West Brooklyn 1/1/1930Los Angeles 196 East Sunset Blvd. 1Bruce Willis male 1A01 withdrawal 4/15/2021 500 2 Milla Jovovich female 1/1/1975 New York 3Clint Eastwood male 1A02 deposit 4/16/2021 2000 4Turkan Soray female 1/1/1945 San Diego 22 Coast Street 1A02 withdrawal 5/22/2021 800 1/1/1955 San Fransisco 941 Oakland Street 1/1/1943 Las Vegas 1/1/1937 Los Angeles 1/1/1940Texas 1/1/2003 New York 1/1/1937San Diego 1/1/1949 Las Vegas 1/1/1949 Los Angeles 505 Venice 5Kevin Costner male 2A03 withdrawal 3/11/2021 500 6Robert De Niro male 56 Jackpot Street withdrawal 4/1/2021 2A03 250 7Yilmaz Guney male 46 Vermont Blvd. 2A03 deposit 5/13/2021 1000 8AI Pacino male 808 First Street 9 Danny male 2A06 deposit 4/29/2021 3000 Devito 78 Freedom Street 10Jack Nicholson male ЗА04 deposit 4/29/2021 2000 99 Coastal Highway 42 Strip 11Tarik Akan male 4A05 withdrawal 3/11/2021 200 12 Kadir Inanir male 4A05 withdrawal 4/9/2021 500 4A05 deposit 4/18/2021 5000 ACCOUNT 4A05 withdrawal 5/22/2021 500 AccountNo AccountType OwnerSSNo Balance 5A06 deposit 3/30/2021 2000 checking savings checking savings savings checking A01 1 1200 5A06 deposit 4/30/2021 1500 A02 1 8200.5 5A07 deposit 2/1/2021 2000 АОЗ 3000 5A07 deposit 5/15/2021 6000 A04 9000 A05 4 45000.75 6A09 withdrawal 4/12/2021 100 A06 7100 6A09 withdrawal 4/13/2021 200 A07 savings 5 1355 6A09 withdrawal 4/14/2021 500 A08 savings checking checking savings savings checking checking savings checking ckecking 9825 6A09 withdrawal 4/15/2021 100 A09 624 A10 7 2920 7A10 deposit 5/7/2021 2000 A11 7 950 8A12 withdrawal 5/22/2021 500 A12 8 43.65 10A05 deposit 3/12/2021 350 A13 10 7900 10A13 deposit 2/26/2021 2000 A14 11 2700 10A13 withdrawal 5/20/2021 1100 A15 11 8200.45 A16 12 30000 11A14 withdrawal 4/15/2021 500 A17 4 10000.25 12A16 deposit 4/16/2021 2000
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Types of Protocols
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education