1. there are two columns A and B in the query question table during the interview. use SQL statements and practice. When Column A is greater than column Blie, select column A. Otherwise, select Column B selectid1 and id2 (casewhenid1id2thenid1elseid2end) asresultfromt4; similar problem: in Table t4, if id2 is greater than 3, the record is qualified, and if it is greater than 5, the record is excellent. Otherwise, the record is unqualified.
1. there are two columns A and B in the query question table during the interview. use SQL statements and practice. When Column A is greater than column Blie, select column A. Otherwise, select Column B, select id1, id2, (case when id1id2 then id1 else id2 end) as result from t4; similar problem, in table t4, if id2 is greater than 3, the record is qualified, and if it is greater than 5, the record is excellent. Otherwise, the select statement is unqualified.
1. query questions during the interview
The table contains columns A and B. use SQL statements and practice. When Column A is greater than column Blie, select column A. Otherwise, select Column B.
select id1,id2,(case when id1>id2 then id1 else id2 end) as result from t4;
Similar problems: In table t4, if id2 is greater than 3, the record is qualified, and if id2 is greater than 5, the record is excellent. Otherwise, the record is unqualified.
Select id1, id2, (case when id2> 5 then 'excellent 'when id2> 3 then' qualified 'else' unqualified 'end) as result from t4;
2. Please retrieve all records whose date (created_ts) is of the current day In the table tb table (the created_ts field is of the datetime type, including the date and time)
Select * from where datediff (dd, created_ts, getDate () = 0
3. SQL mode in Mysql
It is mainly used to restrict whether illegal data is in the data entry stage and to perform compatibility processing.
Run select @ SQL _mode.
4. Differences between char and varchar
5. Data Replication steps
6. Four transaction isolation levels
7. triggers and stored procedures
8. Index type, clustered index, index and lock
9. combined index
10. Describe isnull, ifnull, nullIf
11. Mysql lock Scheduling
12. deadlock and Solutions
13. What are the differences between MyISAM and InnoDB, and common Mysql storage engines?
14. Set up master-slave Replication
15. What are common Mysql logs?
16. Mysql optimization steps
17. How to Prevent SQL Injection