create a sql script to create the rents view

This commit is contained in:
Andreas Zweili 2017-08-08 21:53:14 +02:00
parent 9f1f0d0139
commit d210e1522e
3 changed files with 28 additions and 2 deletions

Binary file not shown.

View File

@ -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

View File

@ -19,6 +19,12 @@
</LogicalFolder>
<LogicalFolder Name="Queries" Type="0" Sorted="true">
<Items>
<FileNode Name="remove_database.sql">
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local)\SQLEXPRESS:True</AssociatedConnectionMoniker>
<AssociatedConnSrvName>(local)\SQLEXPRESS</AssociatedConnSrvName>
<AssociatedConnUserName />
<FullPath>remove_database.sql</FullPath>
</FileNode>
<FileNode Name="setup_01_create_database.sql">
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local)\SQLEXPRESS:True</AssociatedConnectionMoniker>
<AssociatedConnSrvName>(local)\SQLEXPRESS</AssociatedConnSrvName>
@ -37,11 +43,11 @@
<AssociatedConnUserName />
<FullPath>setup_03_insert_data.sql</FullPath>
</FileNode>
<FileNode Name="setup_04_remove_database.sql">
<FileNode Name="setup_04_create_views.sql">
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local)\SQLEXPRESS:True</AssociatedConnectionMoniker>
<AssociatedConnSrvName>(local)\SQLEXPRESS</AssociatedConnSrvName>
<AssociatedConnUserName />
<FullPath>setup_04_remove_database.sql</FullPath>
<FullPath>setup_04_create_views.sql</FullPath>
</FileNode>
</Items>
</LogicalFolder>