New answers tagged

3 votes

How do I protected my sensitive data (financial) from website/CRM programmers?

Practically speaking, you're quite limited in what you can do - especially without significant expense, which is usually not tolerable to those seeking a solution. An analogy I sometimes use, is that ...
Steve's user avatar
  • 192
0 votes

Storing small lists of FKs in array column and joining

You can try this approach (I am using MySQL 8). user and user_list tables: CREATE TABLE `user` ( `id` int NOT NULL AUTO_INCREMENT, `name` varchar(10) DEFAULT NULL, `list_id` int DEFAULT NULL, ...
prasad_'s user avatar
  • 426
1 vote

database design for tree structure with just one level

Building on Yano_of_queenscastles just to provide a sample: INSERT INTO RootNode (Id, OtherField1, OtherField2) VALUES (1, 'Root 1 Data', 'More data for Root 1'), (2, 'Root 2 Data', 'More data ...
betelgeuce's user avatar
3 votes
Accepted

database design for tree structure with just one level

Simplest solution is making the parent node into separate table with the same set of fields*. Then no nested references would be possible. For example, you could have following entities (SQL-like ...
Yano_of_Queenscastle's user avatar
0 votes

How should I design my databas for online voting web app?

You question is: should I keep all the record for all very election in the same tables or should I replicate required table for every new election. This is a question about data security. If you keep ...
Francesco Mantovani's user avatar
2 votes
Accepted

Enforce unique constraint without denormalization

If a task can belong only to one service, the second data model is the correct one. To enforce your constraint, you have to add a redundant copy of environment to task: add a new column environment ...
Laurenz Albe's user avatar
0 votes

How can I simplify the process of importing only changed data?

I'm considering joining all food tables into one big "foods" table (similar to the spreadsheet we use for importing) and adding a column to store a hash. You don't need to do this in a ...
J.D.'s user avatar
  • 35.2k
0 votes

How do I handle a single `reference` to multiple different types of data?

Here is an approach expanding upon your NoSQL (or document or JSON) data idea: { short: "abcd", type: "url", // or image or text // type specific data, e.g. for a url url: ...
prasad_'s user avatar
  • 426
0 votes

Export pump all schemas except Sytem related schemas

Instead of excluding the system-related schemas on the export, and assuming your new instance only contains system-related schemas before the import, you could just exclude them on import: impdp ...
Gerrat's user avatar
  • 137
0 votes

Query to compare the structure of two tables in MySQL

to only get the column names that exists in the first table and not the second: select column_name from information_schema.columns where TABLE_SCHEMA='your_database_name' and TABLE_NAME='first_table' ...
aghed aljlad's user avatar

Top 50 recent answers are included