Last active
December 14, 2019 14:58
-
-
Save LaBlazer/fb4b7eac791fb8c67df3e3f47dc62144 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
vstupy = {} | |
vstupy["User"] = ["id", "email", "password", "name", "surname", "aid", "phone"] | |
vstupy["Courier"] = ["id", "email", "password", "name", "surname", "aid", "phone", "nin", "iban"] | |
vstupy["Restaurant"] = ["id", "email", "password", "name", "description", "logo", "opening_hours", "aid", "phone", "iban"] | |
vstupy["Address"]= ["id", "street", "city", "country", "postal_code"] | |
vstupy["Position"]= ["id", "oid", "latitude", "longtitude", "time"] | |
vstupy["Menu"]= ["id", "rid", "mid", "name", "price", "picture"] | |
vstupy["Order"] = ["id", "uid", "cid", "rid", "state", "created", "price", "courier_rating", "restaurant_rating"] | |
vstupy["OrderItem"]= ["id", "oid", "mid", "amount"] | |
with open("udbs.txt", "w", encoding="utf-8") as fs: | |
for key, values in vstupy.items(): | |
fs.write(key) | |
fs.write("\n1. Funkčné závislosti") | |
fs.write(f"\na. {values[0]} -> ") | |
print(*values[1:], sep=", ", end="\n", file=fs) | |
fs.write("\n2. Určenie uzávery kľúča") | |
fs.write(f"\n{{ {values[0]} }} += {{ ") | |
print(*values, sep=", ", end=" }", file=fs) | |
for j in values[1:]: | |
fs.write(f"\n{{ {j} }} += {{ {j} }}") | |
fs.write("\n\n3. Normy") | |
fs.write(f"\nRelácia {key} je v:") | |
fs.write("\n1.NF - atribúty obsahujú len atomické hodnoty") | |
fs.write("\n2.NF - nerieši sa, neobsahuje viachodnotový PK") | |
fs.write("\n3.NF - neexistuje netriviálna závislosť medzi nekľúčovými atribútmi") | |
fs.write("\nBoyce-Coddova NF - pre každú netriviálnu funkčnú závislosť X -> Y platí, že X je kľúč.\n\n\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment