Category: SQL
-
Post Views: 19 1. When deleting the table in MySQL, an error is reported: 1217 – Cannot delete or update a parent row: a foreign key constraaint fail. as shown in Figure 1 2. Reference:You can get information about foreign keys from information_schema.key_column_usagetable. The query example for that table is shown here . as shown in Figure 2 3. The…
-
Post Views: 16 1. For the same GraphQL API request, it sometimes responds to 500 in the browser, and there is no response data, and sometimes the response is 200, and there is a response data. as shown in Figure 1 2. When the response is 500, there is no response data. Decide to set the error level to output…
-
Post Views: 19 1. Adding fields to a table takes 180 seconds. as shown in Figure 1 2. The total number of records in the query table is: 173816. as shown in Figure 2 3. Decide to allow the newly added field to be null, and add the field again, which takes 104 seconds. as shown in Figure 3 4.…
-
Post Views: 16 1. There was an implementation before, which is to judge a specific record, whether it meets a certain complex nesting condition, and the code is implemented as follows 2. Now you need to query all records that meet this complex nesting condition, refer to:https://learnku.com/docs/laravel/6.x/queries/5171#2f5914, the code is implemented as follows 3. The final generated SQL is in…
-
Post Views: 16 1. In Navicat for MySQL, when the table is copied from one database to another, an error is reported:[ERR]1292 – Incorrect DateTime Value:0000-00-00 00:00:00for columnCREATED_AT_GMTat row 1. as shown in Figure 1 2. Execute: Select version(), it is found that the version of the two database software is inconsistent. They are: 5.7.19-log and 8.0.23-0ubuntu0.20.04.1. as shown in…
-
Post Views: 19 1. In Laravel 6, after the model applies soft deletion, the record is inserted again, and the unique key conflicts. as shown in Figure 1 2. The reason is that after applying soft deletion, when you use the delete method on the model instance, the current date and time will be written to the deleted_at field. At…
-
Post Views: 17 1. The original format of JSON data is as follows. The order of its key names is as follows: TexGetCux, QKGYGZ2st, YE9GC1KXT, Q1YQZ2RBI. as shown in Figure 1 2. Execute the code to insert the database as follows, print $extra[‘schema’] 3. Print $extra[‘schema’], which is equal to the original format of JSON data. as shown in Figure…
-
Post Views: 18 1. Execute the generated sql, which can be found in the local Windows 10. In the liunx container, no records are found. Print records under Windows 10. as shown in Figure 1 2. Print the record under the liunx container. The result is null. as shown in Figure 2 3. Decide to print the generated sql, you…