diff --git a/.gitignore b/.gitignore index 5721099..02d5dcb 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/db/1_sem/Abo/Abo.ssmssln b/db/1_sem/Abo/Abo.ssmssln new file mode 100644 index 0000000..d2ec66b --- /dev/null +++ b/db/1_sem/Abo/Abo.ssmssln @@ -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 diff --git a/db/1_sem/Abo/Abo.ssmssqlproj b/db/1_sem/Abo/Abo.ssmssqlproj new file mode 100644 index 0000000..27d3b6f --- /dev/null +++ b/db/1_sem/Abo/Abo.ssmssqlproj @@ -0,0 +1,64 @@ + + + + + + + 2017-03-09T18:45:47.4395012+01:00 + SQL + WIN-10-SFR\SQL2016 + + Windows Authentication + + 15 + 0 + NotSpecified + Microsoft SQL Server Management Studio - Query + + + 2017-03-11T08:58:56.8900889+01:00 + SQL + WIN-LAPTOP\SQLEXPRESS + + Windows Authentication + + 15 + 0 + NotSpecified + Microsoft SQL Server Management Studio - Query + + + + + + + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-10-SFR\SQL2016:True + WIN-10-SFR\SQL2016 + + create_tables.sql + + + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-10-SFR\SQL2016:True + WIN-10-SFR\SQL2016 + + insert_data.sql + + + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-10-SFR\SQL2016:True + WIN-10-SFR\SQL2016 + + remove_tables.sql + + + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-LAPTOP\SQLEXPRESS:True + WIN-LAPTOP\SQLEXPRESS + + select_statements.sql + + + + + + + + \ No newline at end of file diff --git a/db/1_sem/Abo/create_tables.sql b/db/1_sem/Abo/create_tables.sql new file mode 100644 index 0000000..d8bdea5 --- /dev/null +++ b/db/1_sem/Abo/create_tables.sql @@ -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) +); diff --git a/db/1_sem/Abo/insert_data.sql b/db/1_sem/Abo/insert_data.sql new file mode 100644 index 0000000..e1eac67 --- /dev/null +++ b/db/1_sem/Abo/insert_data.sql @@ -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'); diff --git a/db/1_sem/Abo/remove_tables.sql b/db/1_sem/Abo/remove_tables.sql new file mode 100644 index 0000000..ffd261f --- /dev/null +++ b/db/1_sem/Abo/remove_tables.sql @@ -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; \ No newline at end of file diff --git a/db/1_sem/Abo/select_statements.sql b/db/1_sem/Abo/select_statements.sql new file mode 100644 index 0000000..c02df44 --- /dev/null +++ b/db/1_sem/Abo/select_statements.sql @@ -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 diff --git a/db/1_sem/Berater/Berater.ssmssln b/db/1_sem/Berater/Berater.ssmssln new file mode 100644 index 0000000..3b6e89f --- /dev/null +++ b/db/1_sem/Berater/Berater.ssmssln @@ -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 diff --git a/db/1_sem/Berater/Berater/Berater.ssmssqlproj b/db/1_sem/Berater/Berater/Berater.ssmssqlproj new file mode 100644 index 0000000..9f013d2 --- /dev/null +++ b/db/1_sem/Berater/Berater/Berater.ssmssqlproj @@ -0,0 +1,46 @@ + + + + + + + 2016-12-16T20:48:33.9312639+01:00 + SQL + WIN-LAPTOP\SQLEXPRESS + + Windows Authentication + Berater + 15 + 0 + NotSpecified + Microsoft SQL Server Management Studio - Query + + + + + + + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-LAPTOP\SQLEXPRESS:True + WIN-LAPTOP\SQLEXPRESS + + create_tables.sql + + + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-LAPTOP\SQLEXPRESS:True + WIN-LAPTOP\SQLEXPRESS + + insert_data.sql + + + 8c91a03d-f9b4-46c0-a305-b5dcc79ff907:WIN-LAPTOP\SQLEXPRESS:True + WIN-LAPTOP\SQLEXPRESS + + remove_tables.sql + + + + + + + + \ No newline at end of file diff --git a/db/1_sem/Berater/Berater/create_db_berater.sql b/db/1_sem/Berater/Berater/create_db_berater.sql new file mode 100644 index 0000000..6429153 --- /dev/null +++ b/db/1_sem/Berater/Berater/create_db_berater.sql @@ -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 diff --git a/db/1_sem/Berater/Berater/drop_db_berater.sql b/db/1_sem/Berater/Berater/drop_db_berater.sql new file mode 100644 index 0000000..23dae8e --- /dev/null +++ b/db/1_sem/Berater/Berater/drop_db_berater.sql @@ -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 diff --git a/db/1_sem/Berater/Berater/insert_db_berater.sql b/db/1_sem/Berater/Berater/insert_db_berater.sql new file mode 100644 index 0000000..225a0b8 --- /dev/null +++ b/db/1_sem/Berater/Berater/insert_db_berater.sql @@ -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 diff --git a/db/1_sem/Berater/Berater/remove_tables.sql b/db/1_sem/Berater/Berater/remove_tables.sql new file mode 100644 index 0000000..75a77aa --- /dev/null +++ b/db/1_sem/Berater/Berater/remove_tables.sql @@ -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; diff --git a/db/1_sem/Datenbank/Datenbank.ssmssln b/db/1_sem/Datenbank/Datenbank.ssmssln new file mode 100644 index 0000000..1c4e7c9 --- /dev/null +++ b/db/1_sem/Datenbank/Datenbank.ssmssln @@ -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 diff --git a/db/1_sem/Datenbank/Datenbank/Datenbank.ssmssqlproj b/db/1_sem/Datenbank/Datenbank/Datenbank.ssmssqlproj new file mode 100644 index 0000000..25cfc75 --- /dev/null +++ b/db/1_sem/Datenbank/Datenbank/Datenbank.ssmssqlproj @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/db/1_sem/SQL Server Scripts1/SQL Server Scripts1.ssmssqlproj b/db/1_sem/SQL Server Scripts1/SQL Server Scripts1.ssmssqlproj new file mode 100644 index 0000000..4c08aa5 --- /dev/null +++ b/db/1_sem/SQL Server Scripts1/SQL Server Scripts1.ssmssqlproj @@ -0,0 +1,20 @@ +<<<<<<< HEAD + + + + + + + + +======= + + + + + + + + +>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5 + \ No newline at end of file diff --git a/db/2_sem/SEP Prüfung/SEP Prüfung.ssmssln b/db/2_sem/SEP Prüfung/SEP Prüfung.ssmssln new file mode 100644 index 0000000..2039de6 --- /dev/null +++ b/db/2_sem/SEP Prüfung/SEP Prüfung.ssmssln @@ -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 diff --git a/db/2_sem/SEP Prüfung/SEP Prüfung/SEP Prüfung.ssmssqlproj b/db/2_sem/SEP Prüfung/SEP Prüfung/SEP Prüfung.ssmssqlproj new file mode 100644 index 0000000..4c08aa5 --- /dev/null +++ b/db/2_sem/SEP Prüfung/SEP Prüfung/SEP Prüfung.ssmssqlproj @@ -0,0 +1,20 @@ +<<<<<<< HEAD + + + + + + + + +======= + + + + + + + + +>>>>>>> 91c37e0a13ad9148d1d6356ee6197441ad0a42e5 + \ No newline at end of file diff --git a/db/2_sem/SEP Prüfung/SEP Prüfung/zweili_andreas_A1.sql b/db/2_sem/SEP Prüfung/SEP Prüfung/zweili_andreas_A1.sql new file mode 100644 index 0000000..a474502 --- /dev/null +++ b/db/2_sem/SEP Prüfung/SEP Prüfung/zweili_andreas_A1.sql @@ -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 diff --git a/db/2_sem/SEP Prüfung/SEP Prüfung/zweili_andreas_A2.sql b/db/2_sem/SEP Prüfung/SEP Prüfung/zweili_andreas_A2.sql new file mode 100644 index 0000000..6156a86 --- /dev/null +++ b/db/2_sem/SEP Prüfung/SEP Prüfung/zweili_andreas_A2.sql @@ -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'; \ No newline at end of file diff --git a/db/templates/create_table.sql b/db/templates/create_table.sql new file mode 100644 index 0000000..a06b131 --- /dev/null +++ b/db/templates/create_table.sql @@ -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) + ); \ No newline at end of file diff --git a/db/templates/operatoren.sql b/db/templates/operatoren.sql new file mode 100644 index 0000000..ae9e5e9 --- /dev/null +++ b/db/templates/operatoren.sql @@ -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; + \ No newline at end of file diff --git a/software/1_sem/ConsoleApp1/ConsoleApp1.sln b/software/1_sem/ConsoleApp1/ConsoleApp1.sln new file mode 100644 index 0000000..e84acf9 --- /dev/null +++ b/software/1_sem/ConsoleApp1/ConsoleApp1.sln @@ -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 diff --git a/software/1_sem/ConsoleApp1/ConsoleApp1/App.config b/software/1_sem/ConsoleApp1/ConsoleApp1/App.config new file mode 100644 index 0000000..d740e88 --- /dev/null +++ b/software/1_sem/ConsoleApp1/ConsoleApp1/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/software/1_sem/ConsoleApp1/ConsoleApp1/Calculator.cs b/software/1_sem/ConsoleApp1/ConsoleApp1/Calculator.cs new file mode 100644 index 0000000..c7987d1 --- /dev/null +++ b/software/1_sem/ConsoleApp1/ConsoleApp1/Calculator.cs @@ -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"); + } + } + } +} diff --git a/software/1_sem/ConsoleApp1/ConsoleApp1/ConsoleApp1.csproj b/software/1_sem/ConsoleApp1/ConsoleApp1/ConsoleApp1.csproj new file mode 100644 index 0000000..7af53fd --- /dev/null +++ b/software/1_sem/ConsoleApp1/ConsoleApp1/ConsoleApp1.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {96F5B37F-FF2E-470A-BD49-44B2C1CDB5D0} + Exe + ConsoleApp1 + ConsoleApp1 + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/software/1_sem/ConsoleApp1/ConsoleApp1/Program.cs b/software/1_sem/ConsoleApp1/ConsoleApp1/Program.cs new file mode 100644 index 0000000..f0e622d --- /dev/null +++ b/software/1_sem/ConsoleApp1/ConsoleApp1/Program.cs @@ -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(); + } + } +} diff --git a/software/1_sem/ConsoleApp1/ConsoleApp1/Properties/AssemblyInfo.cs b/software/1_sem/ConsoleApp1/ConsoleApp1/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5c9c6b5 --- /dev/null +++ b/software/1_sem/ConsoleApp1/ConsoleApp1/Properties/AssemblyInfo.cs @@ -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")] diff --git a/software/1_sem/IBZ-Vererbung/IBZ-Vererbung.sln b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung.sln new file mode 100644 index 0000000..7e60136 --- /dev/null +++ b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung.sln @@ -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 diff --git a/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/Animal.cs b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/Animal.cs new file mode 100644 index 0000000..dcd0655 --- /dev/null +++ b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/Animal.cs @@ -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; } + } +} diff --git a/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/App.config b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/IBZ-Vererbung.csproj b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/IBZ-Vererbung.csproj new file mode 100644 index 0000000..df0887b --- /dev/null +++ b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/IBZ-Vererbung.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {F778E5BE-27C6-4D03-B358-B4D83E7FF437} + Exe + ConsoleApp1 + ConsoleApp1 + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/Program.cs b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/Program.cs new file mode 100644 index 0000000..0b08f1d --- /dev/null +++ b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/Program.cs @@ -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"; + } + } +} diff --git a/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/Properties/AssemblyInfo.cs b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2b0febc --- /dev/null +++ b/software/1_sem/IBZ-Vererbung/IBZ-Vererbung/Properties/AssemblyInfo.cs @@ -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")] diff --git a/software/1_sem/calculator/calculator.sln b/software/1_sem/calculator/calculator.sln new file mode 100644 index 0000000..92b574b --- /dev/null +++ b/software/1_sem/calculator/calculator.sln @@ -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 diff --git a/software/1_sem/calculator/calculator/App.config b/software/1_sem/calculator/calculator/App.config new file mode 100644 index 0000000..d740e88 --- /dev/null +++ b/software/1_sem/calculator/calculator/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/software/1_sem/calculator/calculator/Converter.cs b/software/1_sem/calculator/calculator/Converter.cs new file mode 100644 index 0000000..aac62be --- /dev/null +++ b/software/1_sem/calculator/calculator/Converter.cs @@ -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; + } + + } +} diff --git a/software/1_sem/calculator/calculator/Program.cs b/software/1_sem/calculator/calculator/Program.cs new file mode 100644 index 0000000..d0fbf8f --- /dev/null +++ b/software/1_sem/calculator/calculator/Program.cs @@ -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(); + } + } +} diff --git a/software/1_sem/calculator/calculator/Properties/AssemblyInfo.cs b/software/1_sem/calculator/calculator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3f6870c --- /dev/null +++ b/software/1_sem/calculator/calculator/Properties/AssemblyInfo.cs @@ -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")] diff --git a/software/1_sem/calculator/calculator/calculator.csproj b/software/1_sem/calculator/calculator/calculator.csproj new file mode 100644 index 0000000..c45bab6 --- /dev/null +++ b/software/1_sem/calculator/calculator/calculator.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {F8D33850-0601-41CB-89AB-E347AD7309DB} + Exe + calculator + calculator + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/software/1_sem/customer_management/customer_management.sln b/software/1_sem/customer_management/customer_management.sln new file mode 100644 index 0000000..ac260b2 --- /dev/null +++ b/software/1_sem/customer_management/customer_management.sln @@ -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 diff --git a/software/1_sem/customer_management/customer_management/App.config b/software/1_sem/customer_management/customer_management/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/software/1_sem/customer_management/customer_management/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/software/1_sem/customer_management/customer_management/Customer.cs b/software/1_sem/customer_management/customer_management/Customer.cs new file mode 100644 index 0000000..bff2d4a --- /dev/null +++ b/software/1_sem/customer_management/customer_management/Customer.cs @@ -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); + } + + } +} diff --git a/software/1_sem/customer_management/customer_management/Program.cs b/software/1_sem/customer_management/customer_management/Program.cs new file mode 100644 index 0000000..864a7ab --- /dev/null +++ b/software/1_sem/customer_management/customer_management/Program.cs @@ -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(); + + + } + } +} diff --git a/software/1_sem/customer_management/customer_management/Properties/AssemblyInfo.cs b/software/1_sem/customer_management/customer_management/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0d9135c --- /dev/null +++ b/software/1_sem/customer_management/customer_management/Properties/AssemblyInfo.cs @@ -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")] diff --git a/software/1_sem/customer_management/customer_management/customer_management.csproj b/software/1_sem/customer_management/customer_management/customer_management.csproj new file mode 100644 index 0000000..6d769a8 --- /dev/null +++ b/software/1_sem/customer_management/customer_management/customer_management.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {233A3C12-1B9A-4925-BCD9-999D8BB86916} + Exe + customer_management + customer_management + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/software/1_sem/first_app/first_app.sln b/software/1_sem/first_app/first_app.sln new file mode 100644 index 0000000..8fbf276 --- /dev/null +++ b/software/1_sem/first_app/first_app.sln @@ -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 diff --git a/software/1_sem/first_app/first_app/App.config b/software/1_sem/first_app/first_app/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/software/1_sem/first_app/first_app/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/software/1_sem/first_app/first_app/Calculator.cs b/software/1_sem/first_app/first_app/Calculator.cs new file mode 100644 index 0000000..0a06443 --- /dev/null +++ b/software/1_sem/first_app/first_app/Calculator.cs @@ -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; + } + } +} diff --git a/software/1_sem/first_app/first_app/Car.cs b/software/1_sem/first_app/first_app/Car.cs new file mode 100644 index 0000000..c27b78a --- /dev/null +++ b/software/1_sem/first_app/first_app/Car.cs @@ -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; + } + } +} diff --git a/software/1_sem/first_app/first_app/Program.cs b/software/1_sem/first_app/first_app/Program.cs new file mode 100644 index 0000000..67ceb49 --- /dev/null +++ b/software/1_sem/first_app/first_app/Program.cs @@ -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(); + + } + } +} diff --git a/software/1_sem/first_app/first_app/Properties/AssemblyInfo.cs b/software/1_sem/first_app/first_app/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..eaf02e0 --- /dev/null +++ b/software/1_sem/first_app/first_app/Properties/AssemblyInfo.cs @@ -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")] diff --git a/software/1_sem/first_app/first_app/first_app.csproj b/software/1_sem/first_app/first_app/first_app.csproj new file mode 100644 index 0000000..eb5dd95 --- /dev/null +++ b/software/1_sem/first_app/first_app/first_app.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {8C879946-E910-49E2-BEE1-6488B8B17681} + Exe + first_app + first_app + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/software/1_sem/string_length/string_length.sln b/software/1_sem/string_length/string_length.sln new file mode 100644 index 0000000..fa469f8 --- /dev/null +++ b/software/1_sem/string_length/string_length.sln @@ -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 diff --git a/software/1_sem/string_length/string_length/App.config b/software/1_sem/string_length/string_length/App.config new file mode 100644 index 0000000..d740e88 --- /dev/null +++ b/software/1_sem/string_length/string_length/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/software/1_sem/string_length/string_length/LengthCounter.cs b/software/1_sem/string_length/string_length/LengthCounter.cs new file mode 100644 index 0000000..9b9eeba --- /dev/null +++ b/software/1_sem/string_length/string_length/LengthCounter.cs @@ -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"); + } + } + } +} diff --git a/software/1_sem/string_length/string_length/Program.cs b/software/1_sem/string_length/string_length/Program.cs new file mode 100644 index 0000000..0b47f19 --- /dev/null +++ b/software/1_sem/string_length/string_length/Program.cs @@ -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(); + } + } +} diff --git a/software/1_sem/string_length/string_length/Properties/AssemblyInfo.cs b/software/1_sem/string_length/string_length/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bc47f20 --- /dev/null +++ b/software/1_sem/string_length/string_length/Properties/AssemblyInfo.cs @@ -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")] diff --git a/software/1_sem/string_length/string_length/string_length.csproj b/software/1_sem/string_length/string_length/string_length.csproj new file mode 100644 index 0000000..20e8c0c --- /dev/null +++ b/software/1_sem/string_length/string_length/string_length.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {6BDB3331-A8FB-49E6-B548-0EDC8F69B2F3} + Exe + string_length + string_length + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/1_sem/assets/ersatzteile.png b/web/1_sem/assets/ersatzteile.png new file mode 100644 index 0000000..379f479 Binary files /dev/null and b/web/1_sem/assets/ersatzteile.png differ diff --git a/web/1_sem/aufgaben_tag1.html b/web/1_sem/aufgaben_tag1.html new file mode 100644 index 0000000..b59df08 --- /dev/null +++ b/web/1_sem/aufgaben_tag1.html @@ -0,0 +1,224 @@ + + + + + + Aufgaben Tag 1 + + +

Aufgaben Tag 1

+

Dies sind die Hausaufgaben des ersten Tages Webtechnologie.

+ +

IPv6

+

Wieviele Adressen kann jede Person auf der Welt haben?

+ + +

Welches sind die Nachteile gegenüber IPv4

+ + +

Welche Betriebssysteme unterstützen IPv6?

+

+

Für eine detaillierte Liste bezieht man sich am besten auf:

+ Comparison of IPv6 Support in Operating Systems + +

Kompatibilät zwischen IPv4 und IPv6?

+

IPv6 ist nicht rückwärtskompatibel zu IPv4. Geräte welche nur IPv4 + unterstützen können mit IPv6 Traffic nicht umgehen.

+

Wie unterscheiden sich IPv4 und IPv6?

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+

+
+

IPv4 +

+
+

IPv6 +

+
+

Address

+
+

32 bits (4 bytes)
+ 12:34:56:78

+
+

128 bits (16 bytes) +

+

1234:5678:9abc:def0:

+

1234:5678:9abc:def0

+
+

Packet Grösse

+
+

576 bytes minimum, Teilung möglich

+
+

1280 bytes minimum ohne Unterteilung

+
+

Packet Unterteilung

+
+

Routers und Sender

+
+

nur Sender

+
+

Packet Header

+
+

Packetfluss wird für QoS nicht untersucht.

+
+

Enthält Flow Label Feld welches einer Quelle ermöglicht
Router + mitzuteilen wie sie das Packet priosieren sollen.

+
+

Enthält eine Prüfsumme.

+
+

Enthält keine Prüfsumme.

+
+

Enthält Optionen
+ bis zu 40 Bytes

+
+

Extension Headers werden für optional Daten genutzt

+
+

DNS Records

+
+

Address (A) Records,
+ mappen Host Namen

+
+

Address (AAAA) Records,
+ mappen Host Namen

+
+

Pointer (PTR) records,
+ IN-ADDR.ARPA DNS Domain

+
+

Pointer (PTR) records,
+ IP6.ARPA DNS Domain

+
+

Adress Konfiguration

+
+

Manuel oder via DHCP

+
+

automatische zustandslose Adress Konfiguration mit
+ ICMPv6 oder DHCPv6

+
+

IP zu MAC Auflösung

+
+

broadcast ARP

+
+

Multicast Neighbor Solicitation

+
+

Lokales Subnet
Gruppen Management

+
+

Internet Group Management Protocol (IGMP)

+
+

Multicast Listener Discovery (MLD)

+
+

Broadcast

+
+

Ja

+
+

Nein

+
+

Multicast

+
+

Ja

+
+

Ja

+
+

IPSec

+
+

optional, muss extern realisiert werden

+
+

Teil des Standards

+
+ + diff --git a/web/1_sem/aufgaben_tag2.html b/web/1_sem/aufgaben_tag2.html new file mode 100644 index 0000000..e0f094f --- /dev/null +++ b/web/1_sem/aufgaben_tag2.html @@ -0,0 +1,61 @@ + + + + + Aufgaben Tag 2 + + + +

+ Logo +
+ + +
+

Hauptüberschrift

+ +

Artikelüberschrift

+

Erster Absatz

+

Zweiter Absatz mit wichtigen Inhalten

+

Dritter Absatz mit seltsamen Inhalten

+ +

Unsere Mitglieder

+ + + + + + + + + + + + + + + + + + + + + + +
NameVornameFunktion
MeierSebastianPräsident
MüllerMaxKassier
SchmidErwinFestprogramm
+
+
+ +
+ + diff --git a/web/1_sem/aufgaben_tag5.php b/web/1_sem/aufgaben_tag5.php new file mode 100644 index 0000000..17852a3 --- /dev/null +++ b/web/1_sem/aufgaben_tag5.php @@ -0,0 +1,41 @@ +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; + } +} +?> diff --git a/web/1_sem/aufgaben_tag6/db.php b/web/1_sem/aufgaben_tag6/db.php new file mode 100644 index 0000000..7ce82b9 --- /dev/null +++ b/web/1_sem/aufgaben_tag6/db.php @@ -0,0 +1,10 @@ + diff --git a/web/1_sem/aufgaben_tag6/person.php b/web/1_sem/aufgaben_tag6/person.php new file mode 100644 index 0000000..39165fc --- /dev/null +++ b/web/1_sem/aufgaben_tag6/person.php @@ -0,0 +1,58 @@ +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); + } +} + + +?> \ No newline at end of file diff --git a/web/1_sem/aufgaben_tag6/school-db.sql b/web/1_sem/aufgaben_tag6/school-db.sql new file mode 100644 index 0000000..0005600 --- /dev/null +++ b/web/1_sem/aufgaben_tag6/school-db.sql @@ -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 */; diff --git a/web/1_sem/aufgaben_tag6/school_db_output.php b/web/1_sem/aufgaben_tag6/school_db_output.php new file mode 100644 index 0000000..d742287 --- /dev/null +++ b/web/1_sem/aufgaben_tag6/school_db_output.php @@ -0,0 +1,62 @@ + + +

aktive Lehrer

+ +fetch_object()) { + foreach ($query_rows as $key => $value) { + echo "$key => $value\n
"; + } +} + + +?> + +

besetzte Kurse

+ +fetch_object()) { + foreach ($query_rows as $key => $value) { + echo "$key => $value\n
"; + } +} + +?> \ No newline at end of file diff --git a/web/1_sem/aufgaben_tag6/view.php b/web/1_sem/aufgaben_tag6/view.php new file mode 100644 index 0000000..6ab7af1 --- /dev/null +++ b/web/1_sem/aufgaben_tag6/view.php @@ -0,0 +1,31 @@ +getMessage(); +} +?> \ No newline at end of file diff --git a/web/1_sem/html_elements.html b/web/1_sem/html_elements.html new file mode 100644 index 0000000..fd17c9d --- /dev/null +++ b/web/1_sem/html_elements.html @@ -0,0 +1,52 @@ + + + + + + HTML Element + + +
+

Lorem Ipsum

+
+
+

Article Heading

+
+
Section 1
+ 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 2
+ 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. +
+ +
+ Weihnachts-Shopping +
+
+
+

Created by Andreas Zweili

+
+ + diff --git a/web/2_sem/recipes.dtd b/web/2_sem/recipes.dtd new file mode 100644 index 0000000..6fa7954 --- /dev/null +++ b/web/2_sem/recipes.dtd @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/2_sem/recipes.xml b/web/2_sem/recipes.xml new file mode 100644 index 0000000..191a8aa --- /dev/null +++ b/web/2_sem/recipes.xml @@ -0,0 +1,17 @@ + + + + Dies ist ein Rezept für etwas zu bauen. + + Brot + + + + rühren + knetten + backen + + Dies ist ein Kommentar + + + diff --git a/web/css/style.css b/web/css/style.css new file mode 100644 index 0000000..8f4a183 --- /dev/null +++ b/web/css/style.css @@ -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; } diff --git a/web/css/tag2.css b/web/css/tag2.css new file mode 100644 index 0000000..02ce8a5 --- /dev/null +++ b/web/css/tag2.css @@ -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; + } diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..2b8f1c5 --- /dev/null +++ b/web/index.html @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/web/landing_point.txt b/web/landing_point.txt new file mode 100644 index 0000000..e69de29 diff --git a/web/template.html b/web/template.html new file mode 100644 index 0000000..e160798 --- /dev/null +++ b/web/template.html @@ -0,0 +1,10 @@ + + + + + + +/head> + + +