How to design table to store user settings? [closed] - mysql

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 7 years ago.
Improve this question
If its just for turning on and off a basic feature, this should be ok?
USER_SETTINGS
-Id
-UserId
-SettingId
-IsEnabled
The problem is some settings require various fields...this could work, but is there a better way to do this?
USER_SETTINGS
-Id
-UserId
-SettingId
-XMLSettings (XML data of settings)

A. you can use nested table or object instead of XML on Oracle
B. you can create another table USER_SETTING_FIELD, which has foreign key to USER_SETTINGS
C. you can use simple string column with the format "field1:value1;field2:value2"
D. you can use extra SettingId for each field

Related

Want to change prefix of values in mysql database [closed]

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 millions of data in my database table customer. In that, I have the id_token attribute which has value like cus00001 format now I want to change it to ank00001.
What will be the query in rails or mysql to do it for all the data in the database?
You can use simple update query using REPLACE function:
UPDATE `table_name` SET `id_token` = REPLACE(`id_token`, 'ank', 'cus');

To which should add shipping_charges? [closed]

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 3 years ago.
Improve this question
I'm sorry it seems be weird! but I'm so confused! bear with me:)
I'm new with E-commerce I just create simple app via Laravel, I design this database for it:
I got in my mind tow questions:
I'm confused with where should I add shipping_charges column for order in which table?!
I have governorates(cities) so shipping_charges in the capital of my country should be 5$ and others cities should be 10$. How can handle the price of the cities?
I think you have to put shipping_charges in governorates table because it belongs to it. You can make separate table governorate_to_shipping but it's not neccessary.
In order you have address_id in addresses you have governorate_id so you can join this tables to governorates table and get shipping_charge from it.

Requiring Data from PostGres and MySQL in one view [closed]

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 3 years ago.
Improve this question
I have two databases one in PostgreSQL and other in MySQL. What I want is to get data from both databases and create a view and then iterate it on front-end.
Is it possible?.
The smartest thing to do would be to create two connections, one to each database, and handle it that way.
If you need to join the tables, you could consider using a mysql_fdw foreign table in PostgreSQL and join the tables in PostgreSQL.

How to achieve synchronization in database level? [closed]

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 4 years ago.
Improve this question
I'm developing an airline reservation system as my semester project. Here, when one customer books a seat in a specific aircraft, I need to prevent another customer from booking that seat at the same time. I know how to do this in back-end level using synchronization. I need to know whether there is a way to do this in database level. If so, could you please point me in some direction
You can create unique constraint for 2 columns in table like (flight_id, seat_id)

how to build database structure of language translation system [closed]

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 8 years ago.
Improve this question
how to build database structure of language translation system?
hello friends..
here i am little confuse ...with this application..
give me a best way to define a database structure of language translation system...
waiting for you reply
SourceLanguage id
SourceLanguage meaning id
destination language id
destination meaning id
and create different table for language and its meaning
A simple structure would be to have a dictionary approach i.e., A table with following columns:
SourceLanguage
SourceWord
TargetLanguage
TargetWord