find all functional dependencies for attribute closure? - relational-database

It is for a university assignment. I have to list all non-trivial functional dependencies that are applicable, while also trying to ensure that all tables in my schema are 3NF.
I have created an ER Diagram & Relational Schema for my dataset. How can I now find all functional dependencies for attribute closure?

Related

Pros and cons of pydantic compared to json schemas

As far as I understand Pydantic and Json Schemas provide similar functionality - both can be used for validating data outputs.
I am interested to understand the pros and cons of using each one. A few questions I am interested in:
Are there any differences in accruacy between them?
Which one is faster to implement in terms of development time?
Is there any functionality difference between the two? i.e. features one supports, that the other doesn't?
These are only examples of questions I am thinking about, I would love to know more about the pros and cons also.
WHile both Pydantic and Json Schema are used to verify data adheres to a certain format they're serve different use-cases:
Json Schema: a tool for defining JSON structures independent of any implementation or programming language.
Pydantic: a python specific tool for validating input data against a pydantic specific definition
You can find many implementations of Json Schema validator in many languages those are the tools that you might want to check out in a 1:1 comparison to pydantic. However, pydantic understands Json Schema: you can create pydantic code from Json Schema and also export a pydantic definition to Json Schema. They should be equivalent from a functional perspective. You can find a type mapping in the pedantic docs.
So, which should you use? Your use-case is important but most likely its not either/or. If you're python-only and prefer to define your schema in python directly definitely go for pydantic. If you need to exchange the schemas across languages or want to handle schemas generated somewhere else, you can add Json Schema on top and pydantic will be able to handle it.

How to map static properties to RDBMS

I have:
class Settings{
static int temperature;
}
Tables roughly corrospond to object instances how do you represent static data
What's is a correct way to implementing this kind of behaviour in an RDBMS ?
This type of mapping is one of the conceptual and technical difficulties that are often encountered when a relational database management system is being used by a program written in an object-oriented programming language.
A major mismatch between existing relational and OO languages is the type system differences. The relational model strictly prohibits by-reference attributes, whereas OO languages embrace and expect by-reference behavior. Scalar types and their operator semantics can be vastly different between the models, causing problems in mapping.
It has been argued, by Christopher J. Date and others that a native mapping between classes and relational schema is a fundamental design mistake
See Object relational impedance mismatch.

Differences between EER and UML

I've downloaded MySQL workbench and can create a EER diagram.
What's the difference between this and a UML diagram?
Where does a ERD come into this?
I think by UML diagram you mean : UML Class Diagram. [ there are other UML diagrams also]
EER (Enhanced entity–relationship) Diagram-Model
Used for Database Design. Like class diagrams support also subclass -superclass [specialization and generalization]. So entities in EER diagrams has attributes not methods.Because they show just plain data.
Note: ER [entity–relationship] Diagrams are origin of EER. They are from Structured Analysis. Also used for database modeling.How ER become to EER? I think because of Object Oriented Style Hype.
UML Class Diagrams
Used for Object Oriented Analysis-Design.
Can be used to model databases also : there are UML class profiles for it.
[I think UML profiles for Database Designs are NOT good as ER diagrams]
But in simple terms classes are blueprints in which objects instantinated . So classes may have methods-functions as well as attributes.Software classes definitely has methods but conceptual classes[ used for domain modeling] may not.
The primary difference between ERD and UML is that ERD stands for Entity Relationship Diagram, a type of diagram (as explained above), while UML stands for Uniform Modeling Language, which is essentially a standard defining a modeling language commonly used in software development, especially in Object Oriented Program.
UML also proposes standard diagram types (as noted above), usually grouped into structural or behavioral diagrams. Most DB GUIs use ERDs, which are better suited for the domain and most users don't need formal, academic diagrams.
Note that most software teams like to site UML as a reference; yet, don't usually implement UML to full spec or with academic rigor when creating documentation diagrams.
As a rule of thumb, if you want to model DB entities/relationships you are probably looking for an ERD but if you want to model an entire program/system then you probably need one-many of the different UML diagrams.

Origin of hierarchical structuring

Why are libraries located behind com/ or net/ directory structures?
This is agnostic to Flash, Flex or any language. It's been used for a long time in general software development. I believe it stemmed from the Java package structure, but I'm not sure. It's used because it's now a standard on how to do things and helps split up projects in a fairly unique way.
It normally goes like <domain extension>/<domain>/<project name>/<sub component>/<whatever>.
This format/structure is called the reverse domain name structure. This structure is used for the package namespace for your classes.
Here is a good article on The Classpath Demystified by Jody Hall
If you're talking about class packages the point is every package should be unique. Imagine you wrote a class named MyGreatClass. Without any package or within some simple package test.MyGreatClass (this is called fully qualified class name). In this project you've decided to use some library where somebody wrote another test.MyGreatClass class (he/she didn't realize you have another one). So you'll have a conflict of two classes.
To avoid that situation there is a convention to start classes with author's site name in reverse order. Taking in mind every domain name is unique. Following this convention you can be sure you class won't conflict with others.
As far as com and net are most common domains you can see com.example (for http://example.com/) and net.example (for http://example.net/) very often.
Advantages of OOP
Inheritance
maintainability
Re-usability
A class is considered an object.
Having a package structure allows for all the advantages of OOP
Having a standard folder "com" where all your custom classes are allows you to reuse those classes with ease.
All libraries that I did not create, I make sure goes into my com folder. So when I make a new project I just have to point the project settings to that folder, then I can access those libraries with just having to do an import statement.
For example The AS3crypto library I have in the com folder.

Does Model Driven Architecture play nice with LINQ-to-SQL or Entity Framework?

My newly created system was created using the Model Driven Architecture approach so all I have is the model (let's say comprehensive 'Order' and 'Product' classes). These are fully tested classes that support the business of my application. Now it's time to persist these classes as objects on the harddrive and at some later time retrieve them in the same state (thinking very abstractly here). Typically I'd create an IOrderRepository interface and eventually a ADO.NET-driven OrderRepository class with methods such as GetAll(), GetById(), Save(), etc... or at some point a BinaryFormatter-driven OrderRepostiroy class that serves a similar purpose through this same common interface.
Is this approach just not conducive to LINQ-To-Sql or the Entity Framework. Something that attempts to build my model from a pre-existing DB structure just seems wrong. Could I take advantage of these technologies but retain this 'MDA' approach to software engineering?
... notice I did not mention that this was a Web App. It may or may not be -- and shouldn't matter.
In general, I think that you should not make types implementing business methods and types used for O/R mapping the same type. I think this violates the single responsibility principle. The point of your entity types is to bridge the gap between relational space and object space. The point of your business types is to have collections of testable behavior. Instead, I would suggest that you project from your entity types onto your business types when materializing objects from the database. Separating these two allows your business methods and data mappings to evolve independently, which is very important, especially if you cannot always control the schema of the database. I explain this idea more fully in this presentation.