How to achieve synchronization in database level? [closed] - mysql

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)

Related

Problems with the definition of an entity in ER diagram [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 1 year ago.
Improve this question
I have to build the conceptual model for a school, which has a Cafe inside it. The school wants to control the profits which derive from the Cafe.
What could be the best way to represent this with an er-diagram?
I tried to create the entity "CAFE", with attributes NameActivity, Profits. But I don't think that makes sense
One possible conceptual model could be this
The Cafe generates orders and every orders contains different order rows (cappuccino, latte, and so on). You can retrive the profit simply adding the cost of each order row.

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.

What is the specific use of Pivot table in SQL? [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
Im curious what is the distinct use of pivot table in database? I mean, how is it apply in real life.
Pivot query help us to generate an interactive table that quickly combines and compares large amounts of data. We can rotate its rows and columns to see different summaries of the source data, and we can display the details for areas of interest at a glance. It also help us to generate Multidimensional reporting.
for more information visit:
http://www.codeproject.com/Tips/500811/Simple-Way-To-Use-Pivot-In-SQL-Query
https://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx

ebay query into mysql? [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 would like to know if it is possible,
To extract the userid from an ebay page and insert it into mysql as part of an insert statement? Otherwise what would be the best way to do this?
I have files to import, which contain hundred of ebay auction urls, and I must grab the seller id from each one. Is there an easier way to do this than what I am suggesting?
You could use the eBay API for that. The URL for each page contains an item number, and that can be used to query eBay for the seller id.
eBay Hacks Item 109 gives some PHP example code to do what you need (and more).