Question: Write SQL statements to answer each of the following questions: 1. Alter the UniversityStudent table to implement a Dual Key system. You will create a
Write SQL statements to answer each of the following questions:
1. Alter the UniversityStudent table to implement a Dual Key system. You will create a business key field called StudentNumber which will be applied to the student records. The values for this key will be made up of the last two digits of the students year of birth, followed by the last four digits of the phone number. For example, the StudentNumber value for the student "Clifford Wall" should be, '882331'. Ensure that your StudentNumber field follows all of the recommendations in order to be used as a Business Key.
2. Alter the UniversityStudent table to add data integrity constraints which enforce the following: StudentDOB value must be in the past StudentCity should default to 'Ashland' StudentImageFile must end with .jpg
3. Alter the UniversityStudent table to add a timestamp field for concurrency control.
4. Alter the UniversityStudent table to add auditing fields for UpdatedBy and UpdatedOn. Ensure that existing records are populated using the following default values in these fields: UpdatedBy = 'user' UpdatedOn = '01/01/2000'
5. After populating the existing values in the auditing fields, change the default value for UpdatedOn so that going forward, it uses the current date and time. Perform these actions in a Transaction to ensure that both actions succeed or fail as one unit of work.
6. Modify the Ironwood database to use the Simple recovery model. (Include this SQL statement in your script even if your database already uses this model.)
7. Write SQL code to create a full backup of the Ironwood database and all of its database objects. Name your backup file, IronwoodYourName.bak. (Substitute your own name in place of "YourName")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
