Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the Script for provided with this assignment do the following. Create a function called fn_GetUserName which will return the user name from the TUsers


Using the Script for provided with this assignment do the following.

  1. Create a function called fn_GetUserName which will return the user name from the TUsers table.
  2. Create a function called fn_GetSongs which will return the song title and artist from the TSongs table.
  3. Write a Select statement, using the functions, that will pull the user ID, the user name, the song ID and the song and artist from TUserFavoriteSongs table.
  4. Create a view from this select statement
  5. Write a Select statement to pull all records from the view (you may use * here)

Problem 2:

Using the Script for provided with this assignment do the following.

  1. Create a function called fn_GetCourse which will return the course name and description from the TCourses table.
  2. Create a function called fn_GetStudents which will return the last name, first name from the TStudents table. Name should be in format of LastName, FirstName.
  3. Create a function called fn_GetBook which will return the book name and author from the TBooks table.
  4. Create a function called fn_GetInstructor which will return the last name, first name from the TInstructors table. Name should be in format of LastName, FirstName.
  5. Write a Select statement, using the functions, that will pull the student ID, the student name, the course ID, name and description from TCourseStudents table.
  6. Write a Select statement, using the functions, that will pull the book ID, name, author, the course ID, name and description from TCourseBooks table.
  7. Write a Select statement, using the functions, that will pull the instructor ID, name, the course ID, name and description from TCourses table.
  8. Create a separate view for each of the select statements in steps 5, 6 & 7
  9. Write a Select statement to pull all records from the views (you may use * here)




Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Design Operation And Evaluation Of Mobile Communications

Authors: Gavriel Salvendy ,June Wei

1st Edition

3030770249, 978-3030770242

More Books

Students also viewed these Programming questions

Question

How do you explain your dataset?

Answered: 1 week ago