The logical model and/or physical design of a database.

learn more… | top users | synonyms (4)

2
votes
2answers
173 views

How to review Database schema?

I am green been software engineer, my team lead give me a task in PostgreSQL database, I need to determine the relationship of the all 405 tables, but the problem is the database doesn't have any ...
2
votes
2answers
103 views

Is it ok to have 40+ columns in a table

I am currently re-designing some of DB's for a project. There is one DB in particular that is giving me a little of a headache. The idea is that for every client_id and date (client_id + date would be ...
2
votes
4answers
374 views

Can't finish my ER diagram

I am trying to create a database for a small book library. This is not a professional project, just an exercise of my own. This is my first time to try this ( I am self-taught ) and I am encountering ...
2
votes
1answer
3k 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
104 views

Conditionally join table

I'm new to database design and have designed a database that seems fine for the application but looks like it has a major red flag to me. I have a master table which is then joined to another table ...
2
votes
3answers
317 views

Entity Relationship Model - double one to many

ERD A customer submits one or many leads. A lead belongs to one customer. A lead is a request or an inquiry. A lead belongs to one manufacturer. A manufacturer has one or many leads. Tables ...
2
votes
1answer
316 views

Clustered composite key high fragmentation and fill factor

I've recently made a table to hold the language preferences of my users as follow: CREATE TABLE [dbo].[systemUserLangPreference]( [systemUserID] [int] NOT NULL, [langID] [int] NOT NULL, ...
2
votes
1answer
102 views

Confused on how a value gets added with the DEFAULT constraint

A recent definition I've read about Default Constraints: DEFAULT is specified for a column to assign a column a specific value if no value is specified when a row is added. I believe I've seen code ...
2
votes
1answer
113 views

Better way to manage data integrity, without having too many composite FK's

I have following tables: class_table (class_id = Auto Incremented Primary Key (AIPK) of this table) user_table (class_id, user_id (AIPK of this table)) course_table(class_id, course_id (AIPK of this ...
2
votes
1answer
296 views

Database design for storing historical nmap data

I am designing a database to store nmap data. I want to store two basic types of data: Information about the nmap scans themselves (e.g. start and end times, nmap version used, command line ...
2
votes
1answer
293 views

Need help to design model with multiple rights

For a website, I have multiple elements that need to be moderated by many different users. Until now, I have always used Role-Based Access Control (RBAC) model but I want a more flexible model. I ...
2
votes
1answer
120 views

How to enforce a nullable foreign key?

I have a relation between two tables. The foreign key table can have a row related in the primary table. There's a way to enforce the value of the FK column to be NULL or one of the values of the PK ...
2
votes
1answer
48 views

Relational Database tables

I have a table Player where playerID is the primary key. Then I have a table Game where gameDate is the primary key (of type DATETIME). Each game is played by 2 players and each player can play many ...
2
votes
2answers
418 views

Expanding parent-child tree with additional tables

I have readonly access to a table (Oracle database) which contains a hierarchical structure, represented via parent-child. I need to add another table, which will expand the existing hierarchical ...
2
votes
1answer
5k views

one trigger for multiple tables

i have a trigger in PostgreSql 9.1 that i want to fire on inserts of several tables. is it possible to have it affect all these tables instead of creating the trigger for all these tables? i have 58 ...
2
votes
2answers
442 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 ...
2
votes
2answers
84 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 ...
2
votes
2answers
906 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 ...
2
votes
1answer
6k views

Derive Attributes in Tables?

I have designed my ERD. It has derived attributes. When it comes to relational data modeling using relational schema, I've designed my tables and linked everything properly. I don't know if I should ...
2
votes
1answer
110 views

What are practical hurdles in making protein interaction database?

Following are some protein interaction databases: http://string-db.org/ http://dip.doe-mbi.ucla.edu/dip/Main.cgi As a newbie what are the practical aspects of database that I must understand before ...
2
votes
2answers
302 views

Writing to a DKNF database, but reading from a de-normalized table for performance?

Would the following approach be reasonable? The Goal: queries have to be relatively fast, but without the hassles incurred by writing to a de-normalized database. The Context: A database for ...
2
votes
1answer
495 views

Oracle ash report

Recently, i have been handed over with an ash report from DBA. To me this report is like french. I have no idea what it is about and what all is written in this report. Can someone please guide me in ...
2
votes
2answers
1k views

Joining based on date (or date range)

I'm not sure if I've completely fudged the design of my small hobby database (I'm not a DBA by any means), but I have a table like this (primary key is (staffid, effectivefrom)): staffid | target | ...
2
votes
1answer
520 views

Design problem with auto-increment fields

I've made this design similar to my problem, it's not exact but it close enough to understand my problem: http://i42.tinypic.com/bhbp5.jpg Some cellular client frequently send their GPS position and ...
2
votes
1answer
147 views

How to make a table with fields that are other tables in MySQL?

I am making a music library system with php in MySQL. In this system there would be a table named Songs. Since many songs can be by the same Artist (Person), I wanted to store a table of Person that ...
2
votes
1answer
849 views

Separate Schemas by Industry or by Application functionality?

I currently have a small retail/Point of Sale and an Education application running as on-premise custom solutions for different customers. I am planning to rewrite the app and host as a SaaS/web ...
2
votes
2answers
6k views

Primary Key on a View

While answering this question How to add a Primary Key on a Oracle view? A lot of questions popped in my mind. 1. Is it advisable to have primary key in a view. 2. Why anybody be intrested in ...
2
votes
4answers
176 views

Is there a “standard way” to log network messages (events) into a database?

I have two applications communicating over a LAN via events contained in network messages. Each message (i.e. an UDP packet) contains only one event. Messages are heterogeneous, meaning that the first ...
2
votes
2answers
7k views

Database to track employee performance

This is going to be very basic as I'm a complete newbie when it comes to database design. I've been tasked with setting up a way to track employee data over a number of months and potentially years. ...
2
votes
1answer
285 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. ...
2
votes
1answer
74 views

Minimal 3NF normalization issues

I'm trying to learn how to normalize to 3NF but the example that my teacher gave us doesn't really help. The algorithm I always used is this one: Find a canonical cover F_c for F For each FD X->Y ...
2
votes
1answer
82 views

How to set up foreign key constraints referencing more than one table

I have a simple structure where I am not sure how to handle some of the issues that pop up. There are 4 tables: Reports, ReportParameters, ScheduledReports, ScheduledReportParameters. ...
2
votes
1answer
52 views

stored procedure can select and update tables in other databases - minimal permissions granted

I recently had to make the stored procedure spPartyOrderAllocation_AllocateItems to select and update tables in other databases, while keeping the pemissions levels to the minimum. This was ...
2
votes
3answers
83 views

Integer ID vs varchar ID with JOIN

I have a table of users but I don't know what is the best practice between using a unique MEDIUMINT identifier or a unique pseudonyme identifier using VARCHAR. With MEDIUMINT identifiers, like the ...
2
votes
1answer
48 views

What exactly is metadata? How is metadata different than regular data?

As I understand, metadata is data about data- so I think of analytics; is my simple definition correct? How is metadata different than data? I'm simply asking to broaden my understanding-thanks!
2
votes
3answers
48 views

Record inheritance in mySQL

I have been struggling with this for a little while. I want to have a set of calendar records. The top level will apply to a large group; the next level will apply to a sub-set and the final level ...
2
votes
2answers
77 views

What are the prime and non-prime attributes in this relation?

R(HIJKLMNO) L -> MNO HI -> JKLMNO J -> KL K -> H HI is a key. So, H is a prime attribute. But, H is also in non-key part. What are the prime and non-prime attributes in this ...
2
votes
1answer
47 views

For a software application, does every workstation need database drivers?

really a just a newb question. In the case of something like an enterprise system for a company, where end-users are executing continuous reads and writes to a database, it does not appear that in ...
2
votes
2answers
147 views

Does a composite primary key break the first normal form?

Does having a composite/compound key (using multiple columns/attributes) to form the primary key break first normal form? (I am assuming that this is handled by the DBMS, and so the attribute ...
2
votes
2answers
91 views

Does any SQL engine have navigation support in CHECK clauses?

Imagine a simple database to track personal spending. The most basic form of the model should let you create any number of accounts and any number of transactions (specifying the spending amount, date ...
2
votes
2answers
220 views

Relational Design - One table, two foreign keys or Two tables, one foreign key each

Looking for some advice related to optimal design in the following scenario. There is a Cases table (represents cases of inventory) There is a LocationInventory table (represents locations with ...
2
votes
1answer
97 views

Database schema for passing requests to role based users

I am working on a Database schema where the scenario should be: There are role based Users; Role 1, Role 2, Role 3 and Role 4 There is a Request model (or class, or table) User with role Role 1 will ...
2
votes
2answers
43 views

How to set-up a distributed data storage system for The Real Junkfood Project

Context The Real Junkfood Project consists of a network of pay as you feel (PAYF) cafes. We need to log the data from each of ~100 cafes, generating perhaps 50 rows each par day. I estimate that this ...
2
votes
1answer
70 views

Database templates [duplicate]

Are there any site with database templates for specific purposes? (i.e. a database schema for users and authentication in a webpage) for different databases like Oracle, MySQL... I have been looking ...
2
votes
1answer
160 views

Storing multi-select data with single-select data

I've got a database with some multi-select fields. To keep it simple, let's just say those fields are MatchGender and Interests. I want users to be able to find people who match (hence Gender is a ...
2
votes
1answer
386 views

Have foreign key constraint and index key for the same column(s)

I am creating a composite index key for 2 columns and then adding foreign keys to its appropriate table. Do I need to create a multiple index key reference and then create separate foreign keys? My ...
2
votes
2answers
116 views

Table design question for a `Check all that apply` survey

I'm looking for advice on a design for a portion of a table. Background We're collecting survey data for multiple sites, and one question is a check all that apply. Currently, there are from 2-5 ...
2
votes
2answers
120 views

Do valid to/from columns on a fact table make sense?

I recently came across "valid from" and "valid to" columns on a fact table. Obviously this is common for dimensions but I've not seen them on fact tables before and can't find any info suggesting ...
2
votes
2answers
420 views

Unique across tables

I have a table containing users. Each user has a primary email and a flag indicating if the user is deleted or not (we never hard-delete users). However, each user can also have additional emails. ...
2
votes
2answers
1k views

Financial database design

I am working on an application to store financial data and need to model the tables where the data for several financial statements will be stored. I came up with the following two designs but I can't ...