Tagged Questions
1
vote
0answers
28 views
Need help to design model with multiple rights
For a website, I have multiple elements that need to be moderated by many different users.
Until now, I have always used Role-Based Access Control (RBAC) model but I want a more flexible model. I ...
3
votes
3answers
68 views
pros/cons of different ways to store whether a record is one of two options?
I am trying to store whether an address is a Work address or a Home address. There will never be another type of address.
I'm wondering what the pros/cons are of the different ways to store this, ...
1
vote
1answer
38 views
Database design: nested tagging
I have a situation that after an initial thought ended in the following tables:
section: id, name
section_tag: id, name
section_tag_map: section_id, tag_id
item: id, name
...
1
vote
2answers
65 views
Foreign Key constraint on fixed value field - Ever appropriate?
I have a short (15 rows) look-up table that lists the valid values for several columns in the database.
I don't think it can be considered a One-True-Lookup-Table, it is about a single definite ...
2
votes
0answers
38 views
Replicating databases for local and cloud instances
Forgive me if this is an inappropriate place for this architectural question but I'm not sure where it best fits in the StackExchange family.
I have been tasked with developing an online/live auction ...
0
votes
2answers
54 views
Adding a bool column; tracking untouched vs. false
[backstory] I have a simple database of our current Widget inventory. It averages just dozen columns across five or six tables, but has a huge number of records already.
Some Widgets came with ...
1
vote
2answers
72 views
Extensible Asset Database Schema
Background
I work for a decent sized company in the hardware sector. Currently, we have a number of varying assets that need to be tracked. Until recently, this was done by hand as was an ...
1
vote
1answer
74 views
table design to track significant events associated with an item
An Orders table I'm dealing with at present in design phase has about 10 or more columns.
Each OrderID in the Orders table will have certain significant events or milestones. The number of Orders ...
6
votes
4answers
163 views
Database Design - different objects with shared tagging
My background is more in web programming rather than database administration, so please correct me if I'm using the wrong terminology here. I'm trying to figure out the best way to design the ...
0
votes
2answers
77 views
How to design data about a column can belong to the whole table?
I'm not a DBA so I apologize for lack of knowledge.
Here's my situation...Say I have several tables. Products, Customers, Vendors, etc.
Our application may have a help text for some of the data in ...
1
vote
3answers
363 views
Coding an accounting database from scratch?
My new medical practice is picking up fast and my homemade Libreoffice Calc spreadsheet is quickly becoming cumbersome to track patient visits, accounts receivable, overhead reconciliation, etc. Most ...
1
vote
1answer
161 views
Payment methods conceptual and logical model
I need to create a conceptual and logical (normalized) models of parking house according to the requirements below. It looks to me as a very simple concept that doesn't need all tables to have ...
3
votes
3answers
316 views
Is a surrogate key better than a natural key in this case
I copied this code from here:
CREATE TABLE records(
email TEXT REFERENCES users(email),
lat DECIMAL,
lon DECIMAL,
depth TEXT,
upload_date TIMESTAMP,
comment TEXT,
PRIMARY ...
0
votes
1answer
96 views
Design database to query a date range for scheduling
I am designing a db that should include a table with fields for datetime scheduling, so as I know what kind of queries will be made periodically I would like to design the table for them to be as ...
1
vote
3answers
90 views
Storing summed values
I'm trying to create a database to store values for Profit & Loss statements and I'm wondering what the best way to structure this would be. Specifically, amounts that are are equated from other ...
1
vote
2answers
95 views
For a boolean settings table, should I toggle a flag, or insert/delete?
I have a settings table.
SETTINGS
--------
settingId int
settingName varchar(20)
Each user can choose to apply the settings, or not. The interface allows them to quickly toggle the settings on ...
4
votes
1answer
1k views
Modelling Relationships in an E-R Diagram, Table or Foreign Key?
Should a relationship in an E-R diagram be created in the database as a table or a foreign key?
For example:
a tutor lectures a class
I see it as three possibilities:
there is a "lectures" ...
1
vote
2answers
253 views
Database design experienced view
I want to make a database that stores countries, their respective states, and cities. I am confused how to normalize these. Can anyone help?
My ideas:
Table 1 Countries (id pk, name , code)
...
3
votes
2answers
156 views
Database modelling best practice question
I am modelling a database for an application I am developing and I am in front of a choice for which I would like to know what the best practice is.
Let's say I have a Documents table and a Users ...
2
votes
3answers
226 views
designing multiple tables while eliminating duplication?
As I'm working on an educational website, I'm facing a problem with my database design scheme - I can't find the correct design that eliminates duplication in the tables I'm creating.
What I'm trying ...
6
votes
1answer
546 views
What should every DBA know? [closed]
As a SysAdmin who "wears all the hats", I find myself increasingly pulled into database projects. I took one database course back in college and since then I've always scoured resources online (like ...
1
vote
1answer
68 views
Configuration Persistance Design
We have a well designed and normalized DB, but, there is a requisit that could cloud this design.
This image shows the design of part of the DB.
The main functionality of our application is to create ...
2
votes
1answer
362 views
How to design database for tree view with an infinite depth
I am trying to combine C# and SQL2005 for an application which need to have tree view control.
One of user requests is to that tree view can user friendly grow into infinite dept of child nodes. That ...
2
votes
2answers
568 views
Looking for example design of using an SQL database as a queue for throttling web service requests of multiple users
I'm designing a system for multiple users to queue their requests to a web service which takes requests such as creating new entries, changing entries, requesting data. Many of the web service calls ...
1
vote
1answer
234 views
Normalization: Should common columns of two tables be pulled out into a third table?
Should I further normalize my current design to eliminate redundancies?
I have the following tables:
empl: standard user table
empl_cat: employee "category"
empl_admin_cat: administrative ...
12
votes
4answers
2k views
Where should you define foreign keys?
Is it better to define foreign keys in the database or in the code part of an application?
9
votes
5answers
4k views
Splitting Tables in MySQL. Good practice?
I have started working on an existing project and the previous developer had split up a table into 10 separate tables with identical schemas but different data.
The tables look like this:
...
2
votes
3answers
388 views
View Design Best Practices
When designing a view, would it be best to retrieve
the ID fields where FK relationships exist between the joined tables
the desired description field obtained through the FK id relationship
both?
...
0
votes
1answer
121 views
What are the first necessary actions needed to help secure a database's schema & data? [closed]
This smells like an open-ended, opinionated, wiki free-for-all, but I'm not trying to make this a battle of opinions.
It seems like there should be a good checklist out there for all to agree on ...
3
votes
1answer
412 views
Webapp & MySQL: Row Level Security
I am trying to emulate row level security on a webapp I am developing using MySQL.
Using this method:
Creating a database with the the required tables where the data pertaining to all the users will ...
1
vote
1answer
158 views
Design Tagging module in the database
I've a database system which we want to define tags for many tables into it. For example I've videos, photos, ... different entities that we wish to make them taggable. The tags could be anything. By ...
4
votes
2answers
535 views
Best way to handle dates prior to 1000 A.D. in MySQL?
I am creating a database for records that extend prior to 1000 AD, but MySQL Date and DateTime fields only support dates starting at 1000.
Is there a way that would be more convenient than either ...
5
votes
1answer
444 views
How to handle “reference tables” in CouchDB?
What's the best way to handle "reference tables", tables that contain static data, for example a list with various kinds of ingredients for food?
Multiple documents, one for each ingredient
One ...
19
votes
5answers
4k views
Best practices on common person fields (Name, email, address, gender etc…)
What are the most common best practices on length and data type on common fields like:
First Name
Last Name
Address
Email
Sex
State
City
Country
Phone Number
etc....
7
votes
2answers
230 views
Can I losslessly decompose this table?
I've stumbled across a database design problem that's out of my league, and my go-to DBA guru is off on fire drills.
In essence, I have a table with the following primary key:
child_id integer
...
31
votes
11answers
2k views
How could DBAs be more 'programmer friendly'?
The answers and comments on the dba.se version and programmers.se version of the question "What are the arguments against or for putting application logic in the database layer?" are very revealing ...
1
vote
2answers
260 views
Determining sizes for Separated Partitions of programs, data and logs in SQL Server
As per the recommendations of the CIS benchmarks for SQL Server, I want to create separate partitions for the data, the programs and the logs on my SQL Server dedicated server.
Question is, what is ...
8
votes
2answers
8k views
Database model with users, roles and rights
I have a database model with a user table and role table. I want to control the access (rights) to up to 10 different elements. The access can be granted to either a role or a single user.
Below is ...



