database-design

Database-wide unique-yet-simple identifiers in SQL Server

First, I'm aware of this question, and the suggestion (using GUID) doesn't apply in my situation. I want simple UIDs so that my users can easily communicate this information over the phone : Hello, I've got a problem with order 1584 as opposed to hello, I've got a problem with order 4daz33-d4gerz384867-8234878-14 I want...

What's the longest possible worldwide phone number I should consider in SQL varchar(length) for phone

What's the longest possible worldwide phone number I should consider in SQL varchar(length) for phone. considerations: + for country code () for area code x + 6 numbers for Extension extension (so make it 8 {space}) spaces between groups (i.e. in American phones +x xxx xxx xxxx = 3 spaces) here is where I need your help, I want it to ...

Is using Personally Identifiable Information (PII) as foreign keys discouraged in database design?

While clensing PII from test data I have been stuck with a challenging scenario: cascading the changes through the foreign key relationships in the data. Given the focus on privacy and regulations should this practice be discouraged? If the PII itself were not used in any key fashion a neat trick would be to just shuffle the columns. ...

Access Form with multipe tab controls

This is not a deveoper question, it's a novice question from someone that has used Access as a front end for a SQL database for years with no probems. I've now created a stand alone access database that I've created for various staff to fill out different pages of a three page form. The form has control tabs for pages 1, 2 and 3. Each...

Can someone please give an example of 1NF, 2NF and 3NF in plain english?

Hey everyone, I am trying to really wrap my head around the database normalization concept. I understand that it is used to avoid duplicate/redundant data, and it involves creating separate tables for certain things, but I'm not quite sure I understand 1NF, 2NF and 3NF fully. I have read some of the questions on here regarding normaliza...

Which table structure is better

We have to create few tables for the sole purpose of reporting in Oracle. Option 1 Receivable Table RefNo Date TrnType eg:Tax, Fee, Premium Amount Option 2 Receivable Table RefNo Date Tax Fee Premium Note: For a given RefNo all types Tax, Fee and Premium or a sub set of them can exist. What would be the optimal structure(Tabl...

Medical Values: 1 Super Exam Table or Lots of Exam Tables

In the medical domain, a patient has a ton of exams (HbA1C, Lipid, Renal, etc..) and they all basically follow the format of ExamX(ID, ID_Patient, Date, Value) But you can go from many tables to one by using SuperExam(ID, ID_Patient, ExamType, Date, Value) One note, value would not be discrete in the second table. Some exams have mult...

What is the best way to model user defined hierarchical relationships in a database?

Essentially, I want the user to be able to define a hierarchical model, but then I need to allow the user to store data within their defined model. Does this make sense? So the users will be able to create new "unit types" to be organised in a hierarchical way and decide how units of these types are allowed to be organised. A simple exam...

DB Design: Favor Abstraction or Foreign-Key Constraints ?

Say we have this scenario: Artist ==< Album ==< Track //ie, One Artist can have many albums, and one album can have many tracks In this case, all 3 entities have basically the same fields: ID Name A foreign of the one-many relationship to the corresponding children (Artist to Album and Album to Track A typical solution to the pr...

What would be the best way to design database and relationships for a website like Yelp or eBay (lots of categories and sub-categories)?

Do they have a table for all categories and another for all sub-categories (and another for the sub-sub-categories and so on), or what? How do all the levels go around communicating with each other? I'm a noob getting started on a project that might have that level of complexity and I am having a hard-time wrapping my head around that. ...

Oracle DataGuard

Oracle DataGuard is a technique to replicate data stored in an Oracle RDBMS across several Oracle engine instances. I'm wondering whether DataGuard really provides a linear scalability for a RDBMS. Do you have any experiences with the DataGuard? How does it behave under heavy load conditions? ...

database design

hi, i'm developing web search tool for college search... tool should support to search college... 1. by course 2. by fees 3. by name is there i have to follow any database algorithm to make my search so efficient... is it must i have to use datamining technique when college data grows so ...

Database Schema question

Hello all, I am having a difficult time deciding how to handle a business requirement in my database schema. I have a lot of tables in the database, but there are only three I need to deal with for this problem: Courses, PersonnelCourses, and Personnel. Courses is a list of Courses Personel is a list of Personnel PersonnelCourses is...

How to get rid of multiple columns in a database?

I'm creating an Access DB for use in an C# application at school. I've not had much experience working with DB's so if this sounds stupid just ignore it. I want the user to be able to select all the classes that a certain student has had in our IT department. We have about 30 in all and the maximum that a person can take in 4 years of hi...

What would be the pros and cons of hierarchical data vs. related data, in performance (and categorization)?

This is related to this question. It got me thinking that, for example, this book. Instead of it being a child of both [Agriculture] and [Other], in the trees [Books > Catalogs > Agriculture] and [Business & Industrial > Agriculture & Forestry > Other], respectively, it could just stand on its own have those levels as tags, instead. In ...

One-to-One relationship in MS Access

I'm having trouble in creating a one-to-one relationship between two tables in MS Access - when I create the relationship, it defaults to "Many-to-one", and I don't see an option to change it. Is there a way to do this? ...

Database modeling question - different data required deppending on the user type

Hello, What's the best database model to use for an user registration process that deppending on the user's type selected, some fields will be required or not. Example: User Type A requires: Name, Email, Birth date and Gender User Type B requires: Company Name, Contact Person, Email, N. employees I think the most commom is to create a ...

How might I insert an array of data into a database table?

I am developing an attendance management program, used to maintain the absence record of a student. Users of this software will need to enter various dates, updated once in a month: for instance, a list of dates on which a student was absent for that particular month would be entered, and my program must then store them into a database w...

Database design for a rating system

The application handles users and objects, users rate objects with 3 features (one rate per feature). EDIT: the last sentence is unclear : by features I mean criterias shared by all the objects How efficiently design a database for such a system ? What are the best-practices for designing a database dealing with a rating system ? wha...

Database deadlocks

One of the classical reason we have a database deadlock is when two transactions are inserting \updating tables in a different order. e.g. Transaction A inserts in Table A then Table B and Transaction B inserts in Table B followed by A Such a scenario is always at risk of a database deadlock (assuming you are not using serializable is...