Analysis of wrong questions
1. The result displayed after a query statement is executed is: B
Reason analysis:
- Ask for average grades to be grouped by class;
- Then where is in front of the grouping, and having is behind the grouping;
2. Which of the following SQL statements can allocate the query and insert data permissions of the userdb table userinfo for the user zhangsan (A).
Reason analysis:
- grant [权限] on [table] to ‘username’@‘localhost’;
3. The following statements about database indexes must be wrong (B)
Reason analysis:
- When the data in the table is added, deleted, and modified, the index must also be dynamically maintained, which reduces the speed of data maintenance.
4. Which of the following SQL commands is used to add a column (D)
reason analysis to the table :
- Adding a column is to modify the table structure, use alter;
- ADD is followed by <new column name> data type integrity constraints;
5. There is an order table orders, which contains the userid field and productid field. Can the following statement return the productid that has been ordered for at least two sessions? D
reason analysis:
- You must first filter by product information grouping, then it must be grouping+having;
6. The commonly used database in mobile phone development is A _
Reason analysis:
- sqlite: lightweight database;
7. Which of the following characteristics is relevant to this matter: The committed transaction will ensure that all operations have been completed, and during the transaction rollback, the effects of all operations have been restored? B
reason analysis:
- The atomicity of transactions: either all succeed or all fail;
8. The athletes table contains the athlete's name, age and representative country. Which of the following queries can identify the youngest athletes representing each country? A
reason analysis:
9. Execute the following SQL, which of the following names will be queried (C)
SELECT FirstName FROM StaffList WHERE FirstName LIKE'_A%'
Reason analysis:
- _ Means to match any character; therefore, there must be a character before A;
- % Represents 0 or more arbitrary characters;
10. The mysql database has a course selection table learn(student_id int, course_id int). The fields represent the student number and course number respectively. Now I want to get information about the number of courses selected by each student. Is the following SQL statement correct?
Reason B :
- Number information: count;
- Every student, group;