Tables design | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Tables design

Hi Guys
Here is what I want to do. We have some pdf files and want to create an asp.net to distribute them. I want to store the pdf into the database. it has different access level and type. example access we have 3 levels if user has access to level 3 then they can access to all other lower level (1 and 2) I will select all the pdf file of the same type A or B or C etc example below. I feel that there is something wrong with my table design any suggestion ? oh there are two other table one for access_level and one for access_type use for admin page to add access_level and access_type(using dropdown list)
users table
–user_id
–user_name
–user_password
1 me me
useraccess table
–user_id
–access_level
–access_type
1 level1 A
1 level3 B
1 level2 C
userdata table
–data_id
–access_level
–access_type
–data
1 level1 A pdf1
2 level2 A pdf2
3 level1 A pdf3
4 level3 A pdf4
5 level1 C pdf1
6 level2 C pdf2
7 level1 B pdf3
8 level2 B pdf4
using the above example output should be.
-1 level1 A pdf1
-3 level1 A pdf3
-7 level1 B pdf3
-8 level2 B pdf4
-5 level1 C pdf1
-6 level2 C pdf2 May the best cheaters win
<img src=’http://www.norulesclan.com/images/NRImages/tables.JPG’ border=’0′ /><br />how do you insert image ?<br />accessdata will insert independly from user and useraccess. since the table is (user)one-many(useraccess)–&gt;one-many(data). I feel like this is something wrong with this picture. Any thought ?<br /><br />May the best cheaters win
]]>