Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help with database

Posted on 2014-01-01
7
Medium Priority
?
342 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 66

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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 66

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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

963 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