Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Help with database

Posted on 2014-01-01
7
310 Views
Last Modified: 2014-01-01
Hello Experts,

I am designing a database. Need your view on tables.

1. SuperAdmin
SuperAdminId
Pwd

2.Admin
AdminId
Pwd


Now I need to create a table "Events"
3.Events
EventId
EventName
Description
FromDate
ToDate
CreatedOn
CreatedBy

I am having confusion for "CreatedBy" in "Events".
Event can be created by Admin or SuperAdmin.
Then if I put their id in "createdby", thenlater how can I know which id refers to which table.
Your help is really appreciated. Thanks
0
Comment
Question by:johny_bravo1
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:ButlerTechnology
ID: 39749965
You could combine the SuperAdmin and admin table together.

AdminID
AdminName
AdminPassword
AdminRole (Regular or Super)
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39749967
In most databases I've seen it is not necessary to have a separate table for 'Admin' and 'SuperAdmin' for a column whose sole purpose is auditing, i.e. tracking who did what.  Normally I just seen the network ID (jhorn, sjobs, sclaus, ebunny, etc.) in the 'Created By' column.

Also, an argument can be made that Admin and SuperAdmin should really be one table, with a column (bit, maybe char(1)) that designates their role (Admin, SuperAdmin, Tourist, Data Entry, Reports Only, Don't Trust Me, etc.)

Hope this helps.
Jim
0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 39749971
Thank you Experts for your comments.
Current scenario is that, SuperAdmin creates Admin users for particular "Society"
Table :
1.Society
SocietyId
Name
Address


2.SocietyMembers
SMID
Name
Pwd
IsAdmin

Then how will the table be formed?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 65

Expert Comment

by:Jim Horn
ID: 39749981
>Current scenario is that, SuperAdmin creates Admin users for particular "Society"
For starters, I don't see an CreatedBy column in the Society table, to identify who created it.

Also, it's better to spell out all requirements in the original question, instead of giving additional requirements with follow-on comments, so if you could frame up all of your needs and spell them out in one comment, we'd appreciate it.
0
 
LVL 6

Accepted Solution

by:
ButlerTechnology earned 500 total points
ID: 39750005
It sounds like you could use a classic many to many relationship with three tables.

People
PeopleID
Name
isSuperAdmin

Society
SocietyID
SocietyName

SocietyPeople

PeopleID
SocietyID
IsSocietyAdmin
0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 39750007
Hi Jim Horn,
I will keep in mind this point onward.
0
 
LVL 8

Author Closing Comment

by:johny_bravo1
ID: 39750016
Thank you both experts who have shared their views on this issue.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question