Solved

Help with database

Posted on 2014-01-01
7
296 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
Comment Utility
You could combine the SuperAdmin and admin table together.

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

Expert Comment

by:Jim Horn
Comment Utility
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
Comment Utility
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
>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
Comment Utility
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
Comment Utility
Hi Jim Horn,
I will keep in mind this point onward.
0
 
LVL 8

Author Closing Comment

by:johny_bravo1
Comment Utility
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.

Join & Write a Comment

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now