-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f98ae7a
commit 3dfec5c
Showing
13 changed files
with
158 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
1- Erstelle die SQL-Tabelle mit den folgenden Attributen. | ||
|
||
vorname | ||
nachname | ||
geburtsdatum | ||
klasse | ||
geschlecht | ||
telefonnummer | ||
|
||
2- Wie lauten die Bücher geordnet nach der Seitenanzahl aufsteigend? | ||
|
||
SELECT \* FROM buch ORDER BY seiteanzahl ASC; | ||
|
||
3- Welche Autoren sind jünger als 30 Jahre und wie lauten diese absteigend nach dem Vornamen geordnet? | ||
|
||
SELECT \* FROM author WHERE aelter < 30 ORDER BY authorname ASC; | ||
|
||
4- Welche Bücher wurden nach dem 15. Februar 2022 angeschafft und wie lauten diese absteigend nach dem Anschaffungsdatum geordnet? | ||
|
||
SELECT \* FROM buch WHERE anschaffungsdatum > '2022-02-15' ORDER BY anschaffungsdatum DESC; | ||
|
||
5- Welche Kunden haben keine Telefonnummer? | ||
|
||
SELECT \* FROM kunde WHERE telefonnummer IS NULL; | ||
|
||
6- Welche Bücher enthalten 'endliche' im Titel? | ||
SELECT \* FROM buch WHERE titel LIKE '%endliche%'; | ||
|
||
7- Welche Bücher kosten zwischen 25 und 30 Euro und wie lauten diese aufsteigend nach dem Preis geordnet? | ||
SELECT \* FROM buch WHERE preis > 25 AND preis<30 ORDER BY preis ASC; | ||
|
||
8- Welche Bücher haben weniger als 250 Seiten? | ||
SELECT \* FROM buch WHERE seiteanzahl < 250; | ||
|
||
9- Liste die Städte mit sechs Buchstaben von stadt_plz Tabelle | ||
select distinct stadt from stadt_plz | ||
where stadt like "\_\_\_\_\_\_"; | ||
|
||
|
||
10- Ein Autor kann mehr als ein Buch schreiben. Ein Buch kann von mehreren Autoren gemeinsam verfasst werden. Erstellen Sie ein Entity-Relationship-Diagramm. Geben Sie die Attribute für die Entitäten und die Beziehung zwischen den Entitäten an. Fügen Sie die relevanten Attribute für beide Entitäten hinzu (mindestens 3 Attribute für jede Entität). | ||
|
||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-3.52 MB
...t Composition in JavaScript (2024-08-11) -Eric Elliott-2024-9781836644637 (Z-Library).pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-1.64 MB
...ient Programmers (free demo version) -Axel Rauschmayer-2022-9781091210097 (Z-Library).pdf
Binary file not shown.
5 changes: 3 additions & 2 deletions
5
sw/php/.idea/sonarlint/issuestore/e/8/e82088c5a994e1f30b73aa78c4e4ad820ffeed5c
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
$host="localhost"; | ||
$dbname="kunde_buch"; | ||
$dbname="kunde_buch_v4"; | ||
$user="root"; | ||
$password=""; | ||
try{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
|
||
$host = "localhost"; | ||
$dbname = "kunde_buch_v4"; | ||
$user = "root"; | ||
$password = ""; | ||
|
||
try { | ||
$db = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8", | ||
$user, $password); | ||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | ||
echo "Datenbank verbindung -> Erfolgreich <br>"; | ||
} catch (PDOException $e) { | ||
echo 'Verbindung-Fehler: ' . $e->getMessage(); | ||
exit(); | ||
} | ||
|
||
try { | ||
$q = $db->query("SELECT * FROM kunde"); | ||
$kunden = $q->fetchAll(PDO::FETCH_ASSOC); | ||
//print_r($kunden); | ||
} catch (PDOException $e) { | ||
echo 'Abfrage Fehler: <br> ' . $e->getMessage(); | ||
exit(); | ||
} | ||
|
||
|
||
?> | ||
<!DOCTYPE html> | ||
<html lang="de"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Kunden</title> | ||
<style> | ||
table { | ||
width: 50%; | ||
border-collapse: collapse; | ||
} | ||
table, th, td { | ||
border: 1px solid black; | ||
} | ||
th, td { | ||
padding: 10px; | ||
text-align: left; | ||
|
||
} | ||
tbody tr:nth-child(odd) { | ||
background-color: white; | ||
} | ||
tbody tr:nth-child(even) { | ||
background-color: gray; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<h2>KundenListe</h2> | ||
|
||
<table> | ||
<thead> | ||
<tr style="background-color:yellowgreen"> | ||
<th>Kunden-ID</th> | ||
<th>Name</th> | ||
<th>Vorname</th> | ||
<th>Telefonnummer</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<?php if (!empty($kunden)): $anzahlDerDatensaetze=0; ?> | ||
<?php foreach ($kunden as $kunde): ?> | ||
<tr> | ||
<?php if($kunde['kundennachname']=="Mustermann"): $anzahlDerDatensaetze++;?> | ||
<td><?php echo $kunde['kundennummer']; ?></td> | ||
<td><?php echo $kunde['kundennachname']; ?></td> | ||
<td><?php echo $kunde['kundenvorname']; ?></td> | ||
<td><?php echo $kunde['telefonnummer']; ?></td> | ||
<?php else:?> | ||
<td><?php echo "kundennummer"; ?></td> | ||
<td><?php echo "kundennachname"; ?></td> | ||
<td><?php echo 'kundenvorname'; ?></td> | ||
<td><?php echo 'telefonnummer'; ?></td> | ||
<?php endif; ?> | ||
|
||
</tr> | ||
<?php endforeach; ?> | ||
<?php else: ?> | ||
<tr> | ||
<td colspan="3">Keine Datensätze</td> | ||
</tr> | ||
<?php endif; ?> | ||
</tbody> | ||
|
||
<tfoot> | ||
<tr> | ||
<th> | ||
<?php echo $anzahlDerDatensaetze ." " . "Datensätze gefunden"; ?> | ||
</th> | ||
|
||
</tr> | ||
</tfoot> | ||
</table> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# OOP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
|
||
|