Skip to main content
deleted 149 characters in body
Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100

I think the professor was referring to the process of updating when he analogized this to a SELECT query and an INSERT query at the same time, because that's probably how you'd probably do an update manually — you would first retrieve (select) the data, update it, delete the original data from the table, and insert the updated data back.

I think this query is atomic as it executes as a whole or it doesn't execute at all. This solves the problem in the sense that if more than one INSERT query are trying to execute at the same time, you should havecan't possibly affect the data in the table in a single insertion and onebad way or more updates as the result (NOThave errors due to various attempts of executing multiple insertions and no updates and not updates only and no insertions, etc.).

Similarly, if more than one UPDATEseparate INSERT/UPDATE queries are trying to execute at the same time, you should have multiple updates (not a single update and not zero updates, etc.).

You'll learn more about keys as you proceed through the pset specifications.

You may read more about transactions here!

I think the professor was referring to the process of updating when he analogized this to a SELECT query and an INSERT query at the same time, because that's probably how you'd probably do an update manually — you would first retrieve (select) the data, update it, delete the original data from the table, and insert the updated data back.

I think this query is atomic in the sense that if more than one INSERT query are trying to execute at the same time, you should have a single insertion and one or more updates as the result (NOT multiple insertions and no updates and not updates only and no insertions, etc.).

Similarly, if more than one UPDATE queries are trying to execute at the same time, you should have multiple updates (not a single update and not zero updates, etc.).

You'll learn more about keys as you proceed through the pset specifications.

You may read more about transactions here!

I think the professor was referring to the process of updating when he analogized this to a SELECT query and an INSERT query at the same time, because that's probably how you'd probably do an update manually — you would first retrieve (select) the data, update it, delete the original data from the table, and insert the updated data back.

I think this query is atomic as it executes as a whole or it doesn't execute at all. This solves the problem in the sense that you can't possibly affect the data in the table in a bad way or have errors due to various attempts of executing multiple separate INSERT/UPDATE queries at the same time.

You'll learn more about keys as you proceed through the pset specifications.

You may read more about transactions here!

added 3 characters in body
Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100

I think the professor was referring to the process of updating when he analogized this to a SELECT query and an INSERT query at the same time, because that's probably how you'd probably do an update manually — you would first retrieve (select) the data, update it, delete the original data from the table, and insert the updated data back.

I think this query is atomic in the sense that if more than one INSERT query are trying to execute at the same time, you should have a single insertion and one or more updates as the result (NOT multiple insertions and no updates and not updates only and no insertions, etc.).

Similarly, if more than one UPDATE queries are trying to execute at the same time, you should have multiple updates (not a single update or and not zero updates, etc.).

You'll learn more about keys as you proceed through the pset specifications.

You may read more about transactions herehere!

I think the professor was referring to the process of updating when he analogized this to a SELECT query and an INSERT query at the same time, because that's probably how you'd probably do an update manually — you would first retrieve (select) the data, update it, delete the original data from the table, and insert the updated data back.

I think this query is atomic in the sense that if more than one INSERT query are trying to execute at the same time, you should have a single insertion and one or more updates as the result (NOT multiple insertions and no updates and not updates only and no insertions, etc.).

Similarly, if more than one UPDATE queries are trying to execute at the same time, you should have multiple updates (not a single update or and not zero updates).

You'll learn more about keys as you proceed through the pset specifications.

You may read more about transactions here!

I think the professor was referring to the process of updating when he analogized this to a SELECT query and an INSERT query at the same time, because that's probably how you'd probably do an update manually — you would first retrieve (select) the data, update it, delete the original data from the table, and insert the updated data back.

I think this query is atomic in the sense that if more than one INSERT query are trying to execute at the same time, you should have a single insertion and one or more updates as the result (NOT multiple insertions and no updates and not updates only and no insertions, etc.).

Similarly, if more than one UPDATE queries are trying to execute at the same time, you should have multiple updates (not a single update and not zero updates, etc.).

You'll learn more about keys as you proceed through the pset specifications.

You may read more about transactions here!

Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100

I think the professor was referring to the process of updating when he analogized this to a SELECT query and an INSERT query at the same time, because that's probably how you'd probably do an update manually — you would first retrieve (select) the data, update it, delete the original data from the table, and insert the updated data back.

I think this query is atomic in the sense that if more than one INSERT query are trying to execute at the same time, you should have a single insertion and one or more updates as the result (NOT multiple insertions and no updates and not updates only and no insertions, etc.).

Similarly, if more than one UPDATE queries are trying to execute at the same time, you should have multiple updates (not a single update or and not zero updates).

You'll learn more about keys as you proceed through the pset specifications.

You may read more about transactions here!