Question
Directions: Use SQL Server to make the following changes to the Sports database. Create a Patient_Large_Balance table in the Sports database with the structure below.
Directions: Use SQL Server to make the following changes to the Sports database.
Create a Patient_Large_Balance table in the Sports database with the structure below.
Column Type Length Decimal Places Nulls Allowed? Description
PatientNum CHAR 4 0 No Primary Key
LastName VARCHAR 25 0 No Last Name of Patient FirstName VARCHAR 25 0 Yes First Name of Patient ZipCode CHAR 5 0 Yes Patient Zip Code
Balance DECIMAL 8 2 Yes Patient Balance
1. Create a query to insert into the Patient_Large_Balance table the patient number, last name, first name, zip code and balance for those patients whose balance is greater than 500.00.
2. Sports has increased the balance by $200.00 for each patient in zip codes in 74071 and 76658. Update the patient balances accordingly.
3. Insert a row into the Patient_Large_Balance for a new patient. The patient number is 1022, the Last name is Brown, the first name is John, the zip code is 75212 and the balance is $755.35.
4. Delete the record from the Patient_Large_Balance where the zip code is 74093.
5. Sports Therapy increases the balance by 5% for all balances that are over 10 days old. Increase the balance for Patient numbers 1017 and 1020 by 5%. Hint: Multiply the balance by 1.05.
6. Patient number 1016 has continued her therapy and the new balance is unknown. Change the balance column for this patient to NULL.
7. In the Patient_Large_Balance, add a new character column to the table called Paid.
8. Set the value for the Paid column to N for all rows.
9. Change the value for the Paid column to Y for patients 1016 and 1020.
10. Change the first name column to reject nulls.
11. Delete Patient_Large_Balance table from the database.
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