2. Based on Table 1 and Table 2, write Transact-SQL queries to answer the following questions. Provide the output of each query. (Hint: Use Microsoft SQL Server to write query) Table 1: PAINTING Painting No Title 2018 2023 2041 2942 2045 2103 Dawn Thunder The Starry Night Sunrise The Night Cafe The Gardener Sunset Table 2: PAINTER Painter No Title 10014 Mr 10015 10016 Ms Mr Name Johan Anne Michael Painter No 10016 10015 10015 10014 10015 10014 Phone 844-2573 894-1238 Null Gallery No Price (RM) 18 1000 18 1600 23 24 18 24 Email 900 7000 5600 2000 johan@gmail.com anne@gmail.com michael@gmail.com a) Write a query to display painter name and Contact column that contains phone number if known, otherwise email address. b) Identify the top three expensive painting. Show the painting title and unit price to complete the query.
2. Based on Table 1 and Table 2, write Transact-SQL queries to answer the following questions. Provide the output of each query. (Hint: Use Microsoft SQL Server to write query) Table 1: PAINTING Painting No Title 2018 2023 2041 2942 2045 2103 Dawn Thunder The Starry Night Sunrise The Night Cafe The Gardener Sunset Table 2: PAINTER Painter No Title 10014 Mr 10015 10016 Ms Mr Name Johan Anne Michael Painter No 10016 10015 10015 10014 10015 10014 Phone 844-2573 894-1238 Null Gallery No Price (RM) 18 1000 18 1600 23 24 18 24 Email 900 7000 5600 2000 johan@gmail.com anne@gmail.com michael@gmail.com a) Write a query to display painter name and Contact column that contains phone number if known, otherwise email address. b) Identify the top three expensive painting. Show the painting title and unit price to complete the query.
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images