Reputation: 19
Please let me know how to insert one-many relationship in a single query. I have table A (aId,name,surname) table B (bId, street, pincode,aId)
Upvotes: 0
Views: 182
Reputation: 32170
You don't. This is why transactions exist. You start a transaction, submit all your queries, and then commit the transaction. The database goes from one state where none of the queries are completed to a state where all of the queries are completed. There is no in between state to worry about. Transactions are how RDBMSs implement the Atomicity component of ACID.
Upvotes: 2