diff --git a/sql/.vs/sql/v14/.ssms_suo b/sql/.vs/sql/v14/.ssms_suo index 668ec10..15c1480 100644 Binary files a/sql/.vs/sql/v14/.ssms_suo and b/sql/.vs/sql/v14/.ssms_suo differ diff --git a/sql/sql/setup_04_create_views.sql b/sql/sql/setup_04_create_views.sql new file mode 100644 index 0000000..88803a2 --- /dev/null +++ b/sql/sql/setup_04_create_views.sql @@ -0,0 +1,20 @@ +-- Creates views in the marketdb database +-- +-- Author: Andreas Zweili +-- Erstellt: 2017-08-08 +-- DB-Server SQL Server 2016 + +-- create RentedLocations view +use marketdb; +go + + CREATE VIEW RentedLocations AS + SELECT dbo.locations.location_name, + dbo.locations.location_capacity, + dbo.rent_prices.rent_price, + dbo.rents.rent_date, + dbo.members.email_address + FROM dbo.members + INNER JOIN dbo.rents ON dbo.members.member_id = dbo.rents.member_id + INNER JOIN dbo.rent_prices ON dbo.rents.rent_price_id = dbo.rent_prices.rent_price_id + INNER JOIN dbo.locations ON dbo.rent_prices.location_id = dbo.locations.location_id \ No newline at end of file diff --git a/sql/sql/sql.ssmssqlproj b/sql/sql/sql.ssmssqlproj index 59d5a35..7412d7b 100644 --- a/sql/sql/sql.ssmssqlproj +++ b/sql/sql/sql.ssmssqlproj @@ -19,6 +19,12 @@ + + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local)\SQLEXPRESS:True + (local)\SQLEXPRESS + + remove_database.sql + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local)\SQLEXPRESS:True (local)\SQLEXPRESS @@ -37,11 +43,11 @@ setup_03_insert_data.sql - + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local)\SQLEXPRESS:True (local)\SQLEXPRESS - setup_04_remove_database.sql + setup_04_create_views.sql