database-design

SQL Server 2008: Disable index on one particular table partition

I am working with a big table (~100.000.000 rows) in SQL Server 2008. Frequently, I need to add and remove batches of ~30.000.000 rows to and from this table. Currently, before loading a large batch into the table, I disable indexes, I insert the data, then I rebuild the index. I have measured this to be the fastest approach. Since rece...

General question: Filesystem or database?

I want to create a small document management system. There are several users who store their files. Each file which is uploaded contains info about which user uploaded it and the document content itself. In a view all files of ONE specific user will be displayed, ordered by date. What would be better: giving the documents a name or m...

how to set anything in database then he not allow duplicate rows in a table

how to set anything in database then he not allow duplicate rows in a table means name abc name abc means some row sames as each other then i need to take one copy of it and remove each other ...

MYSQL Event to update another database table

Hey All, I have just taken over a project for a client and the database schema is in a total mess. I would like to rename a load of fields make it a relationship database. But doing this will be a painstaking process as they have an API running of it also. So the idea would be to create a new database and start re-writing the code to u...

SQL Design Patterns

Is there such a thing as Design Patterns in SQL ??? ...

Using MongoDB with Ruby On Rails and the Mongomapper plugin

Hello, i am currently trying to learn Ruby On Rails as i am a long-time PHP developer so i am building my own community like page. I have came pritty far and have made the user models and suchs using MySQL. But then i heard of MongoDB and looked in to it a little bit more and i find it kinda nice. So i have set it up and i am using mong...

Database design 1 to 1 relationship

I design my database incorrectly, should I fix this while its in development? "user" table is suppose to have a 1.1 relationship with "userprofile" table however the actual design the "user" table has a 1.* relationship with "userprofile" table. Everything works! but should it be fixed anyways? ...

Can splitting .MDB files into segments help with stability?

Is this a realistic solution to the problems associated with larger .mdb files: split the large .mdb file into smaller .mdb files have one 'central' .mdb containing links to the tables in the smaller .mdb files How easy would it be to make this change to an .mdb backed VB application? Could the changes to the database be done so t...

Advice on simple efficient way to store web form data when no db/auth required

Hi, I have a situation where I need to provide an efficient way to process and store comments submitted via a web form. I would normally use PHP and either MySQL or XML to store the data, but this is slightly different in that this web form will only be temporarily available in a closed LAN environment, and all i need to do is process th...

How should I model the database for this problem? And which ORM can handle it?

I need to build some sort of a custom CMS for a client of ours. These are some of the functional requirements: Must be able to manage the list of Pages in the site Each Page can contain a number of ColumnGroups A ColumnGroup is nothing more than a list of Columns in a certain ColumnGroupLayout. For example: "one column taking up ...

Can I use UML to diagram ERDs?

Hi, 1) Can I use UML to diagram ERDs? 2) If answer to 1 is "yes", the use of UML is standardized and widely used for that purpose? Thanks ...

Problems enforcing referential integrity on SQL Server tables

Hello All, I have a SQL Server 2005 database comprised of Customers, Quote, QuoteDetail tables. I want/need to enforce referential integrity such that when an insert is made on QuoteDetail, the quote and customer tables are also affected. I have tried my best to set up primary/foreign keys on my tables but need some help. Here's the ...

Help needed in database design for application of Timetable Generation

I am planning for an application of time-table generation. I wanted the data such as standardname, teachername, standard wise subjects and also relate the corresponding teacher with the subject and standard. I had think like, StandardMaster(stdid,stdname) TeacherMaster(teacherid,teachername) SubjectMaster(subid,subname,stdid) ...

How to handle ids and polymorphic associations in views if compound keys are not supported?

I have a Movie plan table: movie_plans (id, description) Each plan has items, which describe a sequence of movies and the duration in minutes: movie_plan_items (id, movie_plan_id, movie_id, start_minutes, end_minutes) A specific instance of that plan happens in: movie_schedules (id, movie_plan_id, start_at) However the schedule ...

What is the easiest way to add a bunch of content to a SQL database?

Nothing technical here. Suppose I have a lot of different categorized data, and I would like to create a database out of it. Would someone literally hand plug in all that info with SQL code itself? Or do some people make a mock website just to input data? What are some of your strategies? ...

Inheritance vs. common (same named and typed) columns?

What model of these is better? A or B? Considering I have more common columns (5 actually for now), many more entities (over 60) and many more relations, while most of tables are just simple dictionaries (enumerated sets of names) and have no own columns. ...

Best practice - logging events (general) and changes (database)

need help with logging all activities on a site as well as database changes. requirements: * should be in database * should be easily searchable by initiator (user name / session id), event (activity type) and event parameters i can think of a database design but either it involves a lot of tables (one per event) so i can log each of t...

What does ON [PRIMARY] mean?

I'm creating an SQL setup script and I'm using someone else's script as an example. Here's an example of the script: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[be_Categories]( [CategoryID] [uniqueidentifier] ROWGUIDCOL NOT NULL CONSTRAINT [DF_be_Categories_CategoryID] DEFAULT (newid()), [CategoryName...

Do null SQLite Data fields take up extra memory?

I'm using the built in sqlite library on the Android platform. I'm considering adding several general purpose fields that users will be able to use for their own custom applications, but these fields will be blank most of the time. My question is, how much overhead will these blank fields add to my database? Do null fields even take u...

Relational vs. Dimensional Databases, what's the difference?

I'm trying to learn about OLAP and data warehousing, and I'm confused about the difference between relational and dimensional modeling. Is dimensional modeling basically relational modeling, but allowing for redundant/un-normalized data? For example, let's say I have historical sales data on (product, city, # sales). I understand that t...