Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 days ago.
Improve this question
i would like some help, i've created this db's schema based on the client request,
the idea is, all users must belong to roles, each roles have its specific permisions on certain pages.
the permissions are given to the roles, not to the users directely.
so even if a user belong to a "role", he might also belong to "invalidate_rules_Roles" which will restict him from certain permissions without other users that belong to "role" to be impacted. meaning he will be an exception of the "role".
this is the schema enter image description here
what is left is to test the schema by sql scripts that help to validate and check if the schema answers to the client request.
i created the schema to ansewr to the client request
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have three applications (it can be grow) and they use same database (mysql).
All those applications must have login.
So my question is which approach is database normiliztion?
One: creates user table for each application. user-app1, user-app2, user-app3. but its create a lot of tables (is it okay?)
Two: create user table once and column to indicate which app is authorize role: app1, app3. (but its create the same user for all the applications)
Or should I do in a different way?
Creating a separate user table for each application would generally be the wrong thing to do. This approach would duplicate the same data (i.e. user information) across different tables.
In fact, what you would do is have two tables:
Users
UserApplications
The first would have one row per user. It would have all the information about the users -- name, date the user is created and so on.
The second would have one row per user and application the user has signed up for. It would have additional information, such as the date they signed up for that application.
This allows you to both extend the number of users quite easily and to extend the number of applications (or to remove application).
The best way to evaluate this is to see whether
Knowing data about your user from one application differs from the other
Will these users use multiple applications together
If users will have 80-90% similar properties e.g. email, name, password hash, etc. and you expect them not to change then approach 2 works best. If you also expect these users to use multiple of these applications then it's definitely 2.
If users will have very different properties i.e. some users for app1 don't have emails but app2 needs emails and some users for app2 don't have names but app1 needs names then you might want to keep them in separate tables for data cleanliness.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
how to do cleanup of a react js application running on ubuntu 18.0.4 setup. we want the application to run without any CLI issues.
Only BAMMON or the one who granted those privileges (a DBA?) knows why that user needs those privileges.
How to "fix" it?
revoke all those privileges
create a role with only one privilege, e.g. create session
grant it to bammon
when bammon says he can't do something, grant that privilege to role
bammon will be able to use it right away
loop through the last steps as many times as it turns out that bammon needs to do something, but can't
also, see whether lower level of privileges suits the needs, e.g. don't grant create any procedure but create procedure
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
With SQL Server Transactional Replication, is it possible to also replicate users and roles from the source to the target database? This is not something I am able to do.
No, with Transactional Replication you cannot replicate users and roles from source to target. A list of database objects that can be published using Transactional Replication is listed in Publish Data and Database Objects.
You will need to deploy the users and roles from source to target database using a pre or post snapshot script. For information on pre and post snapshot scripts refer to:
Execute Scripts Before and After the Snapshot is Applied
Execute Scripts Before and After the Snapshot is Applied (SQL Server Management Studio)
Configure Snapshot Properties (Replication Transact-SQL Programming)
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Please can anyone assist with hiding the available databases on sql server 2008R2 or newer versions.
I have a new login user that I mapped to a specific database.
When logging in with the specific login user I can see all the databases on the server, although I cannot access them except for the one I mapped to the login.
This is 100% but my problem is that I do not want the login to even see that those other databases are available.
How do I prevent those other databases that are not mapped to the login from displaying?
USE master;
GO
DENY VIEW ANY DATABASE TO [newlogin];
GO
USE yourDB;
GO
DROP USER newlogin;
GO
USE master;
GO
ALTER AUTHORIZATION ON DATABASE::yourDB TO [newlogin];
GO
Raj
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am creating a forum website using JSP and Servlet. I am having a confusion deciding that when a user creates a new account on my website, I should create a new database dynamically and specifically for that user that should contain his all data including his forum threads, profile, thread replies, etc. or I should use same database and create different tables like forumsThreads, userProfiles, etc. and link them with a foreign key. Which will be best way?
Create one database with multiple tables. Let me rephrase your question:
when a user creates a new account on my website, I should create a new User record dynamically
each time the user does something, I should create records in a number of tables that will store all his data including his forum threads, profile, thread replies, etc.
all his data will be linked with foreign keys
when another user creates another account, I can reuse all the programming logic and the database I used to process the first user.
Creating a whole new database per user is a big Anti-Pattern.
Do not create databases or tables dynamically. Everything you consider creating a new table (or database) for probably should just be a record in a table (or multiple tables) containing a user_id column identifying the user this record applies to.
You should not create a new database for each user, and you should also not create new tables for each user. You should have a fixed set of tables shared by all the users. For example:
User: ID, login, first name, last name
Forum: ID, name
Post: ID, forum_id (FK to Forum.id), author_id (FK to User.ID), parent_post_id (FK to Post.ID), date, subject, body