relational-database

what type of engine (InnoDB or MyISAM) should i use for my database for a website?

北城余情 提交于 2019-12-23 05:19:29
问题 I have a detabase ERD which have gen/spec (inheritance) and a lot of use of primary and foreign keys.i am going to develop my site in PHP ,So Please help me out.i wl b waiting for ur good replies. tanx 回答1: If you have an ERD (Relational Database modelling term) then you won't have "gen spec", you will have Relationallly modelled Supertype-Subtype tables. If you have "gen spec" then you don't have a Relational database, you have a filing system that you persist your objects to. So, which one

What is the most efficient way to specify user permissions in a database?

左心房为你撑大大i 提交于 2019-12-23 04:39:08
问题 I have an application that associates users with specific groups in a Facebook-style manner. For example: User A is associated with Group 1 and Group 2 User B is associated with Group 2 and Group 4 Users can create posts (small amounts of text) for each group that they belong to. I have two types of pages: the home page for the logged-in user, and a page for each group. The user's home page shows posts from every other user that is in every group that the logged-in user belongs to . The group

storing weekly targets in database

谁说胖子不能爱 提交于 2019-12-23 02:35:10
问题 i have the following requirement Sales Officer: Bob Week1 Week2 Week3 ................. Week52 Prod1 10 15 12 ................. 14 Prod2 20 14 10 ................. 17 . . . . . . Sales supervisor will set the targets for each sales officer on weekly basis. Sales officer may enter actual sales on daily basis for each product through a similar grid against the set targets e.g. Edit In the above case Supervisor has set target of 10 units for week 1 Now the sales Officer will enter the sales on

How to store custom entity properties in a relational database

女生的网名这么多〃 提交于 2019-12-23 01:16:15
问题 I'm designing a database for a application I'm developing. I have two tables where the entities can have custom application properties that will define how the data from each entity is used. Each entity can have zero to many properties and i want to know what the best way is to structure such data in a relational way. Should i have one table with foreign keys to each table and key/value columns or is there some better way to do it? 回答1: You are speaking of "Entity Attribute Value" tables.

How to model multilingual entities in relational databases

青春壹個敷衍的年華 提交于 2019-12-23 01:13:32
问题 If we are going to develop a multilingual application, shall we store translations in resource files or the database ? Suppose we choose to do it in the database. Is there a standard way to model multilingual entities in the Relational Model ? 1. One Big Translation Table We can store all the translations in one table and use language-neutral keys for the attribute values. Person ( SSN , FirstName, LastName, Birthday) Translation ( key , langid , translation) 2. One Translation Table For Each

Is it possible to use JDBC as an abstraction layer for RDBMS?

情到浓时终转凉″ 提交于 2019-12-22 18:07:13
问题 JDBC provides an API, which may be used to connect to different RDBMS or similar datastores. But the datastores differ in implementation (e.g. SQL dialects). Is it possible to use JDBC in such a way, that my queries and statements work on most common RDBMS (e.g.: Oracle, PostgreSQL, SQL Server, MySQL)? That question is interesting for me at two aspects: * Common SQL (INSERT, UPDATE, SELECT etc.) * Accessing Meta data (getting information about tables and columns) I am currently experimenting

Rails 5: Displaying form from Joined table

时光怂恿深爱的人放手 提交于 2019-12-22 13:49:51
问题 This is my first foray into joined tables and Many-to-Many relationships and I am relatively new to Ruby/Rails as well. This is a direct follow up to a previous question where I built out the appropriate related tables/Models. But for sake of clarify, I'll redefine the layout here... My Models: order.rb class Order < ApplicationRecord belongs_to :user has_many :quantities has_many :meals, through: :quantities end meal.rb class Meal < ApplicationRecord has_many :quantities has_many :orders,

Decomposition that does not preserve functional dependency

荒凉一梦 提交于 2019-12-22 11:06:19
问题 When can a BCNF decomposition not preserve functional dependency... I am trying to figure this out for say R=(V,W,X,Y,Z) 回答1: The point of a BCNF decomposition is to eliminate functional dependencies that are not of the form key -> everything else So if a table has a FD, say A -> B, such that A is not a key, it means you're storing redundant data in your table. As a result, you create a new table with columns A and B, with A being the key, then you remove B from your original table. As a

How to reference groups of records in relational databases?

一个人想着一个人 提交于 2019-12-22 09:25:40
问题 Suppose we have the following table structures: Humans | HumanID | FirstName | LastName | Gender | |---------+-----------+----------+--------| | 1 | Issac | Newton | M | | 2 | Marie | Curie | F | | 3 | Tim | Duncan | M | Animals | AmimalID | Species | NickName | |----------+---------+----------| | 4 | Tiger | Ronnie | | 5 | Dog | Snoopy | | 6 | Dog | Bear | | 7 | Cat | Sleepy | I wonder how to reference a group of records in other tables. For example, I have a Foods table and an EatenBy

How to model a relational database into a neo4j graph database?

南楼画角 提交于 2019-12-22 07:10:09
问题 I have a relational database (about 30 tables) and I would like to transpose it in a neo4j graph database, and I don't know where to start... Is there a general way to transpose tables and/or tuples into a graph model ? (relations properties, one or more graphs ?) What are the best sources of documentation ? Thanks for any help, Best regards 回答1: First, if at all possible, I'd suggest NOT using your relational DB as your "reference" for transposing to a graph model. All too often, mistakes