You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -185,7 +232,10 @@ SELECT filename FROM dataset WHERE run_number > 50 AND collision_type='pp';
185
232
{: .challenge}
186
233
187
234
## UPDATE
188
-
The UPDATE command is used to make changes to existing record. For example, if you want to update the "collision_type" and "collision_energy" for a specific record, you can use:
235
+
236
+
The UPDATE command is used to make changes to existing record.
237
+
238
+
For example, if you want to update the "collision_type" and "collision_energy" for a specific record, you can use:
189
239
190
240
```sql
191
241
UPDATE dataset
@@ -219,8 +269,23 @@ WHERE filename = 'expx.myfile1.root';
219
269
{: .challenge}
220
270
221
271
## DELETE
222
-
The DELETE command is used to remove record from a table. To delete a record with a specific filename, you can use:
272
+
273
+
The DELETE command is used to remove a row from a table.
274
+
275
+
For example, to delete a record with a specific filename you can use:
223
276
```sql
224
277
DELETEFROM dataset
225
278
WHERE filename ='expx.myfile2.root';
226
279
```
280
+
281
+
>## Be careful with UPDATE and DELETE without WHERE!
282
+
>Very important: if you omit the `WHERE` clause in an `UPDATE` or `DELETE` statement, you will update or delete ALL records in the table!
283
+
>
284
+
> For example, the following command
285
+
> ```sql
286
+
>DELETEFROM dataset;
287
+
>```
288
+
> will delete all records in the `dataset` table.
289
+
>
290
+
>This can have unintended consequences, so be cautious when using these commands.
0 commit comments