Question
1. Create the following database and tables based on the following specifications. Database: Bank Customer (CustomerId, FirstName, LastName, E-mail, SSN) Account (AccountId, CustomerId, Balance) Primary
1. Create the following database and tables based on the following specifications.
Database: Bank
Customer (CustomerId, FirstName, LastName, E-mail, SSN)
Account (AccountId, CustomerId, Balance)
Primary keys should use the self-incrementing IDENTITY property.
Strings should use the NVARCHAR(50) type.
CustomerId is a FK in Account.
All properties should be required except Balance, which uses the MONEY type.
SSN should be numerical.
2. Insert 50 customers into the Customers table using a loop. For SSN, use a 9-digit random number. Research online how to generate the random number. Ensure that SSN does not belong to another customer.
3. Insert 20 accounts. For the Balance, generate a random decimal.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started