#LearningSQL

🚀 Wednesday, September 25, 2024 — Progress Report 📊

🌟 Day 269
🌟 Day 3
🌟

🔍 Today's Focus:
1️⃣ Daily Reading:

freeCodeCamp News 📰: 1 article
Daily.dev 🔥: 1 article
2️⃣ Stanford Databases Course:

Relational Databases and SQL: Day 1 🧠💻
📚 Learning Relational Algebra, SQL queries, and diving deep into and !

👾 Consistency is key! Let's keep building! 💪

2021-09-28

Könnte schlimmer sein.
Das »Learning SQL«-Buch.
Es könnte so sein wie »SQL Handbuch für Einsteiger«.

Die Beispieltabellen sind so richtig gruselig.
Für einen »Sportverein« wird in der Mitgliedertabelle nicht das Geburtsdatum gespeichert, sondern das Alter in Jahren. 🤦🏼‍♂️😭🤬🤦🏼‍♂️

#OspalhReads #ospalhLiest #LearningSql #SqlHandbuch

2021-09-19

Teilweise ist das Buch einfach schlecht – oder gar nicht – recherchiert.
Soweit ich weiß gibt es 37 Zeitzonen. Jedenfalls mehr als 24.
timeanddate.com/time/current-n
#OspalhReads #ospalhLiest #LearningSql #zeitzone

Bildschirm-Text.
»24« und »time zones« ist markiert.
Gesamter Text:

Dealing with Time Zones

Because people around the world prefer that noon coincides roughly with the sun's peak at their location, there has never been a serious attempt to coerce everyone to use a universal clock. Instead, the world has been sliced into 24 imaginary sections, called time zones ; within a particular time zone, everyone agrees on the current time, whereas people in different time zones do not. While this seems simple enough, some geographic regions shift their time by one hour twice
2021-09-19

Und keine Erwähnung von Bobby Tables im Abschnitt »Working with String Data«
xkcd.com/327/
#OspalhReads #ospalhLiest #LearningSql #sqlinjection #bobbytables #xkcd

2021-09-19

Noch einen hinten dran.
Ich glaube, ich habe gerade einen Bug in MariaDB entdeckt.

Im Lehrbuch wird nicht erklärt, dass man in ein 30 Zeichen¹ langes DB-Feld einen String mit einer Länge (length()) von 77 Zeichen² unterzubringen.

MariaDB ist da auch verwirrt.
Es benutzt anscheinend die eigene length()-Funktion, um Platz für den Ausgabestring zu schaffen, auch wenn eine andere Länge gemeint ist.

#OspalhReads #ospalhLiest #LearningSql #unicode #MariaDB

Text-Screenshot:
MariaDB [bank]> SELECT vchar_fld, LENGTH(vchar_fld) varchar_length  FROM string_tbl;
| vchar_fld                                                                     | varchar_length |
| ÿïıñÆÅij—­•·é⁉‽⌀🗦🗧↔→ğǧ öẞßø—⸺★★                                                |             77 |
1 row in set (0.00 sec)

MariaDB [bank]> describe string_tbl;
| Field     | Type        | Null | Key | Default | Extra |
| char_fld  | char(30)    | YES  |     | NULL    |       |
| vchar_fld | varchar(30) | YES  |     | NULL    |       |
| text_fld  | text        | YES  |     | NULL    |       |
3 rows in set (0.01 sec)

mit Mehr Rahmen aus »-« und  »+«-Zeichen um die Ausgaben.
2021-09-19

Internationalization is hard.
Things that ar wrong in this paragraf:

#OspalhReads #LearningSql

Screen text.
multinational, accented and ö, and 255 and ASCII ar markt, in red, blue and orange.

full text:

Including special characters

If your application is multinational in scope, you might find yourself working with strings that include characters that do not appear on your keyboard. When working with the French or German languages, for example, you might need to include accented characters such as é or ö. The SQL Server and MySQL servers include the built-in function char() so that you can build strings from any of the 255 characters in the ASCII character set (Oracle Database users can use the
2021-09-12

Yeah.
The author goes on and uses “Gender is always 'F' or 'M'” as an example on how these constraints work and then pretends to read minds.
“definitely not what you intended” 🤬
I’ll let @foone@twitter comment on that a bit.
twitter.com/Foone/status/14348
twitter.com/Foone/status/13932

#OspalhReads #ospalhLiest #LearningSql #gender

Text:
“SET gender = 'Z'” is markt.

Full Text:

   mysql> UPDATE person
        -> SET gender = 'Z'
        -> WHERE person_id = 1;
    Query OK, 1 row affected, 1 warning (0.01 sec)
    Rows matched: 1  Changed: 1  Warnings: 1Text:
“the MySQL server sets the gender column to the empty string (''), which is definitely not what you intended.” is markt.

Full text:
This is what I would call a soft error, since the MySQL server didn't reject your statement but also didn't produce the expected results. In order to resolve the problem, the MySQL server sets the gender column to the empty string (''), which is definitely not what you intended. Personally, I would have preferred to have had the update statement rejected with an error message, which is what most other database servers would have done.
2021-09-12

Nachteil von E-books: Man kann sie nicht so einfach frustriert💢 an die Wand werfen.
#OspalhReads #ospalhLiest #LearningSql

Text with “person”  and “ gender ENUM('M','F'),” markt.

Full text:

Learning SQL

 gender ENUM('M','F'),

Here's how the person table definition looks with enum data types for the gender column:

    CREATE TABLE person
     (person_id SMALLINT UNSIGNED,
      fname VARCHAR(20),
      lname VARCHAR(20),
      gender ENUM('M','F'),
      birth_date DATE,
      address VARCHAR(30),
      city VARCHAR(20),
      state VARCHAR(20),
      country VARCHAR(20),
      postal_code VARCHAR(20),
      CONSTRAINT pk_person PRIMARY KEY (person_id)
     );
2021-09-11

Yes, i know. But i hav to learn about it anyway.
#OspalhReads
#LearningSql #Sql

Part of the e-book “Learning SQL”:
“The SQL language is broken”
Actually it’s only part of the sentence
“The SQL language is broken into several categories.”

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst