Tag: database-design

Modeling related entities with SQL Server and entity framework

I’ve got a table in my database storing items: Items ——- ItemID Name … Etc and a separate table storing the PK of two different items from the first table. I want to be able to list the one item, and then any number of related items. I’ve tried searching for examples but haven’t found […]

how to link multiple comments to a request in a database?

So I am developing this request management system web app in ASP.net, C#, SQL server and am currently designing the database. My question is that, I want a request to have multiple comments from different users. I have a Requests table and a Users table. How can I link multiple comments from multiple users to […]

What are the arguments against merging contact details into a single field?

We have a customer that insists on putting contact details, at this time first and last names, into a single field. Take, for example, Mr. Bob Smith and Mrs. Jane Smith. Mr. Bob and Mrs. Jane would be entered into the first name field and Smith would be entered into the last name. It gets […]

Need help on how to structure my database (SQL Server)

Everything that isn’t labeled “calc” or “finalvalue” is raw data that I will be manipulating. I finally know enough SQL to be able to create the necessary tables and perform the needed calculations. However, I just wanted to verify that there is no simpler way to do this, something that would involve fewer tables. Would […]

I need help in designing a database

I am working on a hotel management system in asp.net and I have a problem with designing the database. I have something like this: two types of Guests :family and company each type can have many members and every member has attributes the reservation is made by a guest I think I need to make […]

Working with complex SQL Server database schemas

I have a database, I have to maintain compatibility with SQL Server 2005 and I’ve been thinking about ways to reduce complexity and deal with performance issues. My database is like most other’s and filled with data, it’s a lot of data and there’s a lot of queries in there to. I have many stored […]

Stackoverflow DB structure – Have a similar situation on the tables

is stackoverlow database structure available somewhere? I am facing a situation where I have Table1 with information about something and Table2 with numeric information about Table1 on a 1:n relatioship. Like we have users and answers here on stack overflow for example. I need to have quick access to the sum of the numeric information […]

allocating content to fixed size buckets without looping in SQL Server

I am working in SQL Server 2008 R2 with a priority ordered set of content that must be assigned to a set of buckets to achieve a content specified value. Each item in the content list is related to nodes within a ragged tree hierarchy (the buckets). Each bucket has a value assigned to it […]

DB Design for Admins & Customers

I’m creating a site who’s users will include customers and different levels of Admins. What is the recommended practice or what would be the correct way of setting up the DB Tables for this? Both Customers and Admins will have a username and password. Customers, though, will also have a CustomerCode and Location, and Admins […]

Database design: Where to store account balance?

Possible Duplicate: Database design: Calculating the Account Balance should the user's Account balance be stored in the database or calculated dynamically? Where is the best place to store the user’s account balance and why? 1) “Transaction” table, as calculated at the time when the transaction occurred or 2) “Account” Table, updated every time the user […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.