Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Create a new schema named 'Ratings' a. Execute the USE statement to use the Ratings schema b. Using the following data create three tables
1. Create a new schema named 'Ratings' a. Execute the USE statement to use the Ratings schema b. Using the following data create three tables (Rating, Vendor, Employee) in the Ratings schema and insert the data. All fields should be set to not null. Primary key is the first column (i.e. For the Rating table the primary key is RatingID). In parenthesis is the data type you should use for each field. c. Rating d. Employee e. Vendor 2. Write an sql statement that provides the average rating for 'Ned Jones' using the IN keyword and using 'Ned Jones' to determine the average ratings recorded by Ned Jones. a. Results: \begin{tabular}{l|l} \hline & avg(rating_value) \\ \hline & 2.8000 \end{tabular} 3. Write an sql statement that shows the Employee name (NOT number), Date, Year, and ratings for all records where the rating 3 and 5. a. Results: 4. Write an SQL statement that provides the average for all employees. Provide the employee ID, employee name and average as 'Average_Values'. Sort by descending average. a. Results: 5. Write an sql statement using the join on syntax to provide all the ratings fields and all of the vendor fields sorting by vendor name, year and rating_value a. Sample results this is NOT the whole results, it's just a first few rows: 6. Write an SQL statement that uses an outer join and produces the following sorted by vendor name, ratingid. Set the alias for the tables as the first letter (i.e. Rating " r ") a. Sample results: 7. Write an SQL statement that provides the number of ratings for each vendor name a. Results: 8. Write an SQL statement that provides the number of ratings for each employee name provide results as in question 15, but replace vendorname with employeename for the results
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