473,320 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Best way to structure a table?

Hi, I am creating a user name system in which each user is assigned 100 different types of
permissions. Is it better to create a table with one row for each user and 101 columns (1 for userid
and 100 for permission values) or 3 columns (1 for userid, 1 for permission id, one for permission
value) and then 100 rows for each user or something else?
Oct 16 '05 #1
2 1257
>Hi, I am creating a user name system in which each user is assigned 100
different types of
permissions.
How likely is it that the list of permissions will change, or the
*LIST* varies from one user to another? If either is likely, use
one row per user per permission. You may be able to save storage
by the convention that the absence of the row indicates the absence
of that type of permission.
Is it better to create a table with one row for each user
and 101 columns (1 for userid
and 100 for permission values) or 3 columns (1 for userid, 1 for
permission id, one for permission
value) and then 100 rows for each user or something else?


Gordon L. Burditt
Oct 16 '05 #2
"Gordon Burditt" <go***********@burditt.org> wrote in message
news:11*************@corp.supernews.com...
Hi, I am creating a user name system in which each user is assigned 100
different types of
permissions.


How likely is it that the list of permissions will change, or the
*LIST* varies from one user to another? If either is likely, use
one row per user per permission. You may be able to save storage
by the convention that the absence of the row indicates the absence
of that type of permission.
Is it better to create a table with one row for each user
and 101 columns (1 for userid
and 100 for permission values) or 3 columns (1 for userid, 1 for
permission id, one for permission
value) and then 100 rows for each user or something else?


Gordon L. Burditt


I have already written code that makes it just as easy to add or edit a permission with either
structure and the list of permissions does not vary from one user to another as all users need to
have a value for each permission. So I guess it comes down to which type of query would return a
single users permissions faster.
Oct 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

131
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately...
1
by: James E | last post by:
I have a question about best practices of how to deal with lookup data from my C# apps. On a couple of occasions I have come across a problem where I have to automate inserting a record into a...
9
by: Frances | last post by:
Hi All, * PREMISE * I'm creating an Access form with 150 items subdivided into 20 categories. Multiple categories (and items) can be selected so my user wants checkboxes. All of the options...
6
by: chris | last post by:
Hi, I have a table in the database. I have a method which will return a table with the same structure as the DB one and with all data I need. What I want to do is to remove all data in the DB...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
4
by: Dave | last post by:
(My apologies for posting this on two forums. I have just found out the other one was the incorrect location) I am writing a VB.NET 2003 web application to operate on my company's intranet. It...
5
by: Edward | last post by:
I've been running into issue after issue trying to position text with pure CSS (ie 3-pixel bug, margin bugs, inexplainable side-effects, etc.). I noted that I can just put an HTML table anywhere I...
13
by: G | last post by:
Hello, Looking for opinions on a fairly simple task, new to ASP.net (C#) and want to make sure I do this as efficiently as possible. I have a web based form, and I need to run some SQL before...
6
by: mirandacascade | last post by:
Assume the following: 1) multi-user environment 2) when user opens app, want to run some code that retrieves some information specific to the user...retrieving this information is somewhat i/o...
11
by: ankitmathur | last post by:
Hi, I'm trying to overcome a situation whereby I have to search through 4-5 columns and produce the results with an order by according to the values matched in these columns. Example: My...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.