Kirchenchor / textadventure

Learning project
GNU General Public License v3.0
0 stars 0 forks source link

Task: Databases introduction #9

Open cseyda opened 6 years ago

cseyda commented 6 years ago
  1. read and try the code examples: https://docs.python.org/3/library/sqlite3.html
  2. i searched one minute for some very basic introduction to databases, but i haven't found one; therefore try to understand this (in context to the code examples above):
    • a database is a set of tables
    • a table is like a spreadsheet: it has columns, and rows
    • every table should have a column representing an unique identifier (ID, called primary key), like a serial number, email-adress, or whatever can uniquely represent a row.
    • you can get information across different tables with queries, for example:
    • one table with users (name, adress, sex, eye-color, fingerprint, hobbies, ...)
    • one table with movies (name, first screening, actors, dollars earned, ...)
    • one table with the information which user has seen which table, by using the IDs of users, movies (ID user, ID movie, these are called FOREIGN KEY, because they represent the Primary key of the tables)

now you could have a QUERY with: Get me the color of all female users that have seen every movie from 1998.

please ask questions if something is not clear. this should be everything you need to understand basic databases without much special language, but you now could build a site like facebook :)

Acidburn707 commented 6 years ago

Sollte ich kapiert haben. Wegen Syntax wird man dann halt wieder einige male nachschauen müssen.

cseyda commented 6 years ago

jo, syntax ist erstmal weniger wichtig.

grundlegend verstehen ist wichtiger, damit ihr euch grob vorstellen könnt, wo die daten wie liegen, und warum man dann ergebnisse bekommt.

cseyda commented 6 years ago

und, dass das beispiel funktioniert natürlich ^^

cseyda commented 6 years ago

@burningox ?