add all the current files
This commit is contained in:
parent
7031a6b83f
commit
44b60a030e
|
@ -10,6 +10,7 @@ Session.vim
|
|||
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
*.exe
|
||||
|
||||
# mstest test results
|
||||
TestResults
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# SQL Server Management Studio Solution File, Format Version 13.00
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{4F2E2C19-372F-40D8-9FA7-9D2138C6997A}") = "Abo", "Abo.ssmssqlproj", "{E9AB9EF8-DB2A-4E9E-A25C-2965879D3FBE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Default|Default = Default|Default
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E9AB9EF8-DB2A-4E9E-A25C-2965879D3FBE}.Default|Default.ActiveCfg = Default
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0"?>
|
||||
<SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="Abo">
|
||||
<Items>
|
||||
<LogicalFolder Name="Connections" Type="2" Sorted="true">
|
||||
<Items>
|
||||
<ConnectionNode Name="WIN-10-SFR\SQL2016:WIN-LAPTOP\andreas">
|
||||
<Created>2017-03-09T18:45:47.4395012+01:00</Created>
|
||||
<Type>SQL</Type>
|
||||
<Server>WIN-10-SFR\SQL2016</Server>
|
||||
<UserName />
|
||||
<Authentication>Windows Authentication</Authentication>
|
||||
<InitialDB />
|
||||
<LoginTimeout>15</LoginTimeout>
|
||||
<ExecutionTimeout>0</ExecutionTimeout>
|
||||
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
|
||||
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
|
||||
</ConnectionNode>
|
||||
<ConnectionNode Name="WIN-LAPTOP\SQLEXPRESS:WIN-LAPTOP\andreas">
|
||||
<Created>2017-03-11T08:58:56.8900889+01:00</Created>
|
||||
<Type>SQL</Type>
|
||||
<Server>WIN-LAPTOP\SQLEXPRESS</Server>
|
||||
<UserName />
|
||||
<Authentication>Windows Authentication</Authentication>
|
||||
<InitialDB />
|
||||
<LoginTimeout>15</LoginTimeout>
|
||||
<ExecutionTimeout>0</ExecutionTimeout>
|
||||
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
|
||||
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
|
||||
</ConnectionNode>
|
||||
</Items>
|
||||
</LogicalFolder>
|
||||
<LogicalFolder Name="Queries" Type="0" Sorted="true">
|
||||
<Items>
|
||||
<FileNode Name="create_tables.sql">
|
||||
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-10-SFR\SQL2016:True</AssociatedConnectionMoniker>
|
||||
<AssociatedConnSrvName>WIN-10-SFR\SQL2016</AssociatedConnSrvName>
|
||||
<AssociatedConnUserName />
|
||||
<FullPath>create_tables.sql</FullPath>
|
||||
</FileNode>
|
||||
<FileNode Name="insert_data.sql">
|
||||
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-10-SFR\SQL2016:True</AssociatedConnectionMoniker>
|
||||
<AssociatedConnSrvName>WIN-10-SFR\SQL2016</AssociatedConnSrvName>
|
||||
<AssociatedConnUserName />
|
||||
<FullPath>insert_data.sql</FullPath>
|
||||
</FileNode>
|
||||
<FileNode Name="remove_tables.sql">
|
||||
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-10-SFR\SQL2016:True</AssociatedConnectionMoniker>
|
||||
<AssociatedConnSrvName>WIN-10-SFR\SQL2016</AssociatedConnSrvName>
|
||||
<AssociatedConnUserName />
|
||||
<FullPath>remove_tables.sql</FullPath>
|
||||
</FileNode>
|
||||
<FileNode Name="select_statements.sql">
|
||||
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-LAPTOP\SQLEXPRESS:True</AssociatedConnectionMoniker>
|
||||
<AssociatedConnSrvName>WIN-LAPTOP\SQLEXPRESS</AssociatedConnSrvName>
|
||||
<AssociatedConnUserName />
|
||||
<FullPath>select_statements.sql</FullPath>
|
||||
</FileNode>
|
||||
</Items>
|
||||
</LogicalFolder>
|
||||
<LogicalFolder Name="Miscellaneous" Type="3" Sorted="true">
|
||||
<Items />
|
||||
</LogicalFolder>
|
||||
</Items>
|
||||
</SqlWorkbenchSqlProject>
|
|
@ -0,0 +1,45 @@
|
|||
-- Creates the tables for the Abo DB
|
||||
--
|
||||
-- Author: Andreas Zweili
|
||||
-- Erstellt: 2017-01-06
|
||||
-- DB-Server SQL Server 2016
|
||||
|
||||
use Abo
|
||||
|
||||
if not exists (select * from sysobjects where name='anrede')
|
||||
CREATE TABLE anrede (
|
||||
anrede_id int identity(1,1) not null,
|
||||
anrede varchar(50) not null,
|
||||
constraint pk_anrede primary key (anrede_id)
|
||||
);
|
||||
|
||||
if not exists (select * from sysobjects where name='ort')
|
||||
CREATE TABLE ort (
|
||||
ort_id int identity(1,1) not null,
|
||||
ortsname varchar(50) not null,
|
||||
postleizahl int not null,
|
||||
constraint pk_ort primary key (ort_id)
|
||||
);
|
||||
|
||||
if not exists (select * from sysobjects where name='abo')
|
||||
CREATE TABLE abo (
|
||||
abo_id int identity(1,1) not null,
|
||||
abo_name varchar(50) not null,
|
||||
abo_gebuehr money not null,
|
||||
constraint pk_abo primary key (abo_id)
|
||||
);
|
||||
|
||||
if not exists (select * from sysobjects where name='mitglied')
|
||||
CREATE TABLE mitglied (
|
||||
mitglied_id int identity(1,1) not null,
|
||||
anrede_id int not null,
|
||||
mitglied_name varchar(50) not null,
|
||||
mitglied_vorname varchar(50) not null,
|
||||
eintrittsdatum date not null,
|
||||
ort_id int not null,
|
||||
abo_id int not null,
|
||||
constraint pk_mitglied primary key (mitglied_id),
|
||||
foreign key (anrede_id) references dbo.anrede(anrede_id),
|
||||
foreign key (ort_id) references dbo.ort(ort_id),
|
||||
foreign key (abo_id) references dbo.abo(abo_id)
|
||||
);
|
|
@ -0,0 +1,32 @@
|
|||
-- Removes the tables for the Abo DB
|
||||
--
|
||||
-- Author: Andreas Zweili
|
||||
-- Erstellt: 2017-01-06
|
||||
-- DB-Server SQL Server 2016
|
||||
|
||||
use Abo;
|
||||
|
||||
insert into dbo.abo (abo_name, abo_gebuehr)
|
||||
values ('Student','500'),
|
||||
('Monatsabo','150'),
|
||||
('Jahresabo','1000');
|
||||
|
||||
insert into dbo.ort (ortsname, postleizahl)
|
||||
values ('Zürich','8000'),
|
||||
('Zürich','8021'),
|
||||
('Zürich','8048'),
|
||||
('Bern','3000'),
|
||||
('Basel','4000');
|
||||
|
||||
insert into dbo.anrede (anrede)
|
||||
values ('Herr'),
|
||||
('Frau');
|
||||
|
||||
insert into dbo.mitglied (anrede_id, mitglied_name, mitglied_vorname, eintrittsdatum, ort_id, abo_id)
|
||||
values ('2','Müller','Karina','2005-08-30','4','3'),
|
||||
('2','Pozzi','Isabelle','2005-07-15','4','2'),
|
||||
('1','Groz','Thomas','2005-07-15','5','1'),
|
||||
('1','Balmelli','Marco','1990-01-01','1','1'),
|
||||
('2','Bürgin','Sandra','1989-05-01','2','3'),
|
||||
('1','Keller','Georg','1996-11-26','2','3'),
|
||||
('1','Emmenegger','Reto','1994-10-01','3','2');
|
|
@ -0,0 +1,19 @@
|
|||
-- Removes the tables for the Abo DB
|
||||
--
|
||||
-- Author: Andreas Zweili
|
||||
-- Erstellt: 2017-01-06
|
||||
-- DB-Server SQL Server 2016
|
||||
|
||||
use Abo;
|
||||
|
||||
if exists (select * from sysobjects where name='mitglied')
|
||||
drop table mitglied;
|
||||
|
||||
if exists (select * from sysobjects where name='anrede')
|
||||
drop table anrede;
|
||||
|
||||
if exists (select * from sysobjects where name='ort')
|
||||
drop table ort;
|
||||
|
||||
if exists (select * from sysobjects where name='abo')
|
||||
drop table abo;
|
|
@ -0,0 +1,389 @@
|
|||
<<<<<<< HEAD
|
||||
|
||||
use Abo
|
||||
|
||||
-- A1.1
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
order by eintrittsdatum ASC;
|
||||
|
||||
-- A1.2
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where eintrittsdatum >= convert(date, '01.01.2000', 104)
|
||||
order by mitglied_name, mitglied_vorname ASC;
|
||||
|
||||
-- A1.3
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where mitglied_name like'B%';
|
||||
|
||||
-- A1.4
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where mitglied_id < '50'
|
||||
and eintrittsdatum < '1995-01-01';
|
||||
|
||||
-- A1.5
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where mitglied_name like '%zz%'
|
||||
and eintrittsdatum > '2000-01-01';
|
||||
|
||||
-- A1.6
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where eintrittsdatum between '1994-01-01' and '1997-01-01'
|
||||
order by eintrittsdatum;
|
||||
|
||||
|
||||
-- A1.7
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where mitglied_name like '%e%' or
|
||||
mitglied_vorname like '%a';
|
||||
|
||||
|
||||
-- A2.1
|
||||
|
||||
select * from mitglied m
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
where abo.abo_gebuehr <= '500'
|
||||
order by m.mitglied_name, m.mitglied_vorname ASC;
|
||||
|
||||
|
||||
|
||||
-- A2.2
|
||||
|
||||
select * from mitglied m
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
where abo.abo_name = 'Student'
|
||||
and o.ortsname = 'Bern'
|
||||
and a.anrede = 'Herr';
|
||||
|
||||
-- A2.3
|
||||
|
||||
select * from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
where a.anrede = 'Herr'
|
||||
and (o.ortsname = 'Bern'
|
||||
or o.ortsname = 'Zürich');
|
||||
|
||||
-- A2.4
|
||||
|
||||
select * from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
where a.anrede = 'Herr'
|
||||
and not abo.abo_name = 'Student'
|
||||
and not o.ortsname = 'Bern';
|
||||
|
||||
-- A2.5
|
||||
|
||||
select * from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
where a.anrede = 'Frau'
|
||||
or m.eintrittsdatum > '2005-01-01';
|
||||
|
||||
|
||||
-- A2.6
|
||||
|
||||
select * from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
|
||||
where (a.anrede = 'Herr'
|
||||
and o.ortsname = 'Zürich')
|
||||
and (abo.abo_name ='Student'
|
||||
or abo.abo_name = 'Jahresabo');
|
||||
|
||||
-- 3.1
|
||||
|
||||
select concat(m.mitglied_vorname, ',', m.mitglied_name) as 'Mitglied Name'
|
||||
from mitglied m;
|
||||
|
||||
-- 3.2
|
||||
|
||||
select upper(concat(m.mitglied_vorname, ',', m.mitglied_name)) as 'Mitglied Name'
|
||||
from mitglied m;
|
||||
|
||||
-- 3.3
|
||||
|
||||
select m.mitglied_vorname, m.mitglied_name from mitglied m
|
||||
order by len(m.mitglied_name) DESC;
|
||||
|
||||
-- 3.4
|
||||
|
||||
select concat(left(m.mitglied_vorname, 1),'.', left(m.mitglied_name, 1),'.')
|
||||
as 'Initialen' from mitglied m
|
||||
order by Initialen ASC;
|
||||
|
||||
-- 3.5
|
||||
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum from mitglied m
|
||||
order by m.eintrittsdatum DESC;
|
||||
|
||||
-- 3.6
|
||||
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum from mitglied m
|
||||
where m.eintrittsdatum like '2005-%'
|
||||
|
||||
--4.1
|
||||
select min(a.abo_gebuehr) as 'Tiefster Preis',
|
||||
max(a.abo_gebuehr) as 'Höchster Preis',
|
||||
avg(a.abo_gebuehr) as 'Durchnittlicher Preis'
|
||||
from abo a;
|
||||
|
||||
--4.2
|
||||
select count(m.anrede_id) from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
where a.anrede = 'Frau';
|
||||
|
||||
--4.3
|
||||
select m.mitglied_name, m.mitglied_name, m.eintrittsdatum, c.count
|
||||
from mitglied m
|
||||
inner join (select eintrittsdatum, count(eintrittsdatum) as count
|
||||
from mitglied
|
||||
where eintrittsdatum like '2005-%'
|
||||
group by eintrittsdatum)
|
||||
c on m.eintrittsdatum = c.eintrittsdatum;
|
||||
|
||||
--4.4
|
||||
select count(o.ortsname) as 'Zürcher'
|
||||
from mitglied m
|
||||
inner join ort o on o.ort_id = m.ort_id
|
||||
where o.ortsname = 'Zürich';
|
||||
|
||||
--4.5
|
||||
select abo_name, count(m.abo_id) as 'Mitglieder pro Abo'
|
||||
from mitglied m
|
||||
inner join abo a on m.abo_id = a.abo_id
|
||||
group by abo_name;
|
||||
|
||||
--4.6
|
||||
select sum(a.abo_gebuehr) as 'Gebuehren Gesamt'
|
||||
from mitglied m
|
||||
inner join abo a on m.abo_id = a.abo_id;
|
||||
=======
|
||||
|
||||
use Abo
|
||||
|
||||
-- A1.1
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
order by eintrittsdatum ASC;
|
||||
|
||||
-- A1.2
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where eintrittsdatum >= convert(date, '01.01.2000', 104)
|
||||
order by mitglied_name, mitglied_vorname ASC;
|
||||
|
||||
-- A1.3
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where mitglied_name like'B%';
|
||||
|
||||
-- A1.4
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where mitglied_id < '50'
|
||||
and eintrittsdatum < '1995-01-01';
|
||||
|
||||
-- A1.5
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where mitglied_name like '%zz%'
|
||||
and eintrittsdatum > '2000-01-01';
|
||||
|
||||
-- A1.6
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where eintrittsdatum between '1994-01-01' and '1997-01-01'
|
||||
order by eintrittsdatum;
|
||||
|
||||
|
||||
-- A1.7
|
||||
|
||||
select mitglied_name, mitglied_vorname, eintrittsdatum
|
||||
from mitglied
|
||||
where mitglied_name like '%e%' or
|
||||
mitglied_vorname like '%a';
|
||||
|
||||
|
||||
-- A2.1
|
||||
|
||||
select * from mitglied m
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
where abo.abo_gebuehr <= '500'
|
||||
order by m.mitglied_name, m.mitglied_vorname ASC;
|
||||
|
||||
|
||||
|
||||
-- A2.2
|
||||
|
||||
select * from mitglied m
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
where abo.abo_name = 'Student'
|
||||
and o.ortsname = 'Bern'
|
||||
and a.anrede = 'Herr';
|
||||
|
||||
-- A2.3
|
||||
|
||||
select * from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
where a.anrede = 'Herr'
|
||||
and (o.ortsname = 'Bern'
|
||||
or o.ortsname = 'Zürich');
|
||||
|
||||
-- A2.4
|
||||
|
||||
select * from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
where a.anrede = 'Herr'
|
||||
and not abo.abo_name = 'Student'
|
||||
and not o.ortsname = 'Bern';
|
||||
|
||||
-- A2.5
|
||||
|
||||
select * from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
where a.anrede = 'Frau'
|
||||
or m.eintrittsdatum > '2005-01-01';
|
||||
|
||||
|
||||
-- A2.6
|
||||
|
||||
select * from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
|
||||
where (a.anrede = 'Herr'
|
||||
and o.ortsname = 'Zürich')
|
||||
and (abo.abo_name ='Student'
|
||||
or abo.abo_name = 'Jahresabo');
|
||||
|
||||
-- 3.1
|
||||
|
||||
select concat(m.mitglied_vorname, ',', m.mitglied_name) as 'Mitglied Name'
|
||||
from mitglied m;
|
||||
|
||||
-- 3.2
|
||||
|
||||
select upper(concat(m.mitglied_vorname, ',', m.mitglied_name)) as 'Mitglied Name'
|
||||
from mitglied m;
|
||||
|
||||
-- 3.3
|
||||
|
||||
select m.mitglied_vorname, m.mitglied_name from mitglied m
|
||||
order by len(m.mitglied_name) DESC;
|
||||
|
||||
-- 3.4
|
||||
|
||||
select concat(left(m.mitglied_vorname, 1),'.', left(m.mitglied_name, 1),'.')
|
||||
as 'Initialen' from mitglied m
|
||||
order by Initialen ASC;
|
||||
|
||||
-- 3.5
|
||||
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum from mitglied m
|
||||
order by m.eintrittsdatum DESC;
|
||||
|
||||
-- 3.6
|
||||
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum from mitglied m
|
||||
where m.eintrittsdatum like '2005-%'
|
||||
|
||||
--4.1
|
||||
select min(a.abo_gebuehr) as 'Tiefster Preis',
|
||||
max(a.abo_gebuehr) as 'Höchster Preis',
|
||||
avg(a.abo_gebuehr) as 'Durchnittlicher Preis'
|
||||
from abo a;
|
||||
|
||||
--4.2
|
||||
select count(m.anrede_id) from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
where a.anrede = 'Frau';
|
||||
|
||||
--4.3
|
||||
select m.mitglied_name, m.mitglied_name, m.eintrittsdatum, c.count
|
||||
from mitglied m
|
||||
inner join (select eintrittsdatum, count(eintrittsdatum) as count
|
||||
from mitglied
|
||||
where eintrittsdatum like '2005-%'
|
||||
group by eintrittsdatum)
|
||||
c on m.eintrittsdatum = c.eintrittsdatum;
|
||||
|
||||
--4.4
|
||||
select count(o.ortsname) as 'Zürcher'
|
||||
from mitglied m
|
||||
inner join ort o on o.ort_id = m.ort_id
|
||||
where o.ortsname = 'Zürich';
|
||||
|
||||
--4.5
|
||||
select abo_name, count(m.abo_id) as 'Mitglieder pro Abo'
|
||||
from mitglied m
|
||||
inner join abo a on m.abo_id = a.abo_id
|
||||
group by abo_name;
|
||||
|
||||
--4.6
|
||||
select sum(a.abo_gebuehr) as 'Gebuehren Gesamt'
|
||||
from mitglied m
|
||||
inner join abo a on m.abo_id = a.abo_id;
|
||||
>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# SQL Server Management Studio Solution File, Format Version 13.00
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{4F2E2C19-372F-40D8-9FA7-9D2138C6997A}") = "Berater", "Berater\Berater.ssmssqlproj", "{1ED92CA1-F8E8-490F-A9DA-238BAF608815}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Default|Default = Default|Default
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1ED92CA1-F8E8-490F-A9DA-238BAF608815}.Default|Default.ActiveCfg = Default
|
||||
{99C42AB5-A547-4F03-8899-9E70D65646EB}.Default|Default.ActiveCfg = Default
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0"?>
|
||||
<SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="Berater">
|
||||
<Items>
|
||||
<LogicalFolder Name="Connections" Type="2" Sorted="true">
|
||||
<Items>
|
||||
<ConnectionNode Name="WIN-LAPTOP\SQLEXPRESS:WIN-LAPTOP\andreas">
|
||||
<Created>2016-12-16T20:48:33.9312639+01:00</Created>
|
||||
<Type>SQL</Type>
|
||||
<Server>WIN-LAPTOP\SQLEXPRESS</Server>
|
||||
<UserName />
|
||||
<Authentication>Windows Authentication</Authentication>
|
||||
<InitialDB>Berater</InitialDB>
|
||||
<LoginTimeout>15</LoginTimeout>
|
||||
<ExecutionTimeout>0</ExecutionTimeout>
|
||||
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
|
||||
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
|
||||
</ConnectionNode>
|
||||
</Items>
|
||||
</LogicalFolder>
|
||||
<LogicalFolder Name="Queries" Type="0" Sorted="true">
|
||||
<Items>
|
||||
<FileNode Name="create_tables.sql">
|
||||
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-LAPTOP\SQLEXPRESS:True</AssociatedConnectionMoniker>
|
||||
<AssociatedConnSrvName>WIN-LAPTOP\SQLEXPRESS</AssociatedConnSrvName>
|
||||
<AssociatedConnUserName />
|
||||
<FullPath>create_tables.sql</FullPath>
|
||||
</FileNode>
|
||||
<FileNode Name="insert_data.sql">
|
||||
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-LAPTOP\SQLEXPRESS:True</AssociatedConnectionMoniker>
|
||||
<AssociatedConnSrvName>WIN-LAPTOP\SQLEXPRESS</AssociatedConnSrvName>
|
||||
<AssociatedConnUserName />
|
||||
<FullPath>insert_data.sql</FullPath>
|
||||
</FileNode>
|
||||
<FileNode Name="remove_tables.sql">
|
||||
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-LAPTOP\SQLEXPRESS:True</AssociatedConnectionMoniker>
|
||||
<AssociatedConnSrvName>WIN-LAPTOP\SQLEXPRESS</AssociatedConnSrvName>
|
||||
<AssociatedConnUserName />
|
||||
<FullPath>remove_tables.sql</FullPath>
|
||||
</FileNode>
|
||||
</Items>
|
||||
</LogicalFolder>
|
||||
<LogicalFolder Name="Miscellaneous" Type="3" Sorted="true">
|
||||
<Items />
|
||||
</LogicalFolder>
|
||||
</Items>
|
||||
</SqlWorkbenchSqlProject>
|
|
@ -0,0 +1,177 @@
|
|||
<<<<<<< HEAD
|
||||
-- IBZ 2. Schultag
|
||||
--
|
||||
-- Berater Datenbank
|
||||
-------------------------------------------
|
||||
|
||||
-- Datenbank BeraterDB anwählen
|
||||
use Berater
|
||||
go
|
||||
|
||||
-- Tabelle Kunde erstellen
|
||||
CREATE TABLE KUNDE
|
||||
(
|
||||
KUNDENNR INTEGER NOT NULL,
|
||||
KUNDENNAME VARCHAR(50) NULL,
|
||||
VORNAME VARCHAR(50) NULL,
|
||||
CONSTRAINT PK_KUNDE PRIMARY KEY (KUNDENNR)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Aufgabe erstellen
|
||||
CREATE TABLE AUFGABE
|
||||
(
|
||||
AUFGABEID INTEGER NOT NULL,
|
||||
AUFGABE VARCHAR(50) NULL
|
||||
CONSTRAINT PK_AUFGABE PRIMARY KEY (AUFGABEID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Berater erstellen
|
||||
CREATE TABLE BERATER
|
||||
(
|
||||
BERATERID INTEGER NOT NULL,
|
||||
AUFGABEID INTEGER NOT NULL,
|
||||
BERATERNAME VARCHAR(50),
|
||||
STUNDENLOHN FLOAT,
|
||||
CONSTRAINT PK_BERATER PRIMARY KEY (BERATERID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Arbeit erstellen
|
||||
CREATE TABLE ARBEIT
|
||||
(
|
||||
KUNDENNR INTEGER NOT NULL,
|
||||
BERATERID INTEGER NOT NULL,
|
||||
AZSTUNDEN FLOAT,
|
||||
CONSTRAINT PK_ARBEIT PRIMARY KEY (KUNDENNR, BERATERID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Foreign Key Constraints hinzufügen
|
||||
ALTER TABLE BERATER ADD CONSTRAINT FK_BERATER_AUFGABE
|
||||
FOREIGN KEY (AUFGABEID) REFERENCES AUFGABE (AUFGABEID);
|
||||
go
|
||||
|
||||
ALTER TABLE ARBEIT ADD CONSTRAINT FK_ARBEIT_BERATER
|
||||
FOREIGN KEY (BERATERID) REFERENCES BERATER(BERATERID);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[FK_ARBEIT_KUNDE]', 'F') IS NULL
|
||||
ALTER TABLE ARBEIT ADD CONSTRAINT FK_ARBEIT_KUNDE
|
||||
FOREIGN KEY (KUNDENNR) REFERENCES KUNDE(KUNDENNR);
|
||||
go
|
||||
|
||||
-- Unique Constraints
|
||||
ALTER TABLE AUFGABE ADD CONSTRAINT UQ_AUFGABE_AUFGABE
|
||||
UNIQUE (AUFGABE);
|
||||
go
|
||||
|
||||
-- Check Constraints
|
||||
ALTER TABLE BERATER ADD CONSTRAINT C_BERATER_STUNDENLOHN
|
||||
CHECK (STUNDENLOHN > 0.0);
|
||||
go
|
||||
|
||||
-- Default Constraints
|
||||
ALTER TABLE ARBEIT
|
||||
ADD CONSTRAINT DF_ARBEIT_AZSTUNDEN
|
||||
DEFAULT 0.0 FOR AZSTUNDEN;
|
||||
|
||||
|
||||
/*
|
||||
C = CHECK constraint
|
||||
D = DEFAULT (constraint or stand-alone)
|
||||
F = FOREIGN KEY constraint
|
||||
PK = PRIMARY KEY constraint
|
||||
R = Rule (old-style, stand-alone)
|
||||
UQ = UNIQUE constraint
|
||||
*/
|
||||
=======
|
||||
-- IBZ 2. Schultag
|
||||
--
|
||||
-- Berater Datenbank
|
||||
-------------------------------------------
|
||||
|
||||
-- Datenbank BeraterDB anwählen
|
||||
use Berater
|
||||
go
|
||||
|
||||
-- Tabelle Kunde erstellen
|
||||
CREATE TABLE KUNDE
|
||||
(
|
||||
KUNDENNR INTEGER NOT NULL,
|
||||
KUNDENNAME VARCHAR(50) NULL,
|
||||
VORNAME VARCHAR(50) NULL,
|
||||
CONSTRAINT PK_KUNDE PRIMARY KEY (KUNDENNR)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Aufgabe erstellen
|
||||
CREATE TABLE AUFGABE
|
||||
(
|
||||
AUFGABEID INTEGER NOT NULL,
|
||||
AUFGABE VARCHAR(50) NULL
|
||||
CONSTRAINT PK_AUFGABE PRIMARY KEY (AUFGABEID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Berater erstellen
|
||||
CREATE TABLE BERATER
|
||||
(
|
||||
BERATERID INTEGER NOT NULL,
|
||||
AUFGABEID INTEGER NOT NULL,
|
||||
BERATERNAME VARCHAR(50),
|
||||
STUNDENLOHN FLOAT,
|
||||
CONSTRAINT PK_BERATER PRIMARY KEY (BERATERID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Arbeit erstellen
|
||||
CREATE TABLE ARBEIT
|
||||
(
|
||||
KUNDENNR INTEGER NOT NULL,
|
||||
BERATERID INTEGER NOT NULL,
|
||||
AZSTUNDEN FLOAT,
|
||||
CONSTRAINT PK_ARBEIT PRIMARY KEY (KUNDENNR, BERATERID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Foreign Key Constraints hinzufügen
|
||||
ALTER TABLE BERATER ADD CONSTRAINT FK_BERATER_AUFGABE
|
||||
FOREIGN KEY (AUFGABEID) REFERENCES AUFGABE (AUFGABEID);
|
||||
go
|
||||
|
||||
ALTER TABLE ARBEIT ADD CONSTRAINT FK_ARBEIT_BERATER
|
||||
FOREIGN KEY (BERATERID) REFERENCES BERATER(BERATERID);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[FK_ARBEIT_KUNDE]', 'F') IS NULL
|
||||
ALTER TABLE ARBEIT ADD CONSTRAINT FK_ARBEIT_KUNDE
|
||||
FOREIGN KEY (KUNDENNR) REFERENCES KUNDE(KUNDENNR);
|
||||
go
|
||||
|
||||
-- Unique Constraints
|
||||
ALTER TABLE AUFGABE ADD CONSTRAINT UQ_AUFGABE_AUFGABE
|
||||
UNIQUE (AUFGABE);
|
||||
go
|
||||
|
||||
-- Check Constraints
|
||||
ALTER TABLE BERATER ADD CONSTRAINT C_BERATER_STUNDENLOHN
|
||||
CHECK (STUNDENLOHN > 0.0);
|
||||
go
|
||||
|
||||
-- Default Constraints
|
||||
ALTER TABLE ARBEIT
|
||||
ADD CONSTRAINT DF_ARBEIT_AZSTUNDEN
|
||||
DEFAULT 0.0 FOR AZSTUNDEN;
|
||||
|
||||
|
||||
/*
|
||||
C = CHECK constraint
|
||||
D = DEFAULT (constraint or stand-alone)
|
||||
F = FOREIGN KEY constraint
|
||||
PK = PRIMARY KEY constraint
|
||||
R = Rule (old-style, stand-alone)
|
||||
UQ = UNIQUE constraint
|
||||
*/
|
||||
>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5
|
|
@ -0,0 +1,61 @@
|
|||
<<<<<<< HEAD
|
||||
-- IBZ 2. Schultag
|
||||
--
|
||||
-- Berater Datenbank
|
||||
-------------------------------------------
|
||||
|
||||
-- Datenbank BeraterDB anwählen
|
||||
use Berater
|
||||
go
|
||||
|
||||
-- Foreign Key löschen
|
||||
ALTER TABLE ARBEIT
|
||||
DROP CONSTRAINT IF EXISTS FK_ARBEIT_KUNDE;
|
||||
ALTER TABLE ARBEIT
|
||||
DROP CONSTRAINT IF EXISTS FK_ARBEIT_BERATER;
|
||||
ALTER TABLE BERATER
|
||||
DROP CONSTRAINT IF EXISTS FK_BERATER_AUFGABE;
|
||||
go
|
||||
|
||||
|
||||
IF OBJECT_ID('dbo.KUNDE','U') IS NOT NULL
|
||||
DROP TABLE dbo.KUNDE;
|
||||
|
||||
|
||||
-- Alle Tabellen löschen
|
||||
DROP TABLE IF EXISTS ARBEIT;
|
||||
DROP TABLE IF EXISTS KUNDE;
|
||||
DROP TABLE IF EXISTS BERATER;
|
||||
DROP TABLE IF EXISTS AUFGABE;
|
||||
go
|
||||
=======
|
||||
-- IBZ 2. Schultag
|
||||
--
|
||||
-- Berater Datenbank
|
||||
-------------------------------------------
|
||||
|
||||
-- Datenbank BeraterDB anwählen
|
||||
use Berater
|
||||
go
|
||||
|
||||
-- Foreign Key löschen
|
||||
ALTER TABLE ARBEIT
|
||||
DROP CONSTRAINT IF EXISTS FK_ARBEIT_KUNDE;
|
||||
ALTER TABLE ARBEIT
|
||||
DROP CONSTRAINT IF EXISTS FK_ARBEIT_BERATER;
|
||||
ALTER TABLE BERATER
|
||||
DROP CONSTRAINT IF EXISTS FK_BERATER_AUFGABE;
|
||||
go
|
||||
|
||||
|
||||
IF OBJECT_ID('dbo.KUNDE','U') IS NOT NULL
|
||||
DROP TABLE dbo.KUNDE;
|
||||
|
||||
|
||||
-- Alle Tabellen löschen
|
||||
DROP TABLE IF EXISTS ARBEIT;
|
||||
DROP TABLE IF EXISTS KUNDE;
|
||||
DROP TABLE IF EXISTS BERATER;
|
||||
DROP TABLE IF EXISTS AUFGABE;
|
||||
go
|
||||
>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5
|
|
@ -0,0 +1,145 @@
|
|||
<<<<<<< HEAD
|
||||
USE Berater;
|
||||
|
||||
|
||||
-- Alles löschen
|
||||
delete from ARBEIT;
|
||||
delete from BERATER;
|
||||
delete from KUNDE;
|
||||
delete from AUFGABE;
|
||||
|
||||
GO
|
||||
|
||||
-- Daten einfügen
|
||||
|
||||
-- Aufgaben Tabelle
|
||||
INSERT INTO AUFGABE (AUFGABEID, AUFGABE)
|
||||
VALUES (1,'IT-Berater');
|
||||
|
||||
INSERT INTO AUFGABE (AUFGABEID, AUFGABE)
|
||||
VALUES (2,'Finanzberater');
|
||||
|
||||
|
||||
-- Kundentabelle
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (1, 'Emil Schmidt', null);
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (2, 'Hans Müller', null);
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (3, 'Johanna Schulze', null);
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (4, 'Markus Schulte', null);
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (5, 'Markus Huber', null);
|
||||
|
||||
-- Beratertabelle
|
||||
insert into BERATER([BERATERID],[AUFGABEID],[BERATERNAME],[STUNDENLOHN])
|
||||
values(1, 1, 'Helena Müller', 50);
|
||||
insert into BERATER([BERATERID],[AUFGABEID],[BERATERNAME],[STUNDENLOHN])
|
||||
values(2, 2, 'Ingo Fuchs', 45);
|
||||
insert into BERATER([BERATERID],[AUFGABEID],[BERATERNAME],[STUNDENLOHN])
|
||||
values(3, 1, 'John Müller', 60);
|
||||
insert into BERATER([BERATERID],[AUFGABEID],[BERATERNAME],[STUNDENLOHN])
|
||||
values(4, 1, 'Elisabeth Schulz', 30);
|
||||
|
||||
GO
|
||||
|
||||
-- Arbeit Tabelle
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(1, 1, 3);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(1, 2, 5);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(1, 3, 7);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(1, 4, 8);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(2, 2, 4);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(2, 3, 6);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(3, 1, 2);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(3, 3, 30);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(4, 1, 10);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(4, 2, 5);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(4, 4, 5);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(5, 3, 12);
|
||||
|
||||
=======
|
||||
USE Berater;
|
||||
|
||||
|
||||
-- Alles löschen
|
||||
delete from ARBEIT;
|
||||
delete from BERATER;
|
||||
delete from KUNDE;
|
||||
delete from AUFGABE;
|
||||
|
||||
GO
|
||||
|
||||
-- Daten einfügen
|
||||
|
||||
-- Aufgaben Tabelle
|
||||
INSERT INTO AUFGABE (AUFGABEID, AUFGABE)
|
||||
VALUES (1,'IT-Berater');
|
||||
|
||||
INSERT INTO AUFGABE (AUFGABEID, AUFGABE)
|
||||
VALUES (2,'Finanzberater');
|
||||
|
||||
|
||||
-- Kundentabelle
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (1, 'Emil Schmidt', null);
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (2, 'Hans Müller', null);
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (3, 'Johanna Schulze', null);
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (4, 'Markus Schulte', null);
|
||||
insert into KUNDE([KUNDENNR], [KUNDENNAME], [VORNAME])
|
||||
values (5, 'Markus Huber', null);
|
||||
|
||||
-- Beratertabelle
|
||||
insert into BERATER([BERATERID],[AUFGABEID],[BERATERNAME],[STUNDENLOHN])
|
||||
values(1, 1, 'Helena Müller', 50);
|
||||
insert into BERATER([BERATERID],[AUFGABEID],[BERATERNAME],[STUNDENLOHN])
|
||||
values(2, 2, 'Ingo Fuchs', 45);
|
||||
insert into BERATER([BERATERID],[AUFGABEID],[BERATERNAME],[STUNDENLOHN])
|
||||
values(3, 1, 'John Müller', 60);
|
||||
insert into BERATER([BERATERID],[AUFGABEID],[BERATERNAME],[STUNDENLOHN])
|
||||
values(4, 1, 'Elisabeth Schulz', 30);
|
||||
|
||||
GO
|
||||
|
||||
-- Arbeit Tabelle
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(1, 1, 3);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(1, 2, 5);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(1, 3, 7);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(1, 4, 8);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(2, 2, 4);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(2, 3, 6);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(3, 1, 2);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(3, 3, 30);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(4, 1, 10);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(4, 2, 5);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(4, 4, 5);
|
||||
insert into ARBEIT([KUNDENNR], [BERATERID], [AZSTUNDEN])
|
||||
values(5, 3, 12);
|
||||
|
||||
>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5
|
|
@ -0,0 +1,28 @@
|
|||
-- Creates the tables for the Berater DB
|
||||
--
|
||||
-- Author: Andreas Zweili
|
||||
-- Erstellt: 2016-12-16
|
||||
-- DB-Server SQL Server 2016
|
||||
|
||||
use Berater;
|
||||
|
||||
alter table berater
|
||||
drop constraint if exists fk_berater_aufgabe;
|
||||
go
|
||||
|
||||
alter table arbeit
|
||||
drop constraint if exists fk_arbeit_berater;
|
||||
go
|
||||
|
||||
alter table arbeit
|
||||
drop constraint if exists fk_arbeit_kunde;
|
||||
go
|
||||
|
||||
if exists (select * from sysobjects where name='arbeit')
|
||||
drop table arbeit;
|
||||
|
||||
if exists (select * from sysobjects where name='kunde')
|
||||
drop table kunde;
|
||||
|
||||
if exists (select * from sysobjects where name='aufgabe')
|
||||
drop table aufgabe;
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# SQL Server Management Studio Solution File, Format Version 13.00
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{4F2E2C19-372F-40D8-9FA7-9D2138C6997A}") = "Datenbank", "Datenbank\Datenbank.ssmssqlproj", "{53EB19F7-5CC2-4642-A883-5E5F6D71B01C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Default|Default = Default|Default
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{53EB19F7-5CC2-4642-A883-5E5F6D71B01C}.Default|Default.ActiveCfg = Default
|
||||
{A0493E39-8A83-48C1-8036-CFC7CAF6B3FC}.Default|Default.ActiveCfg = Default
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="SqlWorkbenchSqlProject">
|
||||
<Items>
|
||||
<LogicalFolder Name="Connections" Type="2" />
|
||||
<LogicalFolder Name="Queries" Type="0" />
|
||||
<LogicalFolder Name="Miscellaneous" Type="3" />
|
||||
|
||||
</Items>
|
||||
</SqlWorkbenchSqlProject>
|
|
@ -0,0 +1,20 @@
|
|||
<<<<<<< HEAD
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="SqlWorkbenchSqlProject">
|
||||
<Items>
|
||||
<LogicalFolder Name="Connections" Type="2" />
|
||||
<LogicalFolder Name="Queries" Type="0" />
|
||||
<LogicalFolder Name="Miscellaneous" Type="3" />
|
||||
|
||||
</Items>
|
||||
=======
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="SqlWorkbenchSqlProject">
|
||||
<Items>
|
||||
<LogicalFolder Name="Connections" Type="2" />
|
||||
<LogicalFolder Name="Queries" Type="0" />
|
||||
<LogicalFolder Name="Miscellaneous" Type="3" />
|
||||
|
||||
</Items>
|
||||
>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5
|
||||
</SqlWorkbenchSqlProject>
|
|
@ -0,0 +1,41 @@
|
|||
<<<<<<< HEAD
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# SQL Server Management Studio Solution File, Format Version 13.00
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{4F2E2C19-372F-40D8-9FA7-9D2138C6997A}") = "SEP Prüfung", "SEP Prüfung\SEP Prüfung.ssmssqlproj", "{5E08CD23-A66E-41A8-8B64-1258B2FCF100}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Default|Default = Default|Default
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5E08CD23-A66E-41A8-8B64-1258B2FCF100}.Default|Default.ActiveCfg = Default
|
||||
{F4D0BFC7-DA70-4D8E-BE36-1086597F63D3}.Default|Default.ActiveCfg = Default
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
=======
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# SQL Server Management Studio Solution File, Format Version 13.00
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{4F2E2C19-372F-40D8-9FA7-9D2138C6997A}") = "SEP Prüfung", "SEP Prüfung\SEP Prüfung.ssmssqlproj", "{5E08CD23-A66E-41A8-8B64-1258B2FCF100}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Default|Default = Default|Default
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5E08CD23-A66E-41A8-8B64-1258B2FCF100}.Default|Default.ActiveCfg = Default
|
||||
{F4D0BFC7-DA70-4D8E-BE36-1086597F63D3}.Default|Default.ActiveCfg = Default
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5
|
|
@ -0,0 +1,20 @@
|
|||
<<<<<<< HEAD
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="SqlWorkbenchSqlProject">
|
||||
<Items>
|
||||
<LogicalFolder Name="Connections" Type="2" />
|
||||
<LogicalFolder Name="Queries" Type="0" />
|
||||
<LogicalFolder Name="Miscellaneous" Type="3" />
|
||||
|
||||
</Items>
|
||||
=======
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="SqlWorkbenchSqlProject">
|
||||
<Items>
|
||||
<LogicalFolder Name="Connections" Type="2" />
|
||||
<LogicalFolder Name="Queries" Type="0" />
|
||||
<LogicalFolder Name="Miscellaneous" Type="3" />
|
||||
|
||||
</Items>
|
||||
>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5
|
||||
</SqlWorkbenchSqlProject>
|
|
@ -0,0 +1,233 @@
|
|||
<<<<<<< HEAD
|
||||
-- Dateiname zweili_andreas_A1.sql
|
||||
--
|
||||
-- Beschreibung: SEP Datenbank 2 Gartencenter
|
||||
--
|
||||
-- Autor: Andreas Zweili
|
||||
-- Datum: 11.03.2017
|
||||
-- Server Version: SQL Server 2016
|
||||
|
||||
-- Tabelle Lieferant erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Lieferant')
|
||||
CREATE TABLE Lieferant (
|
||||
LFR_CODE int identity(1,1) not null,
|
||||
LFR_NAME varchar(40) null,
|
||||
LFR_ADRESSE varchar(40) null,
|
||||
LFR_PLZ int null,
|
||||
LFR_WOHNORT varchar(40) null
|
||||
constraint PK_LFR_CODE primary key (LFR_CODE)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Bestellung erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Bestellung')
|
||||
CREATE TABLE Bestellung (
|
||||
BES_ID int identity(1,1) not null,
|
||||
BES_BESTELLDATUM date not null,
|
||||
BES_LIEFERDATUM date not null,
|
||||
BES_BETRAG float not null,
|
||||
LFR_CODE int not null
|
||||
constraint PK_BES_ID primary key (BES_ID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Pflanze erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Pflanze')
|
||||
CREATE TABLE Pflanze (
|
||||
PFL_ID int identity(1,1) not null,
|
||||
PFL_NAME varchar(40) null,
|
||||
PFL_SORTE varchar(40) null,
|
||||
PFL_FARBE varchar(40) null,
|
||||
PFL_HOEHE float null,
|
||||
PFL_BEGIN date null,
|
||||
PFL_END date null,
|
||||
PFL_PREIS float null
|
||||
constraint PK_PFL_ID primary key (PFL_ID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Angebot erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Angebot')
|
||||
CREATE TABLE Angebot (
|
||||
ANG_ID int identity(1,1) not null,
|
||||
PFL_ID int not null,
|
||||
LFR_CODE int not null,
|
||||
ANG_PREIS varchar(40) null,
|
||||
ANG_LIEFERZEIT int null
|
||||
constraint PK_ANG_ID primary key (ANG_ID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Bestelldaten erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Bestelldaten')
|
||||
CREATE TABLE Bestelldaten (
|
||||
ANG_ID int not null,
|
||||
BES_ID int not null,
|
||||
BED_ANZAHL int null,
|
||||
BED_EINZELPREIS float null
|
||||
constraint PK_BESTELLDATEN primary key (ANG_ID, BES_ID)
|
||||
);
|
||||
go
|
||||
|
||||
|
||||
-- Foreign Key Constraints hinzufügen
|
||||
IF OBJECT_ID('dbo.[FK_LFR_CODE]', 'F') IS NULL
|
||||
ALTER TABLE Bestellung ADD CONSTRAINT FK_LFR_CODE
|
||||
FOREIGN KEY (LFR_CODE) REFERENCES Lieferant (LFR_CODE);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[FK_PFL_ID]', 'F') IS NULL
|
||||
ALTER TABLE Angebot ADD CONSTRAINT FK_PFL_ID
|
||||
FOREIGN KEY (PFL_ID) REFERENCES Pflanze (PFL_ID);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[FK_LFR_CODE_ANGEBOT]', 'F') IS NULL
|
||||
ALTER TABLE Angebot ADD CONSTRAINT FK_LFR_CODE_ANGEBOT
|
||||
FOREIGN KEY (LFR_CODE) REFERENCES Lieferant (LFR_CODE);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[FK_BESTELLUNG_ANGEBOT]', 'F') IS NULL
|
||||
ALTER TABLE Bestelldaten ADD CONSTRAINT FK_BESTELLUNG_ANGEBOT
|
||||
FOREIGN KEY (ANG_ID) REFERENCES Angebot(ANG_ID),
|
||||
FOREIGN KEY (BES_ID) REFERENCES Bestellung(BES_ID);
|
||||
go
|
||||
|
||||
-- Check Constraints on Pflanze
|
||||
IF OBJECT_ID('dbo.[C_PFL_PREIS]', 'C') IS NULL
|
||||
ALTER TABLE Pflanze ADD CONSTRAINT C_PFL_PREIS
|
||||
CHECK (Pflanze.PFL_PREIS > 0.0);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[C_PFL_END]', 'C') IS NULL
|
||||
ALTER TABLE Pflanze ADD CONSTRAINT C_PFL_END
|
||||
CHECK (Pflanze.PFL_BEGIN < Pflanze.PFL_END);
|
||||
go
|
||||
|
||||
-- Check Constraint on Bestellung
|
||||
|
||||
IF OBJECT_ID('dbo.[C_BES_LIEFERDATUM]', 'C') IS NULL
|
||||
ALTER TABLE Bestellung ADD CONSTRAINT C_BES_LIEFERDATUM
|
||||
CHECK (Bestellung.BES_LIEFERDATUM > CURRENT_TIMESTAMP)
|
||||
go
|
||||
=======
|
||||
-- Dateiname zweili_andreas_A1.sql
|
||||
--
|
||||
-- Beschreibung: SEP Datenbank 2 Gartencenter
|
||||
--
|
||||
-- Autor: Andreas Zweili
|
||||
-- Datum: 11.03.2017
|
||||
-- Server Version: SQL Server 2016
|
||||
|
||||
-- Tabelle Lieferant erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Lieferant')
|
||||
CREATE TABLE Lieferant (
|
||||
LFR_CODE int identity(1,1) not null,
|
||||
LFR_NAME varchar(40) null,
|
||||
LFR_ADRESSE varchar(40) null,
|
||||
LFR_PLZ int null,
|
||||
LFR_WOHNORT varchar(40) null
|
||||
constraint PK_LFR_CODE primary key (LFR_CODE)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Bestellung erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Bestellung')
|
||||
CREATE TABLE Bestellung (
|
||||
BES_ID int identity(1,1) not null,
|
||||
BES_BESTELLDATUM date not null,
|
||||
BES_LIEFERDATUM date not null,
|
||||
BES_BETRAG float not null,
|
||||
LFR_CODE int not null
|
||||
constraint PK_BES_ID primary key (BES_ID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Pflanze erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Pflanze')
|
||||
CREATE TABLE Pflanze (
|
||||
PFL_ID int identity(1,1) not null,
|
||||
PFL_NAME varchar(40) null,
|
||||
PFL_SORTE varchar(40) null,
|
||||
PFL_FARBE varchar(40) null,
|
||||
PFL_HOEHE float null,
|
||||
PFL_BEGIN date null,
|
||||
PFL_END date null,
|
||||
PFL_PREIS float null
|
||||
constraint PK_PFL_ID primary key (PFL_ID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Angebot erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Angebot')
|
||||
CREATE TABLE Angebot (
|
||||
ANG_ID int identity(1,1) not null,
|
||||
PFL_ID int not null,
|
||||
LFR_CODE int not null,
|
||||
ANG_PREIS varchar(40) null,
|
||||
ANG_LIEFERZEIT int null
|
||||
constraint PK_ANG_ID primary key (ANG_ID)
|
||||
);
|
||||
go
|
||||
|
||||
-- Tabelle Bestelldaten erstellen
|
||||
use Gartencenter
|
||||
if not exists (select * from sysobjects where name='Bestelldaten')
|
||||
CREATE TABLE Bestelldaten (
|
||||
ANG_ID int not null,
|
||||
BES_ID int not null,
|
||||
BED_ANZAHL int null,
|
||||
BED_EINZELPREIS float null
|
||||
constraint PK_BESTELLDATEN primary key (ANG_ID, BES_ID)
|
||||
);
|
||||
go
|
||||
|
||||
|
||||
-- Foreign Key Constraints hinzufügen
|
||||
IF OBJECT_ID('dbo.[FK_LFR_CODE]', 'F') IS NULL
|
||||
ALTER TABLE Bestellung ADD CONSTRAINT FK_LFR_CODE
|
||||
FOREIGN KEY (LFR_CODE) REFERENCES Lieferant (LFR_CODE);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[FK_PFL_ID]', 'F') IS NULL
|
||||
ALTER TABLE Angebot ADD CONSTRAINT FK_PFL_ID
|
||||
FOREIGN KEY (PFL_ID) REFERENCES Pflanze (PFL_ID);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[FK_LFR_CODE_ANGEBOT]', 'F') IS NULL
|
||||
ALTER TABLE Angebot ADD CONSTRAINT FK_LFR_CODE_ANGEBOT
|
||||
FOREIGN KEY (LFR_CODE) REFERENCES Lieferant (LFR_CODE);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[FK_BESTELLUNG_ANGEBOT]', 'F') IS NULL
|
||||
ALTER TABLE Bestelldaten ADD CONSTRAINT FK_BESTELLUNG_ANGEBOT
|
||||
FOREIGN KEY (ANG_ID) REFERENCES Angebot(ANG_ID),
|
||||
FOREIGN KEY (BES_ID) REFERENCES Bestellung(BES_ID);
|
||||
go
|
||||
|
||||
-- Check Constraints on Pflanze
|
||||
IF OBJECT_ID('dbo.[C_PFL_PREIS]', 'C') IS NULL
|
||||
ALTER TABLE Pflanze ADD CONSTRAINT C_PFL_PREIS
|
||||
CHECK (Pflanze.PFL_PREIS > 0.0);
|
||||
go
|
||||
|
||||
IF OBJECT_ID('dbo.[C_PFL_END]', 'C') IS NULL
|
||||
ALTER TABLE Pflanze ADD CONSTRAINT C_PFL_END
|
||||
CHECK (Pflanze.PFL_BEGIN < Pflanze.PFL_END);
|
||||
go
|
||||
|
||||
-- Check Constraint on Bestellung
|
||||
|
||||
IF OBJECT_ID('dbo.[C_BES_LIEFERDATUM]', 'C') IS NULL
|
||||
ALTER TABLE Bestellung ADD CONSTRAINT C_BES_LIEFERDATUM
|
||||
CHECK (Bestellung.BES_LIEFERDATUM > CURRENT_TIMESTAMP)
|
||||
go
|
||||
>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5
|
|
@ -0,0 +1,142 @@
|
|||
<<<<<<< HEAD
|
||||
-- Dateiname zweili_andreas_A2.sql
|
||||
--
|
||||
-- Beschreibung: SEP Datenbank 2
|
||||
--
|
||||
-- Autor: Andreas Zweili
|
||||
-- Datum: 11.03.2017
|
||||
|
||||
|
||||
-- A2.1
|
||||
use Abo
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
order by m.mitglied_name ASC, m.mitglied_vorname ASC;
|
||||
|
||||
|
||||
|
||||
-- A2.2
|
||||
use Abo
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum, abo.abo_gebuehr from mitglied m
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
where abo.abo_gebuehr > '1000';
|
||||
|
||||
-- A2.3
|
||||
use Abo
|
||||
select * from mitglied m
|
||||
where m.mitglied_name like '%ll%'
|
||||
order by m.mitglied_id DESC;
|
||||
|
||||
-- A2.4
|
||||
use Abo
|
||||
select * from mitglied m
|
||||
where m.eintrittsdatum is NULL;
|
||||
|
||||
-- A2.5
|
||||
use Abo
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum, o.postleizahl, o.ortsname
|
||||
from mitglied m
|
||||
inner join ort o on m.ort_id = o.ort_id
|
||||
where m.eintrittsdatum between convert(date, '01.01.1990', 104) and convert(date, '31.12.1995', 104)
|
||||
order by o.postleizahl asc;
|
||||
|
||||
-- A2.6
|
||||
use Abo
|
||||
select a.anrede, m.mitglied_name, m.mitglied_vorname, o.postleizahl, o.ortsname, abo_name from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
inner join abo
|
||||
on m.abo_id = abo.abo_id
|
||||
where a.anrede = 'Herr'
|
||||
and (o.ortsname = 'Basel'
|
||||
or o.ortsname = 'Zürich');
|
||||
|
||||
-- A2.7
|
||||
|
||||
update abo set
|
||||
abo.abo_gebuehr = '550'
|
||||
where abo.abo_name = 'Student';
|
||||
update abo set
|
||||
abo.abo_gebuehr = '165'
|
||||
where abo.abo_name = 'Monatsabo';
|
||||
|
||||
-- A2.8
|
||||
|
||||
delete from mitglied
|
||||
where mitglied_name = 'Keller'
|
||||
=======
|
||||
-- Dateiname zweili_andreas_A2.sql
|
||||
--
|
||||
-- Beschreibung: SEP Datenbank 2
|
||||
--
|
||||
-- Autor: Andreas Zweili
|
||||
-- Datum: 11.03.2017
|
||||
|
||||
|
||||
-- A2.1
|
||||
use Abo
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
order by m.mitglied_name ASC, m.mitglied_vorname ASC;
|
||||
|
||||
|
||||
|
||||
-- A2.2
|
||||
use Abo
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum, abo.abo_gebuehr from mitglied m
|
||||
inner join abo
|
||||
on abo.abo_id = m.abo_id
|
||||
where abo.abo_gebuehr > '1000';
|
||||
|
||||
-- A2.3
|
||||
use Abo
|
||||
select * from mitglied m
|
||||
where m.mitglied_name like '%ll%'
|
||||
order by m.mitglied_id DESC;
|
||||
|
||||
-- A2.4
|
||||
use Abo
|
||||
select * from mitglied m
|
||||
where m.eintrittsdatum is NULL;
|
||||
|
||||
-- A2.5
|
||||
use Abo
|
||||
select m.mitglied_name, m.mitglied_vorname, m.eintrittsdatum, o.postleizahl, o.ortsname
|
||||
from mitglied m
|
||||
inner join ort o on m.ort_id = o.ort_id
|
||||
where m.eintrittsdatum between convert(date, '01.01.1990', 104) and convert(date, '31.12.1995', 104)
|
||||
order by o.postleizahl asc;
|
||||
|
||||
-- A2.6
|
||||
use Abo
|
||||
select a.anrede, m.mitglied_name, m.mitglied_vorname, o.postleizahl, o.ortsname, abo_name from mitglied m
|
||||
inner join anrede a
|
||||
on a.anrede_id = m.anrede_id
|
||||
inner join ort o
|
||||
on o.ort_id = m.ort_id
|
||||
inner join abo
|
||||
on m.abo_id = abo.abo_id
|
||||
where a.anrede = 'Herr'
|
||||
and (o.ortsname = 'Basel'
|
||||
or o.ortsname = 'Zürich');
|
||||
|
||||
-- A2.7
|
||||
|
||||
update abo set
|
||||
abo.abo_gebuehr = '550'
|
||||
where abo.abo_name = 'Student';
|
||||
update abo set
|
||||
abo.abo_gebuehr = '165'
|
||||
where abo.abo_name = 'Monatsabo';
|
||||
|
||||
-- A2.8
|
||||
|
||||
delete from mitglied
|
||||
where mitglied_name = 'Keller'
|
||||
>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5
|
||||
and mitglied_vorname = 'Georg';
|
|
@ -0,0 +1,13 @@
|
|||
-- a template to create a table
|
||||
--
|
||||
-- Author: Andreas Zweili
|
||||
-- Erstellt: 2016-12-16
|
||||
-- DB-Server SQL Server 2016
|
||||
use [2_Semester];
|
||||
if not exists (select * from sysobjects where name='MyTest')
|
||||
CREATE TABLE MyTest (
|
||||
id int identity(1,1) not null,
|
||||
lastname varchar(50) null,
|
||||
firstname varchar(50) null
|
||||
constraint pk_mytest primary key (id)
|
||||
);
|
|
@ -0,0 +1,57 @@
|
|||
SELECT * from r1;
|
||||
SELECT * from r2;
|
||||
|
||||
-- Projektion PROJ(r1, A, B)
|
||||
select R1.A, R1.B
|
||||
from R1
|
||||
|
||||
-- Restriction REST(r1, A=1)
|
||||
select *
|
||||
from R1
|
||||
where R1.A=1
|
||||
|
||||
-- Produkt PRODUCT(R1, R2)
|
||||
select *
|
||||
from R1, R2
|
||||
|
||||
-- Difference, DIFFERENCE(R1, R2)
|
||||
select R1.A, R1.B, R1.C
|
||||
from R1
|
||||
except
|
||||
select R2.A, R2.B, R2.C
|
||||
from R2
|
||||
|
||||
-- Schnittmenge (Intersection), INTERSECT(R1, R2)
|
||||
select R1.A, R1.B, R1.C
|
||||
from R1
|
||||
intersect
|
||||
select R2.A, R2.B, R2.C
|
||||
from R2
|
||||
|
||||
-- Vereinigung (Union), UNION(R1, R2)
|
||||
select R1.A, R1.B, R1.C
|
||||
from R1
|
||||
union
|
||||
select R2.A, R2.B, R2.C
|
||||
from R2
|
||||
|
||||
-- Inner Join, JOIN(R1, R1.A=R2.A, R2)
|
||||
select *
|
||||
from R1 inner join R2
|
||||
on R1.A = R2.A
|
||||
|
||||
-- Outer left Join, JOIN(R1, R1.A*=R2.A, R2)
|
||||
select *
|
||||
from R1 left join R2
|
||||
on R1.A = R2.A
|
||||
|
||||
-- Outer rigth Join, JOIN(R1, R1.A*=R2.A, R2)
|
||||
select *
|
||||
from R1 right join R2
|
||||
on R1.A = R2.A;
|
||||
|
||||
-- Full Outer Join, FULL OUTER JOIN(R1, R1.A=R2.A, R2)
|
||||
select *
|
||||
from R1 full join R2
|
||||
on R1.A = R2.A;
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26403.7
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{96F5B37F-FF2E-470A-BD49-44B2C1CDB5D0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{96F5B37F-FF2E-470A-BD49-44B2C1CDB5D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{96F5B37F-FF2E-470A-BD49-44B2C1CDB5D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{96F5B37F-FF2E-470A-BD49-44B2C1CDB5D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{96F5B37F-FF2E-470A-BD49-44B2C1CDB5D0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ConsoleApp1
|
||||
{
|
||||
class Calculator
|
||||
{
|
||||
public static void StartCalc()
|
||||
{
|
||||
var processInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "calc.exe",
|
||||
};
|
||||
|
||||
using (var process = Process.Start(processInfo))
|
||||
{
|
||||
process.Start();
|
||||
}
|
||||
}
|
||||
public static void IsProcessRunning(string sProcessName)
|
||||
{
|
||||
Process[] proc = System.Diagnostics.Process.GetProcessesByName(sProcessName);
|
||||
while (proc.Length > 0)
|
||||
{
|
||||
Console.WriteLine("calc.exe beendet");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{96F5B37F-FF2E-470A-BD49-44B2C1CDB5D0}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>ConsoleApp1</RootNamespace>
|
||||
<AssemblyName>ConsoleApp1</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Calculator.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ConsoleApp1
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Calculator.StartCalc();
|
||||
Calculator.IsProcessRunning("Calculator.exe");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ConsoleApp1")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ConsoleApp1")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("96f5b37f-ff2e-470a-bd49-44b2c1cdb5d0")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26403.7
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBZ-Vererbung", "IBZ-Vererbung\IBZ-Vererbung.csproj", "{F778E5BE-27C6-4D03-B358-B4D83E7FF437}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5AA9D2E1-79A7-480F-9C6C-FA3C3AB71AC8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F778E5BE-27C6-4D03-B358-B4D83E7FF437}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F778E5BE-27C6-4D03-B358-B4D83E7FF437}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F778E5BE-27C6-4D03-B358-B4D83E7FF437}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F778E5BE-27C6-4D03-B358-B4D83E7FF437}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IBZ_Vererbung
|
||||
{
|
||||
abstract class Animal
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string GibLaut()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
class Cat : Animal
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class Dog : Animal
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F778E5BE-27C6-4D03-B358-B4D83E7FF437}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>ConsoleApp1</RootNamespace>
|
||||
<AssemblyName>ConsoleApp1</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Animal.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IBZ_Vererbung
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Cat c = new Cat();
|
||||
c.ID = 5;
|
||||
|
||||
Console.WriteLine(c.ID);
|
||||
Console.ReadKey();
|
||||
|
||||
Dog d = new Dog();
|
||||
d.Name = "Sparky";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ConsoleApp1")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ConsoleApp1")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("f778e5be-27c6-4d03-b358-b4d83e7ff437")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26403.7
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "calculator", "calculator\calculator.csproj", "{F8D33850-0601-41CB-89AB-E347AD7309DB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F8D33850-0601-41CB-89AB-E347AD7309DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F8D33850-0601-41CB-89AB-E347AD7309DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F8D33850-0601-41CB-89AB-E347AD7309DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F8D33850-0601-41CB-89AB-E347AD7309DB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace calculator
|
||||
{
|
||||
static class Converter
|
||||
{
|
||||
public static double NauticalMiles = 0.566;
|
||||
public static double KmToNm (double _input)
|
||||
{
|
||||
return _input * NauticalMiles;
|
||||
}
|
||||
|
||||
public static double SquareRootOfPi ()
|
||||
{
|
||||
return Math.Sqrt(Math.PI);
|
||||
}
|
||||
|
||||
|
||||
public static int ReturnLengthOfString(string _input)
|
||||
{
|
||||
return _input.Length;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace calculator
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine(Converter.KmToNm(2345.5));
|
||||
Console.WriteLine(Converter.SquareRootOfPi());
|
||||
Console.WriteLine(Converter.ReturnLengthOfString("Dies ist ein Langer String"));
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("calculator")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("calculator")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("f8d33850-0601-41cb-89ab-e347ad7309db")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F8D33850-0601-41CB-89AB-E347AD7309DB}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>calculator</RootNamespace>
|
||||
<AssemblyName>calculator</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Converter.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26403.7
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "customer_management", "customer_management\customer_management.csproj", "{233A3C12-1B9A-4925-BCD9-999D8BB86916}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{233A3C12-1B9A-4925-BCD9-999D8BB86916}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{233A3C12-1B9A-4925-BCD9-999D8BB86916}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{233A3C12-1B9A-4925-BCD9-999D8BB86916}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{233A3C12-1B9A-4925-BCD9-999D8BB86916}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace customer_management
|
||||
{
|
||||
class Customer
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string Adresse { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
class PrivatCustomer : Customer
|
||||
{
|
||||
public DateTime Birthday { get; set; }
|
||||
public string ReturnBirthday()
|
||||
{
|
||||
return Birthday.Year.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class BusinessCustomer : Customer
|
||||
{
|
||||
public bool MwstRequired { get; set; }
|
||||
public decimal MwstValue { get; set; }
|
||||
public decimal PriceWithMwst { get; set; }
|
||||
public decimal CalculateMwstValue(decimal _input)
|
||||
{
|
||||
|
||||
return _input * (MwstValue / 100);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace customer_management
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
PrivatCustomer pc = new PrivatCustomer();
|
||||
pc.ID = 5;
|
||||
pc.Adresse = "Untertrasse 14";
|
||||
pc.Birthday = Convert.ToDateTime("1989-07-31");
|
||||
|
||||
Console.WriteLine(pc.ReturnBirthday());
|
||||
|
||||
BusinessCustomer bc = new BusinessCustomer();
|
||||
bc.ID = 6;
|
||||
bc.MwstRequired = true;
|
||||
bc.MwstValue = Convert.ToDecimal("8.0");
|
||||
|
||||
Console.WriteLine(bc.CalculateMwstValue(120));
|
||||
|
||||
Console.ReadKey();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("customer_management")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("customer_management")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("233a3c12-1b9a-4925-bcd9-999d8bb86916")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{233A3C12-1B9A-4925-BCD9-999D8BB86916}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>customer_management</RootNamespace>
|
||||
<AssemblyName>customer_management</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Customer.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26403.7
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "first_app", "first_app\first_app.csproj", "{8C879946-E910-49E2-BEE1-6488B8B17681}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8C879946-E910-49E2-BEE1-6488B8B17681}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8C879946-E910-49E2-BEE1-6488B8B17681}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8C879946-E910-49E2-BEE1-6488B8B17681}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8C879946-E910-49E2-BEE1-6488B8B17681}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace first_app
|
||||
{
|
||||
|
||||
public class Calculator
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public int Add(int x, int y)
|
||||
{
|
||||
return x + y;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace first_app
|
||||
{
|
||||
class Car
|
||||
{
|
||||
// neue methode
|
||||
public string number { set; get; }
|
||||
|
||||
// alte methode
|
||||
// private string _number;
|
||||
//
|
||||
// public string number
|
||||
// {
|
||||
// get { return _number; }
|
||||
// set { _number = value; }
|
||||
// }
|
||||
|
||||
public Car(string _number)
|
||||
{
|
||||
this.number = _number;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace first_app
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
Calculator c1 = new Calculator();
|
||||
|
||||
Console.WriteLine("Please enter a number");
|
||||
string string1 = Console.ReadLine();
|
||||
Console.WriteLine("Please enter a second number");
|
||||
string string2 = Console.ReadLine();
|
||||
int value1 = int.Parse(string1);
|
||||
int value2 = int.Parse(string2);
|
||||
int result = c1.Add(value1,value2);
|
||||
Console.WriteLine("The sum of your numbers is: " + result);
|
||||
|
||||
|
||||
Console.WriteLine("Please enter your car number");
|
||||
string car_number = Console.ReadLine();
|
||||
Car first_car = new Car(car_number);
|
||||
Console.WriteLine(first_car.number);
|
||||
|
||||
Console.ReadKey();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("first_app")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("first_app")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("8c879946-e910-49e2-bee1-6488b8b17681")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{8C879946-E910-49E2-BEE1-6488B8B17681}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>first_app</RootNamespace>
|
||||
<AssemblyName>first_app</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Calculator.cs" />
|
||||
<Compile Include="Car.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26403.7
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "string_length", "string_length\string_length.csproj", "{6BDB3331-A8FB-49E6-B548-0EDC8F69B2F3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6BDB3331-A8FB-49E6-B548-0EDC8F69B2F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6BDB3331-A8FB-49E6-B548-0EDC8F69B2F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6BDB3331-A8FB-49E6-B548-0EDC8F69B2F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6BDB3331-A8FB-49E6-B548-0EDC8F69B2F3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace string_length
|
||||
{
|
||||
static class LengthCounter
|
||||
{
|
||||
public static void CountStringLength(string input)
|
||||
{
|
||||
if (input.Length <= 5 && input.Length > 0)
|
||||
{ Console.WriteLine("1-5"); }
|
||||
else if (input.Length >= 6 && input.Length <= 15)
|
||||
{
|
||||
Console.WriteLine("6-15");
|
||||
}
|
||||
else if (input.Length > 16)
|
||||
{
|
||||
Console.WriteLine("16+");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Ungültig");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace string_length
|
||||
{
|
||||
class Program
|
||||
{
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
LengthCounter.CountStringLength(Console.ReadLine());
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("string_length")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("string_length")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("6bdb3331-a8fb-49e6-b548-0edc8f69b2f3")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{6BDB3331-A8FB-49E6-B548-0EDC8F69B2F3}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>string_length</RootNamespace>
|
||||
<AssemblyName>string_length</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="LengthCounter.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
Binary file not shown.
After Width: | Height: | Size: 223 KiB |
|
@ -0,0 +1,224 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<title>Aufgaben Tag 1</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Aufgaben Tag 1</h1>
|
||||
<p>Dies sind die Hausaufgaben des ersten Tages Webtechnologie.</p>
|
||||
|
||||
<h3>IPv6</h3>
|
||||
<p><b>Wieviele Adressen kann jede Person auf der Welt haben?</b></p>
|
||||
<ul>
|
||||
<li>4.85x10^28</li>
|
||||
</ul>
|
||||
|
||||
<p><b>Welches sind die Nachteile gegenüber IPv4</b></p>
|
||||
<ul>
|
||||
<li>Vorteile
|
||||
<ul>
|
||||
<li>Entlastet Router</li>
|
||||
<li>Mehr mögliche Adressen</li>
|
||||
<li>Besser geeignet für mobile Geräte</li>
|
||||
</ul></li>
|
||||
<li>Nachteile
|
||||
<ul>
|
||||
<li>könnte Überwachung vereinfachen</li>
|
||||
<li>Nicht rückwarts kompatibel (Hardware muss es
|
||||
unterstützen.</li>
|
||||
<li>komplizierte Adressnotation</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
<p><b>Welche Betriebssysteme unterstützen IPv6?</b><p>
|
||||
<ul>
|
||||
<li>Linux >= 2.6</li>
|
||||
<li>BSD</li>
|
||||
<li>Windows >= 6.X</li>
|
||||
<li>OSX >= 10.7</li>
|
||||
<li>iOS >= 4.1</li>
|
||||
</ul>
|
||||
<p>Für eine detaillierte Liste bezieht man sich am besten auf:</p>
|
||||
<a href="https://en.wikipedia.org/wiki/Comparison_of_IPv6_support_in_operating_systems"
|
||||
target="_blank">Comparison of IPv6 Support in Operating Systems</a>
|
||||
|
||||
<p><b>Kompatibilät zwischen IPv4 und IPv6?</b><p>
|
||||
<p>IPv6 ist nicht rückwärtskompatibel zu IPv4. Geräte welche nur IPv4
|
||||
unterstützen können mit IPv6 Traffic nicht umgehen.</p>
|
||||
<p><b>Wie unterscheiden sich IPv4 und IPv6?</b><p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p><strong>IPv4 </strong>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p><strong>IPv6 </strong>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><strong>Address</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>32 bits (4 bytes)<br/>
|
||||
12:34:56:78</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>128 bits (16 bytes)
|
||||
</p>
|
||||
<p>1234:5678:9abc:def0:</p>
|
||||
<p>1234:5678:9abc:def0</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><strong>Packet Grösse</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>576 bytes minimum, Teilung möglich</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>1280 bytes minimum ohne Unterteilung</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><strong>Packet Unterteilung</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Routers und Sender</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>nur Sender</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3">
|
||||
<p><strong>Packet Header</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Packetfluss wird für QoS nicht untersucht.</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Enthält Flow Label Feld welches einer Quelle ermöglicht <br/>Router
|
||||
mitzuteilen wie sie das Packet priosieren sollen.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>Enthält eine Prüfsumme.</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Enthält keine Prüfsumme.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>Enthält Optionen<br/>
|
||||
bis zu 40 Bytes</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Extension Headers werden für optional Daten genutzt</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2">
|
||||
<p><strong>DNS Records</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Address (A) Records,<br/>
|
||||
mappen Host Namen</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Address (AAAA) Records,<br/>
|
||||
mappen Host Namen</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>Pointer (PTR) records,<br/>
|
||||
IN-ADDR.ARPA DNS Domain</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Pointer (PTR) records,<br/>
|
||||
IP6.ARPA DNS Domain</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><strong>Adress Konfiguration</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Manuel oder via DHCP</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>automatische zustandslose Adress Konfiguration mit<br/>
|
||||
ICMPv6 oder DHCPv6</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><strong>IP zu MAC Auflösung</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>broadcast ARP</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Multicast Neighbor Solicitation</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><strong>Lokales Subnet <br/>Gruppen Management</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Internet Group Management Protocol (IGMP)</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Multicast Listener Discovery (MLD)</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><strong>Broadcast</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Ja</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Nein</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><strong>Multicast</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Ja</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Ja</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><strong>IPSec</strong></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>optional, muss extern realisiert werden</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Teil des Standards</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,61 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Aufgaben Tag 2</title>
|
||||
<link rel="stylesheet" href="css/tag2.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<img src="assets/ersatzteile.png" alt="Logo">
|
||||
</header>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="http://www.20min.ch">Home</a></li>
|
||||
<li><a href="http://www.20min.ch">Produkte</a>
|
||||
<ul>
|
||||
<li><a href="http://www.20min.ch">Eisenwaren</a></li>
|
||||
<li><a href="http://www.20min.ch">Holzwaren</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<article>
|
||||
<h1>Hauptüberschrift</h1>
|
||||
|
||||
<h2>Artikelüberschrift</h2>
|
||||
<p>Erster Absatz</p>
|
||||
<p>Zweiter Absatz mit <b>wichtigen Inhalten</b> </p>
|
||||
<p>Dritter Absatz mit <em>seltsamen Inhalten </em></p>
|
||||
|
||||
<h3>Unsere Mitglieder</h3>
|
||||
|
||||
<table frame="box">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Vorname</th>
|
||||
<th>Funktion</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Meier</td>
|
||||
<td>Sebastian</td>
|
||||
<td>Präsident</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Müller</td>
|
||||
<td>Max</td>
|
||||
<td>Kassier</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Schmid</td>
|
||||
<td>Erwin</td>
|
||||
<td>Festprogramm</td>
|
||||
</tr>
|
||||
</table>
|
||||
</article>
|
||||
<footer>
|
||||
<p id="copyright">2017 by Tiefenthaler Warenhandlung</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
class Person {
|
||||
// attributes
|
||||
protected $name;
|
||||
protected $firstname;
|
||||
protected $age;
|
||||
protected $domicile;
|
||||
|
||||
// methodes
|
||||
public function __construct($name, $firstname, $age, $domicile () {
|
||||
$this->name = $name;
|
||||
$this->firstname= $firstname;
|
||||
$this->age= $age;
|
||||
$this->domicile= $domicile;
|
||||
}
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
public function setName() {
|
||||
$this->name = $name;
|
||||
}
|
||||
public function getFirstname() {
|
||||
return $this->firstname
|
||||
}
|
||||
public function setFirstname() {
|
||||
$this->firstname= $firstname;
|
||||
}
|
||||
public function getAge() {
|
||||
return $this->age
|
||||
}
|
||||
public function setAge() {
|
||||
$this->age= $age;
|
||||
}
|
||||
public function getDomicile() {
|
||||
return $this->domicile
|
||||
}
|
||||
public function setDomicile() {
|
||||
$this->domicile= $domicile;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
// Enter your Host, username, password, database below.
|
||||
// I left password empty because i do not set password on localhost .
|
||||
$con = mysqli_connect("localhost","school_db_user","password","schooldb","3306");
|
||||
// Check connection
|
||||
if (mysqli_connect_errno())
|
||||
{
|
||||
echo "Failed to connect to MySQL: " . mysqli_connect_error();
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
class Person {
|
||||
|
||||
protected $name;
|
||||
protected $vorname;
|
||||
protected $alter;
|
||||
protected $wohnort;
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getVorname() {
|
||||
return $this->vorname;
|
||||
}
|
||||
|
||||
public function getAlter() {
|
||||
return $this->alter;
|
||||
}
|
||||
|
||||
public function getWohnort() {
|
||||
return $this->wohnort;
|
||||
}
|
||||
|
||||
public function __construct($name, $vorname, $alter, $wohnort) {
|
||||
|
||||
$this->name = $name;
|
||||
$this->vorname = $vorname;
|
||||
$this->alter = $alter;
|
||||
$this->wohnort = $wohnort;
|
||||
}
|
||||
}
|
||||
|
||||
class Student extends Person {
|
||||
|
||||
protected $matrikel;
|
||||
|
||||
public function __construct($name, $vorname, $alter, $wohnort, $matrikel) {
|
||||
parent::__construct($name, $vorname, $alter, $wohnort);
|
||||
$this->matrikel = $matrikel;
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return $this->name . ", "
|
||||
. $this->vorname
|
||||
. " (" . $this->matrikel . ")";
|
||||
}
|
||||
}
|
||||
|
||||
class StudentException extends Exception {
|
||||
public function __construct($message) {
|
||||
parent::__construct($message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
|
@ -0,0 +1,180 @@
|
|||
# ************************************************************
|
||||
# Sequel Pro SQL dump
|
||||
# Version 4096
|
||||
#
|
||||
# http://www.sequelpro.com/
|
||||
# http://code.google.com/p/sequel-pro/
|
||||
#
|
||||
# Host: 127.0.0.1 (MySQL 5.6.20)
|
||||
# Database: school-db
|
||||
# Generation Time: 2016-02-06 19:40:03 +0000
|
||||
# ************************************************************
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
|
||||
# Dump of table courses
|
||||
# ------------------------------------------------------------
|
||||
create database if not exists schooldb;
|
||||
grant all on schooldb.* to
|
||||
'school_db_user'@'localhost'
|
||||
identified by 'password';
|
||||
flush privileges;
|
||||
|
||||
use schooldb;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`course_name` varchar(45) DEFAULT NULL,
|
||||
`school_id` int(11) NOT NULL,
|
||||
`teacher_id` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`,`school_id`),
|
||||
KEY `fk_courses_schools_idx` (`school_id`),
|
||||
CONSTRAINT `fk_courses_schools` FOREIGN KEY (`school_id`) REFERENCES `schools` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `courses` (`id`, `course_name`, `school_id`, `teacher_id`)
|
||||
VALUES
|
||||
(1,'Elektrotechnik',1,1),
|
||||
(2,'Tiefbau',1,NULL),
|
||||
(3,'Projektleiter',2,2),
|
||||
(4,'Mikrobiologe',2,3),
|
||||
(5,'Deutsch',3,4),
|
||||
(6,'Englisch',3,1);
|
||||
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
# Dump of table courses_students
|
||||
# ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `courses_students` (
|
||||
`course_id` int(11) NOT NULL,
|
||||
`student_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`student_id`,`course_id`),
|
||||
KEY `fk_persons_has_courses_courses1_idx` (`course_id`),
|
||||
KEY `fk_persons_has_courses_persons1_idx` (`student_id`),
|
||||
CONSTRAINT `fk_persons_has_courses_courses1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_persons_has_courses_persons1` FOREIGN KEY (`student_id`) REFERENCES `persons` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
LOCK TABLES `courses_students` WRITE;
|
||||
/*!40000 ALTER TABLE `courses_students` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `courses_students` (`course_id`, `student_id`)
|
||||
VALUES
|
||||
(1,5),
|
||||
(1,6),
|
||||
(2,8),
|
||||
(2,9),
|
||||
(4,7),
|
||||
(4,8),
|
||||
(4,10),
|
||||
(4,12),
|
||||
(5,9),
|
||||
(5,10),
|
||||
(6,5),
|
||||
(6,6),
|
||||
(6,11),
|
||||
(6,12);
|
||||
|
||||
/*!40000 ALTER TABLE `courses_students` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
# Dump of table person_types
|
||||
# ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `person_types` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`type` varchar(45) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
LOCK TABLES `person_types` WRITE;
|
||||
/*!40000 ALTER TABLE `person_types` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `person_types` (`id`, `type`)
|
||||
VALUES
|
||||
(1,'Dozent'),
|
||||
(2,'Student');
|
||||
|
||||
/*!40000 ALTER TABLE `person_types` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
# Dump of table persons
|
||||
# ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `persons` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(45) DEFAULT NULL,
|
||||
`firstname` varchar(45) DEFAULT NULL,
|
||||
`person_type_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`,`person_type_id`),
|
||||
KEY `fk_persons_person_types1_idx` (`person_type_id`),
|
||||
CONSTRAINT `fk_persons_person_types1` FOREIGN KEY (`person_type_id`) REFERENCES `person_types` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
LOCK TABLES `persons` WRITE;
|
||||
/*!40000 ALTER TABLE `persons` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `persons` (`id`, `name`, `firstname`, `person_type_id`)
|
||||
VALUES
|
||||
(1,'Teufel','Phil',1),
|
||||
(2,'Heusser','Harry',1),
|
||||
(3,'Dankner','Claudia',1),
|
||||
(4,'Pechstein','Daphne',1),
|
||||
(5,'Petrovic','Doris',2),
|
||||
(6,'Adam','Samuel',2),
|
||||
(7,'Lustig','Peter',2),
|
||||
(8,'Herzig','Daniela',2),
|
||||
(9,'Matt','Bernhard',2),
|
||||
(10,'Eichmann','Rolf',2),
|
||||
(11,'Witzig','Barbara',2),
|
||||
(12,'Decker','Eberhard',2);
|
||||
|
||||
/*!40000 ALTER TABLE `persons` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
# Dump of table schools
|
||||
# ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `schools` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(45) DEFAULT NULL,
|
||||
`city` varchar(45) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
LOCK TABLES `schools` WRITE;
|
||||
/*!40000 ALTER TABLE `schools` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `schools` (`id`, `name`, `city`)
|
||||
VALUES
|
||||
(1,'ibz','Aarau'),
|
||||
(2,'benedict','Zürich'),
|
||||
(3,'bellingua','Zürich');
|
||||
|
||||
/*!40000 ALTER TABLE `schools` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
require('db.php');
|
||||
|
||||
$professor_courses_query = "SELECT p.name,
|
||||
p.firstname,
|
||||
p.id,
|
||||
c.id,
|
||||
c.course_name,
|
||||
c.teacher_id
|
||||
FROM courses c
|
||||
INNER JOIN persons p
|
||||
on c.teacher_id = p.id;";
|
||||
|
||||
$courses_query = "SELECT p.name,
|
||||
p.firstname,
|
||||
p.id,
|
||||
c.id,
|
||||
c.course_name,
|
||||
c.teacher_id,
|
||||
cs.student_id,
|
||||
cs.course_id
|
||||
FROM courses c
|
||||
INNER JOIN persons p on c.teacher_id = p.id
|
||||
INNER JOIN courses_students cs on cs.student_id = p.id;";
|
||||
|
||||
function query_database($query)
|
||||
{
|
||||
global $con;
|
||||
$query_result = mysqli_query($con, $query) or
|
||||
die(mysqli_error($con));
|
||||
return $query_result;
|
||||
}
|
||||
?>
|
||||
|
||||
<h2>aktive Lehrer</h2>
|
||||
|
||||
<?php
|
||||
|
||||
$query_result = query_database($professor_courses_query);
|
||||
|
||||
while ($query_rows = $query_result->fetch_object()) {
|
||||
foreach ($query_rows as $key => $value) {
|
||||
echo "$key => $value\n<br>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<h2>besetzte Kurse</h2>
|
||||
|
||||
<?php
|
||||
|
||||
$query_courses = query_database($courses_query);
|
||||
|
||||
while ($query_rows = $query_courses->fetch_object()) {
|
||||
foreach ($query_rows as $key => $value) {
|
||||
echo "$key => $value\n<br>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
require_once 'person.php';
|
||||
|
||||
function testType($object) {
|
||||
if (!($object instanceof Student)) {
|
||||
throw new StudentException("Kein Student Object");
|
||||
}
|
||||
return 'Alles ok!';
|
||||
}
|
||||
|
||||
function createPersons($data) {
|
||||
|
||||
$result = Array();
|
||||
$size = count($data);
|
||||
foreach ($data as $value) {
|
||||
$result[] = new Person($value[0], $value[1], $value[2], $value[3]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
$student = new Student('meissner', 'holger', 58, 'brüssel', '12345');
|
||||
$person = new Person('meissner', 'holger', 58, 'brüssel', '12345');
|
||||
|
||||
try {
|
||||
$test_student = testType($student);
|
||||
$test_person = testType($person);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,52 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>HTML Element</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h3>Lorem Ipsum</h3>
|
||||
</header>
|
||||
<article>
|
||||
<h1>Article Heading</h1>
|
||||
<section>
|
||||
<h5>Section 1</h5>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sollicitudin
|
||||
erat ex, eget sollicitudin dolor tincidunt quis. Vestibulum placerat
|
||||
ullamcorper nunc efficitur consectetur. Morbi a elit mi. In feugiat elit
|
||||
purus, non gravida risus molestie vel. Mauris consequat et leo placerat
|
||||
placerat. Vestibulum vitae tortor felis. Etiam sem purus, hendrerit vel
|
||||
libero at, suscipit facilisis dolor. Fusce ut erat augue. In dapibus nisl vel
|
||||
massa dapibus facilisis. Quisque at sodales ex, ullamcorper luctus ante.
|
||||
Phasellus id luctus purus. Morbi volutpat, ligula non aliquet bibendum,
|
||||
tellus felis luctus lorem, vel tristique est diam sed nisl. Donec fringilla
|
||||
velit at purus imperdiet, sit amet ornare metus dictum. Etiam nec condimentum
|
||||
tellus. Sed ac tellus ac ante iaculis varius.
|
||||
</section>
|
||||
<section>
|
||||
<h5>Section 2</h5>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sollicitudin
|
||||
erat ex, eget sollicitudin dolor tincidunt quis. Vestibulum placerat
|
||||
ullamcorper nunc efficitur consectetur. Morbi a elit mi. In feugiat elit
|
||||
purus, non gravida risus molestie vel. Mauris consequat et leo placerat
|
||||
placerat. Vestibulum vitae tortor felis. Etiam sem purus, hendrerit vel
|
||||
libero at, suscipit facilisis dolor. Fusce ut erat augue. In dapibus nisl vel
|
||||
massa dapibus facilisis. Quisque at sodales ex, ullamcorper luctus ante.
|
||||
Phasellus id luctus purus. Morbi volutpat, ligula non aliquet bibendum,
|
||||
tellus felis luctus lorem, vel tristique est diam sed nisl. Donec fringilla
|
||||
velit at purus imperdiet, sit amet ornare metus dictum. Etiam nec condimentum
|
||||
tellus. Sed ac tellus ac ante iaculis varius.
|
||||
</section>
|
||||
|
||||
<figure>
|
||||
<img src="http://static01.20min.ch/dyim/3aeb31/T470,230/images/content/1/7/1/17195951/6/teaserbreit.jpg"
|
||||
alt="Weihnachts-Shopping" width="470" height="230">
|
||||
</figure>
|
||||
</article>
|
||||
<footer>
|
||||
<p>Created by Andreas Zweili</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,25 @@
|
|||
<!ELEMENT collection (description,recipe*)>
|
||||
|
||||
<!ELEMENT description ANY>
|
||||
|
||||
<!ELEMENT recipe (title,ingredient*,preparation,comment?,nutrition)>
|
||||
|
||||
<!ELEMENT title (#PCDATA)>
|
||||
|
||||
<!ELEMENT ingredient EMPTY>
|
||||
<!ATTLIST ingredient name CDATA #REQUIRED
|
||||
amount CDATA #IMPLIED
|
||||
unit CDATA #IMPLIED>
|
||||
|
||||
<!ELEMENT preparation (step*)>
|
||||
|
||||
<!ELEMENT step (#PCDATA)>
|
||||
|
||||
<!ELEMENT comment (#PCDATA)>
|
||||
|
||||
<!ELEMENT nutrition EMPTY>
|
||||
<!ATTLIST nutrition protein CDATA #REQUIRED
|
||||
carbohydrates CDATA #REQUIRED
|
||||
fat CDATA #REQUIRED
|
||||
calories CDATA #REQUIRED
|
||||
alcohol CDATA #IMPLIED>
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE collection SYSTEM 'recipes.dtd'>
|
||||
<collection>
|
||||
<description>Dies ist ein Rezept für etwas zu bauen.</description>
|
||||
<recipe>
|
||||
<title>Brot</title>
|
||||
<ingredient name="wasser" amount="2" unit="liter"/>
|
||||
<ingredient name="mehl" amount="2" unit="kg"/>
|
||||
<preparation>
|
||||
<step>rühren</step>
|
||||
<step>knetten</step>
|
||||
<step>backen</step>
|
||||
</preparation>
|
||||
<comment>Dies ist ein Kommentar</comment>
|
||||
<nutrition protein="2" carbohydrates="4" fat="7" calories="2000" alcohol="40"/>
|
||||
</recipe>
|
||||
</collection>
|
|
@ -0,0 +1,9 @@
|
|||
/* CSS generated at csscreator.com */
|
||||
body { font-family:sans-serif;
|
||||
width:50%;
|
||||
margin-left:auto;
|
||||
margin-right:auto;}
|
||||
|
||||
p { font-size:medium;
|
||||
font-family:sans-serif;
|
||||
font-weight:normal; }
|
|
@ -0,0 +1,18 @@
|
|||
/* CSS generated at csscreator.com */
|
||||
body { font-family:sans-serif;
|
||||
width:50%;
|
||||
margin-left:auto;
|
||||
margin-right:auto;}
|
||||
|
||||
p { font-size:medium;
|
||||
font-family:sans-serif;
|
||||
font-weight:normal; }
|
||||
|
||||
h1 { color:grey;
|
||||
}
|
||||
|
||||
h2 { color:pink;
|
||||
}
|
||||
|
||||
h3 { color:green;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<ul>
|
||||
<li><a href="aufgaben_tag1.html" target="_blank">Aufgaben Tag 1</a></li>
|
||||
<li><a href="html_elements.html" target="_blank">HTML Elemente</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,10 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<head>
|
||||
<title></title>
|
||||
/head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue