WGU D427 OA FINAL EXAM DATA MANAGEMENT APPLICATIONS
- COMPLETE QUESTIONS
AND DETAILED SOLUTIONS LATEST UPDATE THIS YEAR JUST
RELEASED
Question 1: Write a SQL statement to delete the row with the ID
value of 3 from the Book table.
Answer:
DELETE from Book WHERE ID = 3;
Question 2: Write a SQL statement to update the Year value to be
2022 for all books with a Year value of 2020.
Answer:
UPDATE Book
Question 3: Which query illustrates performing an outer join of the
Book table with a different table?
Answer:
SELECT Book.Title, A.Author FROM Book B
Question 4: Which rows will always be included in the result set if
Table A is inner joined with Table B?
Answer:
Only rows in Tables A and B that share the join condition
Question 5: Write a SQL query to return all data from the Book table
without directly referencing any column names.
,Answer:
SELECT * FROM Book;
Question 6: Write a SQL query to retrieve the Title and Genre
values for all records in the Book table with a Year value of 2020.
Ensure your result set returns the columns in the order indicated.
Answer:
SELECT Title, Genre
Question 7: Write a SQL query to display all Title values in
alphabetical order A-Z.
Answer:
SELECT Title
Question 8: Write a SQL query to output the unique Genre values
and the number of books with each genre value from the Book
table as GenreCount. Sort the results by the Genre in alphabetical
order A-Z. Ensure your result set returns the columns in the order
indicated.
Answer:
SELECT Genre, COUNT(*) AS GenreCount
Question 9: Write a SQL query to display both the Title and the
TotalSales (if available) for all books. Ensure your result set returns
the columns in the order indicated.
Answer:
SELECT Title, TotalSales
, Question 10: Write a SQL query to return how many books have a
Year value of 2019.
Answer:
SELECT COUNT(*)
Question 11: Hint: Use the COUNT() function and GROUP BY
clause.
Answer:
SELECT Year, COUNT(*) AS TotalMovies
Question 12: Hint: Perform a LEFT JOIN on the Movie and Rating
tables, matching the RatingCode and Code columns.
Answer:
SELECT Movie.Title, Movie.Year, Rating.Description
Question 13: Hint: Join the Employee table to itself using INNER
JOIN.
Answer:
SELECT E.FirstName AS Employee, M.FirstName AS Manager
Question 14: Hint: Perform a join on the Student and
LessonSchedule tables, matching the student IDs.
Answer:
SELECT LS.LessonDateTime, LS.HorseID, S.FirstName, S.LastName
Question 15: Hint: Perform a join on the LessonSchedule, Student,
and Horse tables, matching the student IDs and horse IDs.
Answer:
- COMPLETE QUESTIONS
AND DETAILED SOLUTIONS LATEST UPDATE THIS YEAR JUST
RELEASED
Question 1: Write a SQL statement to delete the row with the ID
value of 3 from the Book table.
Answer:
DELETE from Book WHERE ID = 3;
Question 2: Write a SQL statement to update the Year value to be
2022 for all books with a Year value of 2020.
Answer:
UPDATE Book
Question 3: Which query illustrates performing an outer join of the
Book table with a different table?
Answer:
SELECT Book.Title, A.Author FROM Book B
Question 4: Which rows will always be included in the result set if
Table A is inner joined with Table B?
Answer:
Only rows in Tables A and B that share the join condition
Question 5: Write a SQL query to return all data from the Book table
without directly referencing any column names.
,Answer:
SELECT * FROM Book;
Question 6: Write a SQL query to retrieve the Title and Genre
values for all records in the Book table with a Year value of 2020.
Ensure your result set returns the columns in the order indicated.
Answer:
SELECT Title, Genre
Question 7: Write a SQL query to display all Title values in
alphabetical order A-Z.
Answer:
SELECT Title
Question 8: Write a SQL query to output the unique Genre values
and the number of books with each genre value from the Book
table as GenreCount. Sort the results by the Genre in alphabetical
order A-Z. Ensure your result set returns the columns in the order
indicated.
Answer:
SELECT Genre, COUNT(*) AS GenreCount
Question 9: Write a SQL query to display both the Title and the
TotalSales (if available) for all books. Ensure your result set returns
the columns in the order indicated.
Answer:
SELECT Title, TotalSales
, Question 10: Write a SQL query to return how many books have a
Year value of 2019.
Answer:
SELECT COUNT(*)
Question 11: Hint: Use the COUNT() function and GROUP BY
clause.
Answer:
SELECT Year, COUNT(*) AS TotalMovies
Question 12: Hint: Perform a LEFT JOIN on the Movie and Rating
tables, matching the RatingCode and Code columns.
Answer:
SELECT Movie.Title, Movie.Year, Rating.Description
Question 13: Hint: Join the Employee table to itself using INNER
JOIN.
Answer:
SELECT E.FirstName AS Employee, M.FirstName AS Manager
Question 14: Hint: Perform a join on the Student and
LessonSchedule tables, matching the student IDs.
Answer:
SELECT LS.LessonDateTime, LS.HorseID, S.FirstName, S.LastName
Question 15: Hint: Perform a join on the LessonSchedule, Student,
and Horse tables, matching the student IDs and horse IDs.
Answer: