database-design

High-quality ERD generator for PostgresQL under Linux?

Background MySQL Workbench can produce appealing and high-quality ERDs such as: Research What PostgreSQL ERD tools are available that meet the requirements? The following are unsuitable: dbVisualizer - Yellow squares. AquaFold - Yellow squares. SQL Developer - Coloured squares. Dia - Coloured squares. SQL Power Architect - Black a...

Marking deleted records in DB tables

Sometimes you want to mark a DB table record as deleted instead of deleting it permanently, right? How do you do that? So far I've been using a boolean "deleted" field but I'm not sure if it's a good apprach. ...

Entity Framework and multi-tenancy database design

I am looking at multi-tenancy database schema design for an SaaS concept. It will be ASP.NET MVC -> EF, but that isn't so important. Below you can see an example database schema (the Tenant being the Company). The CompanyId is replicated throughout the schema and the primary key has been placed on both the natural key, plus the tenant I...

How to move an element in a sorted list and keep the CouchDb write "atomic"

I have elements of a list in couchdb documents. Let's say these are 3 elements in 3 documents: { "id" : "783587346", "type" : "aList", "content" : "joey", "sort" : 100.0 } { "id" : "358734ff6", "type" : "aList", "content" : "jill", "sort" : 110.0 } { "id" : "abf587346", "type" : "aList", "content" : "jack", "sort" : 120.0 } A view ret...

Define tables from a part of my ER Diagram.

I have a ER-Diagram (Show in http://www.4freeimagehost.com/show.php?i=f82997ca4d5d.png). In the diagram you see 2 entities and a 1:N relataion together. Project has 2 columns as ProjectID, ProjectName. Employee has 3 colums as EmployeeID, EmployeeName and ProjectID. A project has ONLY 1 project-manager and project-manager is a employee. ...

How does one implement storage/retrieval of smart-search/mailbox features?

Hi All, I have a question regarding implementation of smart-search features. For example, consider something like "smart mailboxes" in various email applications. Let's assume you have your data (emails) stored in a database and, depending on the field for which the query will be created, you present different options to the end user....

How to represent "ALL" in Primary Key -foreign Key relationship.

I have to create a db design to store blacklisted fax numbers. I have created a table and one column of this table is customerID which is a foreign key to table Customer. Now i want to have a faxnumber which is blacklisted for all customers. How should i proceed with this. Should i use Null in this case. Please provide options ...

A format for storing personal contacts in a database

I'm thinking of the best way to store personal contacts in a database for a business application. The traditional and straightforward approach would be to create a table with columns for each element, i.e. Name, Telephone Number, Job title, Address, etc... However, there are known industry standards for this kind of data, like for examp...

(Database design studio for Linux) looking for better database free design studio then MySql Workbrench or phpMyAdmin for ubuntu

Hi, I looking for better database free design studio then MySql Workbrench OSS (bugs to much) or phpMyAdmin (dont have good table design diagram) for ubuntu. Thanks ...

Can you have 2 tables with identical structure in a good DB schema?

2 tables: - views - downloads Identical structure: item_id, user_id, time Should I be worried? ...

Which tables should be created to store all the kinds of files for online application?

Hi I new in database design. I have a question with my own few solution, what do you think? Which tables should be created for all the kinds files that stored in my online store (images, attached email files, text files for store email body, etc.) ? option 1: use seperate table for files types files{ id files_types_id FK file_path f...

(Database Design - products attributes): What is better option for product attribute database design?

Hi, I new in database design. What is better option for product attribute database design for cms?(Please suggest other options also). option 1: 1 table products{ id product_name color price attribute_name1 attribute_value1 attribute_name2 attribute_value2 attribute_name3 attribute_value3 } option 2: 3 tables products{ id product_na...

How do I save user specific data in an asp.net site?

I just set up user profiles using asp.net 3.5 using wvd. For each user I would like to store data that they will be updating every day. For example, every time they go for a run they will update time and distance. I intend to allow them to also look up their history of distance and time from any past date. My question is, what does th...

Concurency problem with Isolation - read-committed

I have to write a simple demo for amount withdrawl from a joint Bank amount .Andy and Jen holds a joint bank account with number 123 . Suppose they have 100$ in their account .Jen and Andy are operating their account at the same time and both are trying to withdraw 90$ at the time being .My transaction Isolation is set to read-committed...

Dynamic Table Column

Hi All, I have one scenario in which the user can define the column and that can be the master table. This master table has transaction table by ref its Primary key and also has some common column whose value is differ for each record. Example, user created table called XYZ and defined the column X1,X2,X3 etc,. And the Transaction tabl...

Many-to-one relationship in SQLAlchemy

This is a beginner-level question. I have a catalog of mtypes: mtype_id name 1 'mtype1' 2 'mtype2' [etc] and a catalog of Objects, which must have an associated mtype: obj_id mtype_id name 1 1 'obj1' 2 1 'obj2' 3 2 'obj3' [etc] I am trying to do this in SQLAlchemy by creating the f...

Invoice & Invoice lines: How do you store customer address information?

Hi I'm developing an invoicing application. So the general idea is to have two tables: Invoice (ID, Date, CustomerAddress, CustomerState, CustomerCountry, VAT, Total); InvoiceLine (Invoice_ID, ID, Concept, Units, PricePerUnit, Total); As you can see this basic design leads to a lot of repetiton of records where the client will have t...

Star Schema vs Snowflake Schema performance

Hi... I'm begin to developing a scial sharing website so I'm curious about database design Schema... So in Data-Mining Star-Schema is the best one but how about a social sharing website... And as a nature of the SS websites there will be (i hope :)) many users in same time... Which better for performance for overdose using... ...

Enum datatype versus table of data in MySQL?

I have one MySQL table, users, with the following columns: user_id (PK) email name password To manage a roles system, would there be a downside to either of the following options? Option 1: Create a second table called roles with three columns: role_id (Primary key), name, and description, then associate users.user_id with roles.ro...

Data Modeling Help - Do I add another table, change existing table's usage, or something else?

Assume I have the following tables and relationships: Person - Id (PK) - Name A Person can have 0 or more pets: Pet - Id (PK) - PersonId (FK) - Name A person can have 0 or more attributes (e.g. age, height, weight): PersonAttribute _ Id (PK) - PersonId (FK) - Name - Value PROBLEM: I need to represent pet attributes, too. As it t...