Database design is the process of specifying the logical and/or physical parts of a database. The goal of database design is to make a representation of some "universe of discourse" - the types of facts, business rules and other requirements that the database is intended to model.

learn more… | top users | synonyms (2)

4
votes
3answers
504 views

What are the pros and cons of using my customer codes as a primary key?

I am designing a database for one of my sales teams. Right now, the goal is to get a master list of customers and their mailing addresses, but the DB will eventually expand to track some other ...
0
votes
4answers
84 views

SqlServer: can one table's PK be the FK of other two table's? [duplicate]

I have three tables project, users and proj_user. The PK of proj_user table is the FK of project and users table's pk e.g.(project_id,user_id) My question is, is it possible for the project_id and ...
5
votes
1answer
111 views

For alignment optimized table is bigger than original table - why?

In another question I learned that I should optimize the layout from one of my tables to save space and have better performance. I did this, but ended up with a larger table than before and ...
3
votes
2answers
47 views

Fetch all words from column with like

I have a column with description and inside it can contain # value . what I want is all the words searched from that column with #tag This is my query SELECT description FROM photo where ...
1
vote
2answers
182 views

Relational Model vs. Database Products [closed]

The formal Relational Model (logical level) for databases is not exactly the same thing as you get with MySQL, Oracle or other major products / implementations of ‘relational’ database management ...
1
vote
0answers
60 views

DB Design: Looking for Performance improvement with a Column used in all SQL Queries

I recently got added to a new ASP .NET Project(A web application) .There were recent performance issues with the application, and I am in a team with their current task to Optimize some slow running ...
0
votes
1answer
63 views

When to use a multidimensional relationship in an ERD?

When to use a multidimensional relationship in an ERD? My textbook is in Dutch, and the two paragraphs that explain about multidimensional relationships is too vague and brief. I don't understand when ...
0
votes
0answers
32 views

SQL query to fetch results for multiple many to many relationship tables

We are developing a database for storing licensedetails of source code, archives, shareobjects, binary. We parse a detailed build and extract list of source files that make objects, list of objects ...
0
votes
1answer
41 views

Design for an Asset Management System

I'm attempting to design a database to track IT Fixed Assets and Consumable Parts; what is the best practice for this? Should I design separate tables for Fixed Assets and Consumables, or should I ...
0
votes
3answers
31 views

What's the proper design for the table that will hold the processor load stats?

Let's say that I need to implement a widget on the site that allows the user to view the processor load stats via a chart. The user will be allowed to choose how detailed the statistics are: with ...
2
votes
2answers
268 views

Separate table for 'scheduled payments' and 'completed payments'?

In a previous financial payments related database I'd worked on, it just had one large transactions table. We would insert scheduled transactions for the future, and when that time came, we'd execute ...
1
vote
2answers
36 views

DB for storing simple time-stamped values

I don't have that much experience in databases but I need to accomplish this as best as I can. It is rather specific. Database will contain only data structured like this: dataID-timestamp-value ...
1
vote
1answer
87 views

How to improve this product rental schema?

I have a rental system where each product's stock item can be rented from a location and returned to a different location (think Alamo, Hertz etc.). When saving an order, first an inventory event is ...
0
votes
0answers
14 views

Design and queries for analysis of event-sequences

I will have to store sequences of events with certain properties in a database (MariaDB preferably) and I have some issues regarding the design and queries. The crucial part is the analysis of the ...
1
vote
1answer
65 views

“Transitive” keys

I have a central table, A, which will have a key that I'll call A_ID. Now, I have a table B in a "one to many" relationship with A (many B's map to one A). Each link will, of course, have a link ...
0
votes
0answers
38 views

Architecture for huge catalog of products

I need to upgrade my current system of product catalog. For currently I have a 12 000 items in catalog, it's not a lot, but I need to improve them for feature. I have a task to reorganize my database ...
1
vote
1answer
167 views

Execution plan index suggestion - difference between similar queries

I am trying to analyze queries on this table: CREATE TABLE [dbo].[Values]( [tid] [smallint] NOT NULL, [t] [datetime2](3) NOT NULL, [v] [real] NOT NULL, CONSTRAINT [PK_Values_Unique] ...
2
votes
1answer
39 views

Best way to design a database with one person with different roles

We've been browsing for a while looking for an answer to this, but any of them suited exactly my needs, I hope is a relevant question. We have a database for managing books. In this database, a same ...
1
vote
1answer
106 views

MySQL - varchar length and performance

Is declaring VARCHAR size make sense for performance? Is there any difference (in speed) between VARCHAR(50) and VARCHAR(255)? Or defining length is logic/design constraint?
0
votes
1answer
34 views

Fetch data from database from multiple tables matching condition

I want to fetch data from the database. I have three tables in my database like listing_master_residential and listing_master_condo and listing_master_commercial. There are three tables and there is ...
0
votes
3answers
116 views

Completion of ERD, uncertainties about generalization/specialization and primary keys

I'm practicing making conceptual databases and I would like to know of I'm on the right track. I've been trying to create an ERD for a scenario as follows: A hotel can take bookings for weddings, ...
2
votes
2answers
121 views

SQL order by query results in any arbitrary (but reproducible) manner

For testing purposes I need to get some data from a set of database tables in any arbitrary (but reproducible) order. The idea being that I can later compare two runs using a textual diff tool. Is ...
1
vote
2answers
62 views

Database Design for Preserving Values and Additional columns

My colleague and I are having some trouble coming up with a database design, and I am doing my best to stay away from EAV for now. We have an entity called Preparation that stores configuration data ...
1
vote
1answer
36 views

Building dependence between regional data (Street -> City -> PostalCode -> Country)

I'm in the process of designing a database to contain regional data to be used inside a CRM system. So, a user suspects that things like the city or country are automatically filled (or maybe just ...
0
votes
0answers
32 views

Completion of ERD, uncertainties about generalization/specialization and primary keys [duplicate]

I'm practicing making conceptual databases and I would like to know of I'm on the right track. I've been trying to create an ERD for a scenario as follows: A hotel can take bookings for weddings, ...
1
vote
2answers
35 views

Need database design advise

I attached the DB schema, so it will be simple. Problem: Need to get the item records from the company e.g. 'A'. Should I add to the item table company_id field? Will it be a redundancy info as we ...
0
votes
3answers
80 views

Best way to create relationship between multiple tables

I have a question about how to best handle a table that would be shared among multiple relationships, but shouldn't really be joined with all these tables. For example, suppose I have a table that has ...
4
votes
2answers
136 views

Data Modeling for different roles

This is my first post here, so I hope its clear enough. I want to make an application for people who sell, buy, rent and fix a certain product. I need to create a database that would keep the data of ...
1
vote
2answers
224 views

Best practice database design - user rating tables

I want to create a table to store user ratings of items for collaborative filtering algorithms. So far my table looks like this: IID | UID | Rating i.e. item ID |user id |rating. From ...
0
votes
0answers
28 views

many to many relationship tables for four or more master tables

We are developing a database for storing licensedetails of source code, archives, shareobjects, binary. We parse a detailed build and extract list of source files that make objects, list of objects ...
1
vote
1answer
57 views

Multiple User Types - DB Design Advice

I'm developing a web application that will support user authentication with corresponding roles for each user. Also, my users can be of different types and have different fields associated with them. ...
3
votes
2answers
351 views

Disable all constraints and table checks while restoring a dump

I've obtained a dump of my PostgreSQL database with: pg_dump -U user-name -d db-name -f dumpfile which I then proceed to restore in another database with: psql X -U postgres -d db-name-b -f ...
18
votes
2answers
4k views

Is a composite index also good for queries on the first field?

Let's say I have a table with fields A and B. I make regular queries on A+B, so I created a composite index on (A,B). Would queries on only A also be fully optimized by the composite index? ...
11
votes
4answers
9k views

What is an audit table?

What are audit tables? How are they useful? I came across them reading this article.
1
vote
0answers
666 views

which role-permission database design?

I want to manage roles and permissions. Most of designs on web look like this tables: Users Roles UserRoles Permissions RolePermissions Here, what is permissions? I am thinking for such a design ...
3
votes
1answer
1k views

Designing An ACL Based Permission System

I am trying to create a permissions system where everything is going to be stored in MySQL (or some database) and pulled using PHP for a project management system I am building.  I am right now trying ...
2
votes
0answers
2k views

Schema for an RBAC (Role-based Access Control System)

I want to implement an RBAC, Flat based. I've decided to base my system on the NIST standardization model. Although all fine and well, I have an inclusion to that design. Instead of a hierarchy ...
5
votes
2answers
3k views

Designing a user authenication (Roles & Rights) module

I am trying to model a User Authentication module for a MS SQL Server database that will be the back end to a Delphi UI Application. Basically, I want to have user accounts where the user belongs to ...
0
votes
0answers
291 views

Need Help in DFD Diagram for online hotel booking system

Hi friends, I am creating a data flow diagram for online hostel booking system. not sure if i created a correct diagram or not any help would be appreciated. thanks in advance
1
vote
2answers
117 views

Database design suggestions for a data scraping/warehouse application?

I'm looking into the database design for a data warehouse kind of project which involves a large number of inserts daily. The data archives will be further used to generate reports. I will have a ...
1
vote
3answers
62 views

Best approach for Legal/Natural can have many Orders

I'm working on this model: where as you may see one NaturalPerson can have many Order and the same for LegalPerson the only difference between NaturalPerson and LegalPerson are a few so in that ...
0
votes
1answer
92 views

Database analysis

I have database which that store the sold products in Orders Table and another table called Transaction to set the time and the total price for the individual order ,my question is: How to combined ...
1
vote
1answer
103 views

Difference between Relational database and time series database?

I have a bit stupid question maybe. I recently came across a term "time-series database". I would like to ask what is time series database and is it same as relational database? Thanks,
1
vote
2answers
620 views

Online Hostel Management System ER Diagram

I have created an ER diagram for an online hostel management system. Please advise me if this diagram makes sense or needs improvement.
2
votes
2answers
6k views

Questionnaire database design - which way is better?

I have ONE long html page, several sets of questions divided into small sections (approx. 15 sub-sections in one page), the total of questions are about 100 questions: varies from input, multiple ...
1
vote
2answers
90 views

How to architect an analytical BI platform? [closed]

I am working on a new BI project for a medium sized corporation. Right now there is no Analytical infrastructure in place and the reporting is done manually in Excel. There are a few different data ...
5
votes
1answer
110 views

Many-to-many relationship with attributes

I'm working on a project where I need a book database. The problem is as follows: A book can be related to multiple people (authors, editors, traslators, etc.). Then a person may contribute to ...
1
vote
1answer
58 views

Need help with data model

Schema does not list all fields, but only the relevant ones User adds credits/funds to his account using paypal or Internet Banking (which has to be verified manually, and approved, so the 'status' ...
3
votes
2answers
424 views

multivalued weak key in ER database modeling

I was wondering since i didnt find out any clarification for this. I want to store movies that exist in different formats (dvd, bluray etc) and the price for each format differs from each other as ...
1
vote
1answer
39 views

Should I drop this column or is there a query that can achieve a results table without duplicate columns?

I use a column named active in several of my database tables to adjust whether a particular entry/row/user/etc should be included in future query result tables instead of deleting the information. ...