relational-database

PostgreSQL locking mode

寵の児 提交于 2019-12-08 07:23:01
问题 From this doc http://www.postgresql.org/docs/current/static/explicit-locking.html I knew PostgreSQL provides various lock modes to control concurrent access to data in tables. My problem is I have many sessions will accessing my DB , but I'm confuse should I made 1 big table with 40 column or many tables with fewer column (one to one relationship). Because when I select the data I will select all of it ---> it takes more time when I select from many tables using INNER JOIN, but it takes less

Transforming (Synchronizing) Data between SQL to HBase

巧了我就是萌 提交于 2019-12-08 07:08:41
问题 We are overhauling our product by completely moving from Microsoft and .NET family to open source (well one of the reasons is cost cutting and exponential increase in data). We plan to move our data model completely from SQL Server (relational data) to Hadoop (the famous key-Value pair ecosystem). In the beginning, we want to support both versions (say 1.0 and new v2.0). In order to maintain the data consistency, we plan to sync the data between both systems, which is a fairly challenging

DB design: one large DB for all customers or many small DBs

给你一囗甜甜゛ 提交于 2019-12-08 06:17:08
问题 Looking for any suggestions or advise or even best practices. I have developed an online database using php and mysql. It allows companies to log complaints and resolutions etc. There is a user database for login and a cip database for logging the main data. 2 companies are trialing and testing the database. At the moment each company is using separate databases and separate html pages. I am wondering what the best way to add more companies. Ideas that I have are: 1. To have one large

SQL Server database design users, groups, roles, memebers

和自甴很熟 提交于 2019-12-08 06:13:22
问题 I have the following SQL Server db with one table so far. ---------------- |Users | ---------------- | UserId PK | | | | Other fields | ---------------- I need to add few more tables to it which is not a problem but this is the goal: ---------------- ---------------- ---------------- ---------------- |Users | |Roles | | Teams | | Groups | ---------------- ---------------- ---------------- ---------------- | UserId PK | | RoleId PK | | TeamId PK | | GroupId PK | | | | | | | | | | Other fields

Normalization Theory Explanation needed

青春壹個敷衍的年華 提交于 2019-12-08 05:40:32
问题 I'm looking at a specific example of a relation with a composite primary key. Based on its functional dependencies, I know it is in 1NF. While normalizing it to 3NF I came across a situation I have not yet encountered. I followed the steps for all partial dependencies and transitive dependencies, but the last step of normalizing to 3NF requires you to create a relation that contains the primary key and all non-prime attributes dependent on it. In my specific case, I have the primary key, but

Does my table need more normalization?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 04:52:40
问题 I am making a simple public cashbook DB table to calculate how much my friends and I paid for having meal together. My first table was only a single table and it had a column "person" with non-atomic values, so I divided my table into two tables like above. But I'm not sure this is normalized enough. Is there any functional dependency which should be normalized but I don't know its existence? (I'm going to use MySql but you can answer me with any kind of DBMS.) 回答1: Normalization requires

normalization transitive dependencies

▼魔方 西西 提交于 2019-12-08 03:35:01
问题 I need help with normalization. I am having trouble understanding how to complete the 3NF on my database project. Here is the 1NF Normalized Table Donut ID(PK) Donut Name Description Unit Price Donut Order ID Qty CustomerID Last Name First Name Last Name Street Address Apt City State Zip Home Phone Mobile Phone Other Phone Order Date Special Notes 2NF Donut Table DonutID (PK) Donut Name Description Unit Price Sales Order Table Sales OrderID (PK) CustomerID Last Name First Name Last Name

Elegant schema to log users' actions

元气小坏坏 提交于 2019-12-07 22:12:18
问题 I have a database schema to log operations users perform in my webapp: Log --- Id Log_Type_Id Performed_by_Person_Id Performed_to_Person_Id Comment_Id Story_Id Photo_Id etc_Id Person_Log ---------- Person_Id Log_Id This way I can notify users of entries in their log with details about what exactly happened. The problem is the Log table has to contain every possible type of user operation (they modified a story or comment, created a story or comment or photo, updated a profile, etc). And

What is Relational Integrity [closed]

我是研究僧i 提交于 2019-12-07 16:31:01
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 10 months ago . In the question How to Set Up Primary Keys in a Relation, PerformanceDBA talked about Relational Integrity and pointed out that it is different from Referential Integrity . I have heard of Referential Integrity , which is related to Foreign Keys . But Relational Integrity seems

Modeling multiple many to many relationships between the same entities in a relational database

匆匆过客 提交于 2019-12-07 15:42:40
问题 When two tables have a many-to-many relationship or when a table has a many-to-many relationship with itself we can model that with a junction table. However the type of the relationship can expend beyond the original type, for example: Requirements: we have users. each user can have 0 or more other users as friends Solution: a users table and a junction table called "user_user". Then we discover a new requirement: some friendships are romantic or in other words two users can be connected in