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)

3
votes
1answer
3k views

Foreign key of multiple tables

I have the following 3 tables: ╔═════════════════╗ ║ Companies ║ ╠═════════════════╣ ║ id ║ ║ name ║ ║ type ║ ║ etc... ║ ╚═════════════════╝ ...
0
votes
1answer
285 views

Use data in a tablespace to populate another postgres database instance without actually inserting

I have a postgres database (version 8.4) with many tables. Some tables are huge in size, but the data is static (common for any instance). I have stored such tables in a separate tablespace. Is there ...
1
vote
1answer
116 views

Topics and posts represented by one table or two?

I'm currently building a forum component for a larger application and I'm considering different approaches to certain parts of the database schema. In particular, I am considering representing topics ...
3
votes
2answers
165 views

In-memory and hard-drive hybrid

I'm going to start my Master of Science degree work. My goal is to implement (and test in various scenarios) hybrid database environment: my application will communicate with two databases. One will ...
2
votes
1answer
214 views

Deriving formulas for input/output

I'm currently enrolled in a DBS class and am having problem with an assignment. I've searched around and have been unable to understand what it is I'm meant to be doing with this derivation formula. ...
3
votes
2answers
166 views

Tablestructure for fast inserts/deletes with foreign keys

Current Situation We have a table called c with ca. 300,000 rows. In this table we store the competitors for a specific product. Example: id | competitors | some infos about competitor | ...
0
votes
1answer
2k views

How shared nothing and shared everything architectures look like in Oracle?

Oracle has partitioning and clustering features. Partitioning enables to split table or indexes into multiple tablespaces and store on various servers. So it's done manually. Clustering enables ...
3
votes
1answer
816 views

How to design tables for players in a tournament?

I need help with my database table design. I have group which contains a list of players. In every group each player plays games with other players. Game has also some result for example 1:0 and ...
2
votes
2answers
280 views

Support ticket system - when/how to move old tickets?

I don't have access to the partitioning feature, but consider a support ticket system with tens of thousands of tickets being opened everyday and taking about a week to a couple of months in getting ...
0
votes
1answer
1k views

The four properties of a primary key

In our dbms class, these were the four properties of a primary key discussed for Oracle. Unique Not NULL Fully functional dependency Indexed I understand all the properties except the 3rd one ...
0
votes
2answers
328 views

What is the best database design to keep track of fields with multiple values?

I am trying to dynamically build a form with a label (field) and a user entered value (fieldValue) but the form can have several different control, like a combobox, textbox, listbox, checkbox, etc.... ...
1
vote
1answer
1k views

Many To Many Relationships

I am working on a conceptual model for a database. I have the following entities: Student (id, name, date of birth, department) Subject (id, name) This is a many-to-many relationship, one student ...
5
votes
2answers
5k views

Correct way to design a shopping cart websites database

I am in a web applications course. My instructor really didn't like the layout of my database, saying it was incorrect in pretty much every way. Fast forward 2 months when I'm remaking the website in ...
1
vote
2answers
3k views

Conversion of statements to E-R Diagram

EDIT: PLEASE DON'T CONSIDER ARROWS :) statements are "A teacher can teach many courses. A student can enrol in many courses. A course may be a part of one or many programmes. A teacher can be ...
0
votes
1answer
1k views

What is the difference between int(8) and int(5) in mysql? [duplicate]

I found out, that if you have a field defined as INT(8) without ZEROFILL it will behave exactly as INT(5) in both cases the maximum value is −2,147,483,648 to 2,147,483,647, from −(2^31) to 2^31 − 1 ...
1
vote
1answer
48 views

How to constrain data

I have 3 tables which are related and a constraint on one of them which I can enforce in software but I don't know how to enforce in the database. I have a series of providers who send a set of data. ...
2
votes
3answers
4k views

Software tool to visualize and print DB diagrams [closed]

I have some SQL Server databases and use SQL Server Management Studio to manage them. However, I find that is not very friendly to create, design and print database diagrams (for existing tables). ...
0
votes
2answers
3k views

SQL Server Database Diagram in SQL Management Studio creating multiple schemas

I'm using a multiple schema approach (Multi-Tenant arhitecture) in the same DB and it's working great. I can use EF bounded contexts and split domains appropriately. According to MSDN, ...
0
votes
2answers
192 views

Database setup/design for multiple services

I am working on a new MySQL database that will store orders/customer information for around 15 different services. 7 of the services are similar in regards to the information that is stored with a few ...
2
votes
1answer
67 views

Adding specific information to a local file

I have several files on a webserver (not stored in the database). I'd like to store several information to this specific file. The user should be able to post comments about this file. My question ...
2
votes
2answers
280 views

Database structure for a system with multisite

The system I'm working is structured as below. Given that I'm planning to use Joomla as the base. a(www.a.com),b(www.b.com),c(www.c.com) are search portals which allows user to to search for ...
3
votes
4answers
4k views

MySQL unique constraint across two columns

I have a table defining relationships Src smallint(5) unsigned NOT NULL, Dst smallint(5) unsigned NOT NULL, other fields I need to add a constraint that says if a given values is present in one of ...
4
votes
1answer
324 views

How should I model a worflow of status/activities ? (rules like “if is 3 go to 4, if is 4 go to 5” etc)

I'm trying to model a workflow (status and activities) to create "rules". Let me give you an example. The main "object" let's say are "vehicle requirements", I will have this table: idRequirement, ...
1
vote
1answer
118 views

Can I place the attribute in the Entity, when the foreign key is also already present?

I am using DBdesigner Fork for generating ER diagram. I have the 'Company' as an entity for which can I place the attribute of 'idShares', despite of having the foreign key of Shares Entity in the ...
2
votes
1answer
221 views

Application with “configurable” columns : how to model this

I'd like to do a status list. I have 1..n projects. Each project contains 0..n tasks, for which I'd like to report a status, next phase, priority, etc... For each project, I'd like to setup which kind ...
-4
votes
1answer
109 views

Advice for designing a complex/multipart application [closed]

I'm designing a software application for my medical carrier. It is very complicated, with many parts and many small details. Some experts advised me to divide it to parts, then design the database ...
2
votes
2answers
2k views

Database Design - One table for different types of transactions

Considering a procurement system as an example. Would it make sense to have one single table for the following: Quote, Order, Invoice and Credit Memo? There will be some details that are different. ...
0
votes
0answers
54 views

How to properly design this type of relationship [duplicate]

I am building a model with the following requirements: Items may have attributes Attributes may be of type: 'Choice', 'FreeText', 'Number' I am not quite sure how to relate the item to attribute ...
4
votes
1answer
212 views

250 billion rows - computing interconnectedness on a really huge scale

I have a table of approximately 700k rows, each identified by a unique itemnumber. Each row/item can be associated with any of the other rows/items in the table by calculating a single numerical ...
1
vote
2answers
106 views

Table Design - Identical tables for different statuses

I am developing a transactional System and the below is a simplified scenario of my problem. Users enter JOBS in a system. A User first enters a JOBS with a DRAFT status (and the Job is given a ...
2
votes
2answers
78 views

Referential Integrity - Re-using table

This is a simplified example of a design issue that I am facing: I have 3 tables: Car, Ship and Bicycle. I need to add an "activity logging" table that records user actions such as deletion and user ...
0
votes
1answer
49 views

Should I create a new table for store information of an associated object with object need to create

I'm not sure if topic can get you understand what I want to explain. Follow guide in my old question, now I have these tables and its columns: Course: name,... Topic: name, course_id Question: ...
4
votes
1answer
269 views

Modelling Hierarchical attributes

I am trying to figure out the data model for a retailer. The retailer has several stores across the country and they are modeled using the following hierarchy: Channel -> Zone -> City -> ...
1
vote
1answer
2k views

How to model entities in an entity relationship diagram?

I'm a beginner Database designer and wondering if anyone can help me understand this. Let's say we want to design a system that has, among other entities, an entity called Vehicle, and another one ...
4
votes
2answers
471 views

What happens to the index of a primary key after a DROP CONSTRAINT?

I am running PostgreSQL 9.1.4. I have a table with many existing rows, and a bunch of other tables with foreign keys pointing to it, for which I am trying to : 1 - Remove the pkey constraint on the ...
3
votes
1answer
122 views

which design better when use foreign key instead of a string to store a list of id [duplicate]

Possible Duplicate: Is using multiple foreign keys seperated by commas wrong, and if so, why? I'm building online examination system. I have designed to table, Question and GeneralExam. The ...
2
votes
2answers
511 views

Should I use SQL or NoSQL for this specific design (surveys)?

Building a small web application to create satisfaction surveys with a default list of questions and responses. The application is for a small audience of people (5,000 max) with surveys sent out when ...
5
votes
3answers
1k views

Are there any tools to go from ERD to DB design and vice versa? [closed]

I'm learning DB design and looking for some tools, preferably open source software, that could help go from an ERD to a DATABASE and vice versa. For the record, the database i'm using is MySQL.
1
vote
3answers
494 views

How to model a 1..1 Composition Relationship

We have a couple of entities/relationships of the following kind: Entity Event has a TimePoint The TimePoint contains time information about the event. It belongs to that event and cannot be used by ...
3
votes
2answers
26k views

Select column names whose entries are not null

I would like to have a list of those columns of a table that have at least one not-NULL data entries in them. In other words, I would like to get the column names for which the following returns at ...
1
vote
1answer
342 views

mysql session logging tables

I've been building a session logging system for our sites. We get around ~15m hits a year and at the moment we're really only interested in stats about people who logon to our sites. Our table ...
5
votes
2answers
529 views

Introducing an 'age' category in a patients database

I want to do the following in my DB related to patients: when patient inserts his birthday it shows his age category as: infants, children, adult, elderly... etc. to help me classify my patients how ...
0
votes
1answer
93 views

Setup logical Database model for measurements

I'm struggling to set up a logical model for the following spreadsheet: (See a close-up of the table here.) My problem is that it is not clear to me how to deal with the "gap" values where each ...
0
votes
2answers
866 views

Keep total transaction in invoice application

I want to make an application called as Invoice Application with MySQL database. Now I have designed this database. Now I want to know is this database good for Invoice Application. I will use MySQL ...
3
votes
2answers
5k views

How to make a trigger that will compare input with a value of other table?

I had made two tables with the following fields: TABLE 1: "Bookings" FIELD: "fk_flight_number" FIELD: "date_of_reservation" TABLE 2: "Flights" FIELD: "flight_number" FIELD: ...
3
votes
3answers
215 views

Storing Phone Numbers - Proper design

First off, I'm not a DBA, I'm a software engineer and have been building applications which are database backed for my entire career. One of the things I remember (maybe incorrectly) is that when ...
1
vote
1answer
440 views

DB stored procedures: how do they help increase security in web systems?

The usage of Oracle PL/SQL procedures for controlling data access is often emphasized in PL/SQL books and other sources as being more secure approach. I'v seen several systems where all business logic ...
1
vote
3answers
4k views

Many-to-one Subselection in single query

I have two tables with a foreign key from T1->T2, in a one-to-many relationship. That is, 1 tuple in table T1 is associated with 0..N tuples in T2. To create a simple example, lets say T1 is Cars, ...
0
votes
2answers
89 views

what is the best choice from those two tables?

what is the best choice from those tables?? table A : keep DB simple with lower number of tables ... but i will find difficulties if i wanted to extract certain data from column of doses coz it's ...
1
vote
1answer
138 views

a question in tables relations

Table A is linked to Table B , and Table B is linked to Table C using primary and foreign keys My questions: Should i link Table A to Table C too?? Or Table B can act as intermediate link between ...