次の状況では、どのように対処しますか?レコードを編集し、レコードが承認されるまでレコードが更新されないようにするためのデータベーステクニック
あなたは以下のフィールドを持つ顧客レコードを持つテーブルがある:
id, name, email, phone
1, John, [email protected], 515-222-3333
2, Smith, [email protected], 515-333-444
ジョンは彼の記録を開き、彼の電話番号を変更します。ただし、管理者が変更を承認するまで、顧客の実際の記録は変更しないでください。
このような状況にどう対応しますか?
あなたはそうですか?
a. Create an exact replica of customer table called customer-temp
b. Copy the record of John into customer-temp
c. let the admin review the updated record in customer-temp
d. once approved, the record is replaced with the record of john in customer table and remove John's record from customer-temp
これは最善の解決策ですか、これを処理するには良い方法がありますか?また、顧客テーブルにリレーションシップのいくつかのテーブルがある場合はどうなりますか?
エキスパートアドバイスをいただければ幸いです。参考までに、私はPostgreSQLデータベースを使用しています。
-----更新フォーマット---