text: USE [Monopoly]
  GO
  
  /****** Object:  View [Game].[vwPropertyRent]    Script Date: 2/19/2022 10:26:25 AM ******/
  SET ANSI_NULLS ON
  GO
  
  SET QUOTED_IDENTIFIER ON
  GO
  
  
  CREATE VIEW [Game].[vwPropertyRent] AS
  SELECT b.[property],
  	CAST(CASE
  		WHEN [houses] = 0 THEN a.[rent]
  		WHEN [houses] = 1 THEN a.[rent_1_house]
  		WHEN [houses] = 2 THEN a.[rent_2_houses]
  		WHEN [houses] = 3 THEN a.[rent_3_houses]
  		WHEN [houses] = 4 THEN a.[rent_4_houses]
  		WHEN [hotel] = 1 THEN a.[rent_hotel]
  	END AS INT) AS [rent]
  FROM [Game].[Properties] a
  JOIN [Player].[PropertiesOwned] b ON a.[name] = b.[property];
  GO
  
  
  