Question: Assignment: This is a continuation with the database created in Assignment 5. Include a screen shot of the database diagram for your database. Create Table-Valued
Assignment: This is a continuation with the database created in Assignment 5. Include a screen shot of the database diagram for your database. Create Table-Valued function, create View to demonstrate its use, and include a screen shot of the results of running the View. Create Scalar-Valued function, create View to demonstrate its use, and include a screen shot of the results of running the View.
Purpose: To demonstrate your understanding of Views, Table Functions, and Scalar Functions
Requirements:
- Note: This assignment includes 4 DDL SQL Statements and 3 screen shots
- Include a "screen shot" of the SQL Server Management Studio "Database Diagram" showing the tables, columns, keys, and relationships
- Show the SQL statement that creates a Table Function that returns the CourseID, Semester, and AverageScore for given a student
- Show an SQL statement that creates View that uses this table function with the StudentID of 1234
- Include a "screen shot" of the SQL Server Management Studio that shows the output of running the View above
- Show the SQL statement that creates a Scalar Function that will return the average for all scores for a given student
- Show an SQL statement that creates a View that uses this scalar function showing FirstName, LastName, and AllScoreAverage for all students
- Include a "screen shot" of the SQL Server Management Studio that shows the output of running the View above
Output:
The output from the table function using student 1234 should look similar to this:
| CourseID | Semester | AverageScore |
|---|---|---|
| CIS4301 | 202001 | 84 |
| CIS4352 | 202001 | 87 |
| CIS3365 | 202006 | 82 |
| CIS3315 | 202006 | 75 |
| CIS4301 | 202008 | 62 |
The output from the scalar function for all students should look similar to this:
| FirstName | LastName | AllScoreAverage |
|---|---|---|
| John | Smith | 78 |
| Tony | Costa | 87 |
| William | Bonin | 78 |
| David | Carpenter | 78 |
| Richard | Chase | 81 |
| Carroll | Cole | 77 |
| Arthur | Bishop | 89 |
| Charles | Albright | 85 |
| Joe | Ball | 84 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
