Kapitel 4-1
Welche Transaction IDs würden durch folgende Filterbedingungen zurückgegeben?
txn_date < '2005-02-26' AND (txn_type_cd = 'DBT' OR amount > 100)
Die Transaction IDs 1, 2, 3, 5, 6 und 7.
Kapitel 4-2
Welche Transaction IDs würden durch diese Filterbedingungen zurückgegeben?
account_id IN (101,103) AND NOT (txn_type_cd = 'DBT' OR amount > 100)
Die Transaction IDs 4 und 9.
Kapitel 4-3
Schreiben Sie eine Abfrage, die alle im Jahr 2002 eröffneten Konten zurückliefert.
mysql>SELECT account_id, open_date
->FROM account
->WHERE open_date BETWEEN '2002-01-01' AND '2002-12-31';
+------------+------------+ | account_id | open_date | +------------+------------+ | 6 | 2002-11-23 | | 7 | 2002-12-15 | | 12 | 2002-08-24 | | 20 | 2002-09-30 | | 21 ...
Get Einführung in SQL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.