relational-database

Proper database model for a user feedback system (an interesting case)

元气小坏坏 提交于 2019-12-17 09:57:57
问题 I am developing an application using PHP and Yii Framework. I've been thinking about the most suitable database structure for the given functionality and here's what I've come up with. Yet I'm not 100% positive that's how it should be done so I've decided to ask the community. App Description: Registered users may participate in an event. Every event can have an unlimited number of users, called "participants of the event"). Once the event is over, every participant can leave a feedback about

Minimum no of tables that exists after decomposing relation R into 1NF?

旧城冷巷雨未停 提交于 2019-12-17 06:54:14
问题 Consider the relation R(A, B, C, D, E, F, G) with the following types of attributes:- Total No of Keys = 1 = {A} Set of Simple (or) Atomic (or) Single Valued Attributes = {B, C} Set of Multivalued Attributes = {D, E} Set of Composite Attributes = { F, G} What would be the minimum no of tables that exists after decomposing relation R into 1NF? (A) 3 (B) 2 (C) 4 (D) 5 My attempt: We needed different table for each multivalued attributes with given key(A), total = 2 Similarly, we needed

When I should use one to one relationship?

穿精又带淫゛_ 提交于 2019-12-17 06:26:10
问题 Sorry for that noob question but is there any real needs to use one-to-one relationship with tables in your database? You can implement all necessary fields inside one table. Even if data becomes very large you can enumerate column names that you need in SELECT statement instead of using SELECT * . When do you really need this separation? 回答1: 1 to 0..1 The "1 to 0..1" between super and sub-classes is used as a part of "all classes in separate tables" strategy for implementing inheritance. A

Pros/cons of document-based databases vs. relational databases

我怕爱的太早我们不能终老 提交于 2019-12-17 06:24:21
问题 I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: CRUD of entities with some fields which have unique index on it ecommerce web app like eBay (better description here). And I'm begining to think that a Document-based database isn't the best choice to address these requirements. Furthermore, I can't imagine a use for a Document based database (maybe my imagination is too limited). Can you explain to me

Pros/cons of document-based databases vs. relational databases

依然范特西╮ 提交于 2019-12-17 06:23:12
问题 I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: CRUD of entities with some fields which have unique index on it ecommerce web app like eBay (better description here). And I'm begining to think that a Document-based database isn't the best choice to address these requirements. Furthermore, I can't imagine a use for a Document based database (maybe my imagination is too limited). Can you explain to me

How to Implement Referential Integrity in Subtypes

﹥>﹥吖頭↗ 提交于 2019-12-17 06:13:46
问题 I have the following tables in a relational database: [Sensor] LocationId [PK / FK -> Location] SensorNo [PK] [AnalogSensor] LocationId [PK/FK -> Sensor] SensorNo [PK/FK -> Sensor] UpperLimit LowerLimit [SwitchSensor] LocationId [PK/FK -> Sensor] SensorNo [PK/FK -> Sensor] OnTimeLimit [Reading] LocationId [PK/FK -> Sensor] SensorNo [PK/FK -> Sensor] ReadingDtm [PK] [ReadingSwitch] LocationId [PK/FK -> Reading] SensorNo [PK/FK -> Reading] ReadingDtm [PK/FK -> Reading] Switch [ReadingValue]

Relational table naming convention [closed]

☆樱花仙子☆ 提交于 2019-12-17 04:08:32
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I'm starting a new project and would like to get my table- and column names right from the start. For example I've always used plural in table names but recently learned singular is correct. So, if I got a table "user" and then I got products that only the user will have,

NoSql vs Relational database

拟墨画扇 提交于 2019-12-17 02:39:10
问题 Recently NoSQL has gained immense popularity. What are the advantages of NoSQL over traditional RDBMS ? 回答1: Not all data is relational. For those situations, NoSQL can be helpful. With that said, NoSQL stands for "Not Only SQL". It's not intended to knock SQL or supplant it. SQL has several very big advantages: Strong mathematical basis. Declarative syntax. A well-known language in Structured Query Language (SQL). Those haven't gone away. It's a mistake to think about this as an either/or

When and why are database joins expensive?

℡╲_俬逩灬. 提交于 2019-12-17 01:24:08
问题 I'm doing some research into databases and I'm looking at some limitations of relational DBs. I'm getting that joins of large tables is very expensive, but I'm not completely sure why. What does the DBMS need to do to execute a join operation, where is the bottleneck? How can denormalization help to overcome this expense? How do other optimization techniques (indexing, for example) help? Personal experiences are welcome! If you're going to post links to resources, please avoid Wikipedia. I

Yii2 RESTful relational data

天涯浪子 提交于 2019-12-14 04:23:33
问题 I am having some trouble getting the Yii2 RESTful API returning relational data. I have this working when viewed through the frontend but i am trying to get the same data through the API and its not working the same way. Tables country - PK is population_id population - Foreign Key is country.population_id I am getting this error: { "success": false, "data": { "name": "Invalid Configuration", "message": "The \"query\" property must be an instance of a class that implements the QueryInterface