relational-database

For a many to many relationship is it better to use relational database or nosql?

流过昼夜 提交于 2019-12-02 21:19:40
问题 For a many to many relationship is it better to use relational database or nosql? Let's assume you have a bunch of users. And each user can have friends that are from the same users table. So it's essentially a many to many relationship to itself. Many to many relationship in relational database will create a third table. Now I was wondering assuming this user table is huge like millions of people in there, this third table would be thus be gigantic assuming let's say each person has more

Keep getting the error TypeError: function takes at most 2 arguments (3 given)

帅比萌擦擦* 提交于 2019-12-02 21:13:42
问题 I am currently working on my coursework project for college which involves a quiz which stores all background data in a database. With the addition of foreign keys, i have tried to find a way to merge the data from the foreign key between two tables. For example , The users table stores user data and their UserID. The data table will store information about the level of the quiz,etc along with that specific user id. How would that information be automatically updated from the two tables when

Database Structure involving dynamic fields

旧街凉风 提交于 2019-12-02 21:08:06
Im working on a project. Its mostly for learning purposes, i find actually trying a complicated project is the best way to learn a language after grasping the basics. Database design is not a strong point, i started reading up on it but its early days and im still learning. Here is my alpha schema, im really at the point where im just trying to jot down everything i can think of and seeing if any issues jump out. http://diagrams.seaquail.net/Diagram.aspx?ID=10094# Some of my concerns i would like feedback on: Notice for the core attributes like area for example, lets say for simplicity the

Relational vs Non-Relational Data Modeling - what's the difference

天涯浪子 提交于 2019-12-02 19:07:34
I'm new to databases and I've never worked with any RDBMS. However I get the basic idea of relational databases. At least I think I do ;-) Let's say I have a user database with the following properties for each user: user id name zip city In a relational database I would for example model it in a table called user user id name location_id and have a second table called location location id zip city And location_id is a foreign key (reference) to an entry in the location table. If I understand it right the advantage is here, if the zip code for a certain city changes I only have to change

Data Modeling: Supertype / Subtype

三世轮回 提交于 2019-12-02 18:55:41
Looking to figure out the proper way to model the below requirements. There are 3 types of “parties” to be concerned with, a Fan, a Band, and a BandMember. That BandMember will always be associated with a Band and can also be a Fan of any band. There are common attributes between a Fan, a Band, and a BandMember, but each of these 3 will also have their own unique attributes. A Fan can be a fan of of any Band or none at all This is a small part of a bigger thought but it is creating confusion in expanding the model. I believe it would have to be diagram 2 or some other option since I don't see

best way to store 1:1 user relationships in relational database

回眸只為那壹抹淺笑 提交于 2019-12-02 18:31:19
What is the best way to store user relationships, e.g. friendships, that must be bidirectional (you're my friend, thus I'm your friend) in a rel. database, e.g. MYSql? I can think of two ways: Everytime a user friends another user, I'd add two rows to a database, row A consisting of the user id of the innitiating user followed by the UID of the accepting user in the next column. Row B would be the reverse. You'd only add one row, UID(initiating user) followed by UID(accepting user); and then just search through both columns when trying to figure out whether user 1 is a friend of user 2. Surely

Safe modelling of relational data in Haskell

冷暖自知 提交于 2019-12-02 17:17:10
I find it very common to want to model relational data in my functional programs. For example, when developing a web-site I may want to have the following data structure to store info about my users: data User = User { name :: String , birthDate :: Date } Next, I want to store data about the messages users post on my site: data Message = Message { user :: User , timestamp :: Date , content :: String } There are multiple problems associated with this data structure: We don't have any way of distinguishing users with similar names and birth dates. The user data will be duplicated on

What is the difference between a candidate key and a primary key?

拥有回忆 提交于 2019-12-02 16:07:13
Is it that a primary key is the selected candidate key chosen for a given table? Candidate Key – A Candidate Key can be any column or a combination of columns that can qualify as unique key in database . There can be multiple Candidate Keys in one table. Each Candidate Key can qualify as Primary Key. Primary Key – A Primary Key is a column or a combination of columns that uniquely identify a record . Only one Candidate Key can be Primary Key. More on this link with example John Woo's answer is correct, as far as it goes. Here are a few additional points. A primary key is always one of the

Relational vs. Dimensional Databases, what's the difference?

余生长醉 提交于 2019-12-02 15:11:00
I'm trying to learn about OLAP and data warehousing, and I'm confused about the difference between relational and dimensional modeling. Is dimensional modeling basically relational modeling, but allowing for redundant/un-normalized data? For example, let's say I have historical sales data on (product, city, # sales). I understand that the following would be a relational point-of-view: Product | City | # Sales Apples, San Francisco, 400 Apples, Boston, 700 Apples, Seattle, 600 Oranges, San Francisco, 550 Oranges, Boston, 500 Oranges, Seattle, 600 While the following is a more dimensional point

Entity Framework inserting duplicates on Seeding database [duplicate]

我只是一个虾纸丫 提交于 2019-12-02 14:56:33
问题 This question already has an answer here : Entity Framework database mapping relationships (Duplicate creation using Seed() method) (1 answer) Closed 12 months ago . EDIT---- From here i tried assigning Id's in the seeding method and this was OK for Languages but not when i added Address to the customer and assign Id's as well to these addresses, than it created the dupes again... Both Address & Language are declared as DbSet<...> in my Context What i tried: Adding 1 Address (with Id) - add