Solved

Help with database

Posted on 2014-01-01
7
314 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
[X]
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
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

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?
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

734 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