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)

1
vote
2answers
500 views

serial field issue

Q: I use a serial as a datatype for my primary keys in my tables. I insert a lot of data then truncate these data one after one many times to test the data entry. My question is: Is there any ...
1
vote
1answer
3k views

Set permissions on all objects for SQL users

I have a procedure that loops through all objects in the database and assigns them proper permissions to that object. I want to know if there is a better way to do this? I use a model database to ...
1
vote
1answer
276 views

What's the best paradigm or design pattern for exception handling in a mission-critical DB driven web application?

I want to design a bullet-proof, fault tolerant, DB driven web application and was wondering on how to architect it. the system will have a asp.net UI, web services middle tier and SQL2005 back end. ...
1
vote
3answers
31 views

Study material for Advanced Databases module inc SQL, Relational Model, ERM & TM [on hold]

For my next module in my masters, I am planning on studying Advanced Databases. (Long story short, the masters is designed for people with NON-CS degrees, so I have never studied databases, therefore ...
1
vote
1answer
62 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 ...
1
vote
1answer
68 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?
1
vote
2answers
56 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
2answers
318 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.
1
vote
2answers
62 views

how to design a database's table to store mysql spatial data in a parent child relation?

I want to store locations and polygon data in a parent-child relationship. I am using spatial data in MySQL and Google maps for polygon. Examples: 1. World 1.1 US 1.2 China 1.3 Japan 1.4 South ...
1
vote
1answer
50 views

Restrict two specific column values from existing at the same time

I have a PostgreSQL example table where at most one row that is not of type 'c' should be allowed. I would appreciate any help creating a constraint that will enforce this. CREATE TABLE example ( ...
1
vote
1answer
62 views

How to design a database that tracks sports player's positions

I'm building a database for a sports (ultimate) tracking program. Basically, the "raw data" for the program will be the positions and IDs for all the players on the field at one time. But the way I'm ...
1
vote
1answer
24 views

Relying on expected data

I'm relatively new to Database Design and I wanted to know the disadvantages to a particular decision I have made in the design of a database for a project. I don't think it will have an effect on the ...
1
vote
1answer
38 views

pass data from deleted table to another

This is the situation: I have a table, with name TABLE_1 I would like delete TABLE_1 and then create another table with the same name and some of its columns. TABLE_1 has records, but I need to pass ...
1
vote
1answer
106 views

Update new column with value from old columns for all the rows

I've got an odd db design in place that was here when I got on my new work space. We have a column named params which contains some string data which appears that it belongs in more than one column, ...
1
vote
1answer
31 views

Understanding how relationship sides works

So, I have this relations on my tables (see image) and I need to understand some things. I'll enumerate what I understand and what I need from yours is to say if I'm right or not and in case I'm not ...
1
vote
1answer
154 views

What is a good/healthy mysql query execution time?

What is a good/healthy mysql query execution time? To my calculations: The site gets 1000 unique visitors per hr 10 page view for each unique visitor 5 minutes for each unique visitor ...
1
vote
1answer
59 views

Documenting a collection of databases and their relationships with each other

As part of a project I'm currently involved with we need to identify where various data points are held within existing systems, with a view to integrating them into our central integration engine. ...
1
vote
1answer
195 views

Horizontal schema vs Vertical schema

I am but a modest SQL DBA. I would like to request your advice on the design of the central part of our new proposed database. Brent Ozar had something to say about this: Building A SQL table ...
1
vote
2answers
51 views

Is there a reason to store currency amounts as fractions instead of decimals?

I've been reviewing GnuCash's DB design and I found that they are storing amounts as two 64-bit integers, the numerator and denominator of a fraction. Is there some advantage from a DB perspective to ...
1
vote
2answers
48 views

Keywords - column or separate table

I am building a website on MySQL with php, and I have 400+ products in a table. I have three columns with comma separated values, each has 1-3 values separated by commas in each row. I was wondering ...
1
vote
1answer
62 views

How to represent a many to many relationship with Crow Feet diagram

I'm designing a database and I want to represent the relationship between users and groups: A user can be on zero or more groups. A group can have one or more users. Using Microsoft Visio 2013 I've ...
1
vote
1answer
74 views

What is the advantages of using auto_increment in database as primary key over set of attributes?

I have table as CREATE TABLE circle ( circle_id int(11) auto_increment primary key not null, user_id int (11) not null, title varchar(255) collate utf8_general_ci not null ); CREATE ...
1
vote
1answer
105 views

database design for dynamic menu bar [closed]

I am trying to create a menu bar which will load dynamically on user log in, based on the user roles. Say if the user is an admin he can see all the items listed under the header and if a user is a ...
1
vote
1answer
89 views

Is this design in 3NF? Why to choose another design not in 3NF

Having the following entities: Objects, Parts, Subparts and Items, and given the following design restrictions: A Part belongs to one and only one Object. A Subpart belongs to one and only one Part. ...
1
vote
1answer
124 views

data warehouse design help

I'm struggling with the design phase for a data warehouse. It's not the traditional sales example you find on MSDN or all books etc. I've been tasked with creating an education data warehouse, that ...
1
vote
1answer
65 views

Modeling a db that has products: What are the good practices/solutions? How to treat grammar variations in the words?

The problem is: A Company belongs to a sector. A Company produces products. A Sector contains products. A Product belongs to sectors. Three entities: Company, Sector and Product. And it's a ...
1
vote
2answers
179 views

Implementing voting system like reddit/StackExchange?

In creating an application that would require a voting system similar to that of StackExchange or reddit, I want to know how the database tables should optimally be structured. So far, I have ...
1
vote
1answer
67 views

Database Over Normalized [closed]

How can you tell when a database is over normalized? Example: I have a database for employee. These are the following tables involved: User - contains email, password, companyId Profile - ...
1
vote
1answer
86 views

3 way junction table and redundant value

I was constructing a conceptual design for database in relational model until I stumbled upon some issue. My progress so far is: Asset Type Table +---------------+-----------------+ | asset_type_id ...
1
vote
6answers
852 views

Efficiently storing irregular/repeating intervals (think calendar/events)

I am developing a service that relies on users being able to recieve messages that they themselves choose. These messages need to be stored somewhere before they are send for processing. Right now ...
1
vote
1answer
69 views

Will a specific denormalization increase performance in a specific scenario?

Suppose I have a table with fields | a | b | c | d | ... | z | which contains millions of records and which will serve millions of queries a day. And the field z holds the id of some parameter which ...
1
vote
2answers
111 views

Does this medical database look correct?

I'm pretty new to databases and I'm trying to create some schemas. I've been working away at this one for a while, but I can't help feeling that it doesn't look right. Essentially I have the ...
1
vote
2answers
152 views

Can somebody help me normalise this database/check my workings

I am new to database design/normalisation and functional dependencies. I have started a new database class in school this week and we have been given a worksheet that requires the following: This is ...
1
vote
4answers
315 views

How to handle table design with variable columns

I have a table design scenario and as a non-DBA type, would like opinions on which is more scaleable. Say you are asked to record information on houses for a metro area, starting with a small ...
1
vote
1answer
214 views

Can Anyone please review my database after I did the Normalization ?.Any suggestion is appreciated

User: User_ID,user_name,E-mail Staff: User_ID,Fname,Lname,DOB Student: User_ID fname Lname DOB Lecture: User_ID Admin: User_ID Position ID : P_ID,ROLE_NAME, Staff_position ...
1
vote
1answer
105 views

design database for electrical meter data?

Hi just wondering how to I have .csv "Time 'datetime' Voltage 'double'"file that record Voltage usage from electrical meter each every minutes and database to record the data just want to normalize ...
1
vote
1answer
107 views

How does this database design look?

This is my first official design after having read a coursebook in preparation for the upcoming semester. The goal is to have a user-based form creation/publication and submission web application. ...
1
vote
2answers
1k views

What is the best way to model an invoicing system with different forms of invoice items? [closed]

I am doing some preliminary database modelling for a Line-Of-Business application that I am creating. The application will be a Practice Management System for a medical practice/clinic. I am looking ...
1
vote
1answer
62 views

Accessing MySQL Database

I am designing a database for an application, which will be accessed by different front end programming languages, such as php, asp.net, android applications and iphone applications. I am confused, ...
1
vote
2answers
438 views

Foreign key constraint based on conditional column

I'm trying to figure out the best way to handle this situation: I have a table set up as follows: LEARNING CONTEXT ================ LearningContextID - INT - Surrogate Primary Key EntityID ...
1
vote
1answer
353 views

Add a column contains a photo

I installed PostgreSQL 9.1 under Ubuntu 12.10 And now I have a table called property I want to add a field that can be used to store photo(link to the photo or import a photo into a column?) But I ...
1
vote
2answers
202 views

Database scheme for product tracking

I'm in the progress of creating a separate login for users who want to track specific product shippings. So I got the tables: Products (Id, Name, Color, Description, ...) Used for storing the ...
1
vote
1answer
202 views

User Table Design

I am designing for an ecommerce application, I need to know how to implement the following task. There are 2 options, Unregistered Users (Free Listing). Registered Users. In this the unregistered ...
1
vote
1answer
481 views

How do I resolve issue with deleted table in SQL Server Database Diagrams?

I am working on a database design using the SQL Server Database Diagram tool. I created a table with the name dbo.Example and before defining any columns, attempted to save. Got an error that SQL ...
1
vote
1answer
161 views

Model Likes / Dislikes in SQL

I'm trying to implement a behaviour similar to Facebook (okay, most similar to YouTube). In my table I got various Products, each Product can be liked or disliked by a Customer. I don't want to let ...
1
vote
2answers
119 views

Two possibilities of primary key

I have a table: all_info, where it holds the users identification. This id can be of two types (just one or another, never both), suppose: int and varchar, but one table can't have two primary keys, ...
1
vote
2answers
147 views

Splitting up tables with similar structures since they contain unrelated data? (huge numbers)

Is my reasoning correct in splitting up tables with similar structures since they contain unrelated data? I'll explain the situation with an example : Suppose there is a server which hosts an online ...
1
vote
2answers
111 views

Relations, dependencies and normal form

I have some issues in understanding about relations and dependencies. I will show two examples and what I want to know: Assume the relation GTX {G,T,X} with the following dependencies: G,X -> T ...
1
vote
1answer
67 views

Query for View with unique entries from Database with repeated entries

I have a table with columns of Hotel names, city name and country name (of the respective hotels). I need to create a view of unique entries which will contain city name and country name columns. Any ...
1
vote
1answer
166 views

Storing different countries' administrative divisions

I'm designing a data base which should relate users to their administrative division for statistical purposes, considering that every country has its own type of divisions. Chile, for example, is ...