当前位置:网站首页>MySQL -- Introduction and use of single line functions
MySQL -- Introduction and use of single line functions
2022-07-04 00:59:00 【Wan Li Gu Cheng】
List of articles
MySQL—— One line function
1、MySQL Classification of functions in
stay SQL In language , Including built-in functions and custom functions . Different DBMS Functions are different , Most of the DBMS Will have their own specific functions .
MySQL Built in function and classification
MySQL Provides a wealth of built-in functions , These built-in functions can help users deal with the data in the table more conveniently . Functions are stored in the database like predetermined formulas , Every user can call existing functions to complete some functions .
Function can easily realize the reuse of business logic , also MySQL The database allows users to create their own functions , To adapt to the actual business operation . Using functions correctly will allow developers to write SQL Sentences get twice the result with half the effort .
MySQL Function is used to process the data in the data table accordingly , In order to get the data users want , send MySQL The function of database is more powerful .
MySQL The built-in functions provided can be divided into numerical functions from the perspective of realized functions 、 String function 、 Date and time functions 、 Process control functions 、 System information function and encryption function 、 obtain MyMSQL Information function, etc .
SELECT、INSERT、UPDATE and DELETE Statements and their clauses ( for example WHERE、ORDER BY、HAVING etc. ) You can use MySQL function .
The following describes the scope of use of the above functions :
- Mathematical functions are mainly used to deal with numbers . Such functions include absolute value functions 、 Sine function 、 Cosine function and function to obtain random number, etc .
- The string function is mainly used to process strings . This includes string concatenation functions 、 String comparison function 、 Functions that change the letters of a string into lowercase or uppercase letters, and functions that obtain substrings .
- The date and time function is mainly used to process date and time . This includes functions to get the current time 、 Function to get the current date 、 Functions that return year and date .
- Process control functions are mainly used in SQL Control condition selection in statement . These include IF sentence 、CASE Statement and WHERE Statement etc. .
- The system information function is mainly used to obtain MySQL Database system information . This includes functions to get the database name 、 Get the function of the current user and the function of getting the database version .
- Encryption function is mainly used to encrypt and decrypt strings . Including string encryption function and string decryption function .
- Other functions mainly include formatting functions and locking functions .
MySQL Function official reference document :https://dev.mysql.com/doc/refman/5.7/en/
Built in functions are further divided into two categories : One line function 、 Aggregate functions ( Or grouping function ).
2、 One line function
Single line function definition :
- Manipulate data objects
- The receiving parameter returns a result
- Convert only one row
- Each line returns a result
- Can be nested
- The parameter can be a field or a value
2.1、 Functions of numerical type
The name of the function | do use |
---|---|
ABS() | Find the absolute value |
SQRT() | Find the quadratic root |
MOD(x,y) | seek x Divide y The remainder of |
PI() | Return the PI |
CEIL() and CEILING() | The two functions have the same function , All return the minimum integer no less than the parameter , That is, round up |
FLOOR() | Rounding down , The return value is converted to a BIGINT |
RAND() | Generate a 0~1 Random number between , When the incoming parameters are the same , The generated random number is the same |
ROUND(x,y) | Round the parameters passed |
TRUNCARE(x,y) | Return to digital x Truncated to y The result of decimal places |
SIGN() | Returns the symbol of the parameter . A positive number returns 1, A negative number returns -1,0 return 0 |
POW(x,y) and POWER(x,y) | The functions of the two functions are the same , All return to x Of y Power |
EXP(x) | return e Of x Power , among e It's a constant ,2.718281828459045 |
LN(x),LOG(x) | Return to e At the bottom of the X The logarithmic , When X<=0 when , The result returned is NULL |
BIN(x) | return x Binary code of |
HEX(x) | return x Hexadecimal encoding |
OCT(x) | return x Octal encoding |
SIN() | Find the sine |
ASIN() | Find the inverse sine , And functions SIN They're inverse functions to each other |
COS() | Find the cosine |
ACOS() | Find the inverse cosine , And functions COS They're inverse functions to each other |
TAN() | Find tangent |
ATAN() | Find the arctangent , And functions TAN They're inverse functions to each other |
COT() | Find the cotangent value |
Using examples :
SELECT ABS(-9) -- The absolute value 9
select pi(); -- PI 3.141593
select mod(4,3); -- Mod 1
SELECT CEILING(9.8) -- Rounding up 10
SELECT FLOOR(9.8) -- Rounding down 9
SELECT RAND() -- Generate random number 0-1 Between
SELECT SIGN(7) -- Judge the positive and negative of a number A positive number is 1
SELECT SIGN(-7)-- A negative number is -1
select round(146.647); -- rounding 146
select round(146.647,2); -- 146.65, Keep two decimal places
select truncate(146.647,2); -- Return to digital x Truncated to y The result of decimal places 146.64
select truncate(round(146.647,2),1); -- Nested functions use 146.6
select bin(4); -- return x Binary code of 100
select hex(100); -- return x Hexadecimal encoding 64
select oct(100); -- return x Octal encoding 144
2.2、 String function
The name of the function | do use |
---|---|
ASCII(s) | Return string s Of the first character in ASCll Code value |
CHAR_LENGTHI(s) | Return string s The number of characters . The functions and CHARACTER_LENGTH(s) identical |
LENGTH(s) | Returns the byte length of the string , It's about character sets |
CONCAT(s1,s2,…,sn) | Merge string functions , The return result is the string generated by the connection parameter , Parameters can make one or more |
CONCAT_WS(x,s1,s2,…,sn) | Same as CONCAT(s1,s2,…,sn) function , But add... Between each string x |
INSERT(str,idx,len,replacestr) | Replace string functions , The string str From idx Position start ,len Substrings of characters long are replaced with strings replacestr, String index from 1 At the beginning |
LOWER(s) or LCASE(s) | The string s Convert letters in to lowercase |
UPPER(s) or UCASE(s) | The string s Convert letters in to uppercase |
LEFT(str,n) | Take the string from the left side of the word str, Return... To the left of the string n Dry characters |
RIGHT(str,n) | Take the string from the right word str, Returns... To the right of the string n Dry characters |
LPAD(str,len,pad) | Use string pad Yes str Fill on the far left , until str The length of is len Characters |
RPAD(str,len,pad) | Use string pad Yes str Fill on the far right , until str The length of is len Characters |
TRIM(s) | Delete the spaces on the left and right of the string |
LTRIM(s) | Remove string s The space on the left |
RTRIM(s) | Remove string s The space on the right |
REPEAT(str,n) | return str repeat n Results of |
SPACE(n) | return n A space |
STRCMP(s1,s2) | Compare strings s1,s2 Of ASCIl The size of the code value |
REPLACE(str,a,b) | String replacement function , Use string b Replace the universal character string str All the strings that appear in a |
SUBSTRING | Intercepting string , Returns a character change of a specified length starting at a specified location |
REVERSE | String inversion ( The reverse ) function , Returns the string in reverse order to the original string |
ELT(m,s1,s2,s3,…,sn) | Returns the string at the specified location , If m=1, Then return to s1, If m=2, Then return to s2, If m=n, Then return to sn |
FIELD(s,s1,s2,s3,…,sn) | Return string s The position of the first occurrence in the string list |
FIELD_IN_SET(s1,s2) | Return string s1 In string s2 Where in . among , character string s2 Is a comma separated string |
NULLIF(s1,s2) | Compare two strings , If s1 And s2 equal , Then return to NULL, Otherwise return to s1 |
Using examples :
select ascii('CBcd') from dual; -- Return string s Of the first character in ASCll Code value 67
SELECT CHAR_LENGTH(' ten thousand , Li Gu Yicheng '); -- Return string length , 6
SELECT CONCAT(' Miles ',' Gu ',' One ',' cheng ');-- String concatenation , Wan Li Gu Yicheng
SELECT CONCAT_WS('a',' Miles ',' Gu ',' One ',' cheng ');-- String concatenation , Same as CONCAT(s1,s2,…,sn) function , But add... Between each string a , Miles a Gu a One a cheng
SELECT INSERT('helloworld',2,4,'b');-- 2: The starting position of the replaced character 4: Length of replaced character 'b': Replace character ,hbworld
SELECT LOWER('HELLo'); -- Convert to lowercase hello
SELECT UPPER('hello'); -- Convert to uppercase HELLO
SELECT left('hello',3); -- Take the string from the left side of the word str, Return... To the left of the string n Dry characters , hel
SELECT right('hello',3); -- Take the string from the left side of the word str, Return... To the left of the string n Dry characters , llo
SELECT lpad('hello',10,'a'); -- Use string pad Yes str Fill on the far left , until str The length of is len Characters , aaaaahello
SELECT rpad('hello',10,'a'); -- Use string pad Yes str Fill on the far right , until str The length of is len Characters , helloaaaaa
SELECT trim(' hello '); -- Delete the space around the string , hello
SELECT REPEAT('hello',3); -- return str repeat n Results of , hellohellohello
SELECT STRCMP('hello','world'); -- Compare strings s1,s2 Of ASCIl The size of the code value , -1, Indicates that the following number is large ;1, Indicates that the previous number is large
SELECT INSTR('hellworld','wo'); -- Returns the index of the first occurrence of the string ,5
SELECT REPLACE('java Senior engineer ',' senior ',' Ultima ');-- Replace the specified string that appears java Research Engineer
SELECT SUBSTR('java Senior engineer ',1,4);-- Intercepts the specified string 1: Where to start the capture 4: Intercept the length of the string , java
SELECT REVERSE(' Brother Zhao asked me to do something ');-- Reverse string , I entrusted my brother Zhao
SELECT FIELD('ab','bc','cd','ab','dg','ab');-- Return string s The position of the first occurrence in the string list ,3
SELECT FIND_IN_SET('ab','bc,cd,ab,dg,ab');-- Return string s1 In string s2 Where in ,3
SELECT NULLIF('ab','bc');-- Compare two strings ,ab
2.3、 Date and time functions
The name of the function | do use |
---|---|
CURDATE and CURRENT_DATE | The two functions work the same , Returns the date value of the current system |
CURTIME and CURRENT_TIME | The two functions work the same , Returns the time value of the current system |
NOW and SYSDATE | The two functions work the same , Returns the date and time values of the current system |
UNIX_TIMESTAMP | obtain UNIX Time stamp function , Return one to UNIX A timestamp based unsigned integer |
FROM_UNIXTIME | take UNIX Time stamp converted to time format , And UNIX_TIMESTAMP They're inverse functions to each other |
MONTH | Get the month in the specified date |
MONTHNAME | Get the English name of the month in the specified date |
DAYNAME | Get the English name of the day of the week corresponding to the specified date |
DAYOFWEEK | Gets the index location value of the week corresponding to the specified date |
WEEK | Get the specified date is the week of the year , Whether the return value range is 0〜52 or 1〜53 |
DAYOFYEAR | The date of acquisition is the day of the year , The return value range is 1~366 |
DAYOFMONTH | Get the specified date is the day of the month , The return value range is 1~31 |
YEAR | Get year , The return value range is 1970〜2069 |
TIME_TO_SEC | Convert the time parameter to seconds |
SEC_TO_TIME | Convert seconds to time , And TIME_TO_SEC They're inverse functions to each other |
DATE_ADD and ADDDATE | The two functions have the same function , All add the specified time interval to the date |
DATE_SUB and SUBDATE | The two functions have the same function , It's all subtracting the specified time interval from the date |
ADDTIME | Time addition operation , Add the specified time... To the original time |
SUBTIME | Time subtraction , Subtract the specified time from the original time |
DATEDIFF | Get the interval between two dates , Returns the parameter 1 Subtract the parameter 2 Value |
DATE_FORMAT | Format the specified date , Returns the value of the specified format according to the parameter |
WEEKDAY | Get the corresponding working day index of the specified date in a week |
Using examples :
SELECT CURDATE(),CURRENT_DATE(),CURRENT_DATE(); -- Returns the date value of the current system 2022-02-12,2022-02-12,2022-02-12
SELECT CURTIME(),CURRENT_TIME(),CURRENT_TIME(); -- Returns the time value of the current system 16:02:20,16:02:20,16:02:20
SELECT NOW(),SYSDATE(); -- Returns the date and time values of the current system 2022-02-12 16:03:33,2022-02-12 16:03:33
SELECT UNIX_TIMESTAMP(),UNIX_TIMESTAMP(NOW()),NOW(); -- obtain UNIX Time stamp function 1644653034,1644653034,2022-02-12 16:03:54
SELECT FROM_UNIXTIME(1644653034); -- take UNIX Time stamp is converted to normal format 2022-02-12 16:03:54
SELECT MONTH('2017-12-15'); -- Returns the month in the specified date 12
SELECT MONTHNAME('2017-12-15'); -- Return date date The full English name of the corresponding month December
SELECT DAYNAME('2022-02-12'); -- return date English name of the corresponding working day Saturday
SELECT DAYOFWEEK('2022-02-12'); -- Returns the week index corresponding to the date 7 ,1 Means Sunday ,2 It means Monday ,……,7 It means Saturday
/* WEEK() Function calculates date date It's the week of the year WEEK The function takes two arguments : date Is to get the date of the week . mode Is an optional parameter , The logic used to determine the calculation of the number of weeks , If you ignore mode Parameters , By default WEEK The function will use default_week_format The value of the system variable . */
SHOW VARIABLES LIKE 'default_week_format'; -- obtain default_week_format The current value of the variable 0
SELECT WEEK('2022-02-12',1); -- 6
SELECT DAYOFYEAR('2022-02-12'); -- Returns the day of the year that the specified date is 43
SELECT DAYOFMONTH('2022-02-12'); -- Returns the day of the specified date in January 12
SELECT YEAR(NOW()); -- Get the year of the current time 2022
SELECT TIME_TO_SEC('15:15:15'); -- Convert time value to second value 54915
SELECT SEC_TO_TIME('54925'); -- Convert the second value to the time format 15:15:25
SELECT DATE_ADD('2018-10-31 23:59:59',INTERVAL 1 SECOND) AS T1, -- Add... To the original time 1 second 2018-11-01 00:00:00
DATE_ADD('2018-10-31 23:59:59',INTERVAL '1:1' MINUTE_SECOND) AS T2, -- Add... To the original time 1 minute 1 second 2018-11-01 00:01:00
ADDDATE('2018-10-31 23:59:59',INTERVAL 1 SECOND) AS T3; -- Add... To the original time 1 second 2018-11-01 00:00:00
SELECT DATE_SUB('2018-01-02',INTERVAL 31 DAY) AS T1, -- Subtract one month from the original time 2017-12-02
SUBDATE('2018-01-02',INTERVAL 31 DAY) AS T2, -- Subtract one month from the original time 2017-12-02
DATE_SUB('2018-01-01 00:01:00',INTERVAL '0 0:1:1' DAY_SECOND) AS T3; -- Subtract... From the original time 1 branch 1 second 2017-12-31 23:59:59
-- DATE_ADD(date,INTERVAL expr type) and DATE_SUB(date,INTERVAL expr type) The function can also specify a negative value when specifying the time period of addition and subtraction , The negative value of addition returns the date and time before the original time , The negative value of subtraction returns the date and time after the original time .
SELECT ADDTIME('2018-10-31 23:59:59','0:1:1'), -- Add time 2018-11-01 00:01:00
ADDTIME('10:30:59','5:10:37'); -- 15:41:36
SELECT SUBTIME('2018-10-31 23:59:59','0:1:1'), -- Subtract time 2018-10-31 23:58:58
SUBTIME('10:30:59','5:12:37'); -- 05:18:22
SELECT DATEDIFF('2017-11-30','2017-11-20') AS COL1, -- Return to start time date1 And end time date2 Days between , return date1-date2 After the value of 10
DATEDIFF('2017-11-30','2017-12-15') AS col2; -- -15
/** DATE_FORMAT(date,format) Functions are based on format Display... In the specified format date value . DATE_FORMAT() The function takes two arguments : date: Is the valid date value to format format: Is a format string made up of predefined specifiers , Each specifier is preceded by a percentage character (%). */
SELECT DATE_FORMAT('2017-11-15 21:45:00','%W %M %D %Y') AS col1, -- Wednesday November 15th 2017
DATE_FORMAT('2017-11-15 21:45:00','%h:i% %p %M %D %Y') AS col2; -- 09:i PM November 15th 2017
SELECT WEEKDAY('2022-02-12'); -- Return the working day index corresponding to the date ,0 It means Monday ,1 Tuesday ,……,6 Means Sunday 5
DATE_FORMAT(date,format) Function format The format is shown in the table below :
specifier | explain |
---|---|
%a | The abbreviated name of a weekday (Sun~Sat) |
%b | Abbreviated name of the month (Jan…Dec) |
%c | month , Digital form (0~12) |
%D | Date of the month with English suffix (0th, 2st, 3nd,…) |
%d | Date of the month , Digital form (00~31) |
%e | Date of the month , Digital form (0~31) |
%f | Microsecond (000000 …999999) |
%H | With 2 Digit representation 24 Hours (00~23) |
%h, %I | With 2 Digit representation 12 Hours (01~12) |
%i | minute , Digital form (00~59) |
%j | — Days of the year (001~366) |
%k | With 24 Hours (0~23) Express |
%l | With 12 Hours (1~12) Express |
%M | The name of the month (January~December) |
%m | month , Digital form (00~12) |
%p | In the morning (AM) Or afternoon (PM) |
%r | Time ,12 hourly ( Hours (hh): minute (mm) : Number of seconds (ss) After add AM or PM) |
%S, %s | With 2 The number of digits represents seconds (00~59) |
%T | Time ,24 hourly ( Hours (hh): minute (mm): Number of seconds (ss)) |
%U | Zhou (00~53), Sunday is the first day of the week |
%u | Zhou (00~53), Monday is the first day of the week |
%V | Zhou (01~53), Sunday is the first day of the week , and %X Use at the same time |
%v | Zhou (01~53), Monday is the first day of the week , and %x Use at the same time |
%W | Week logo ( Sunday 、 Monday 、 Tuesday … Saturday ) |
%w | — Every day of the week (0= Sunday …6= Saturday ) |
%X | The year of the week , Sunday is the first day of the week , Digital form ,4 digit , and %V Use at the same time |
%x | The year of the week , Monday is the first day of the week , Digital form ,4 digit , and %v Use at the same time |
%Y | 4 The number of digits represents the year |
%y | 2 The number of digits represents the year |
%% | % A literal character |
2.4、 Process control functions
Process processing functions can be based on different conditions , Perform different processes , Can be in sQL Statement to implement different conditional choices .MySQL The process processing functions in mainly include lF()、IFNULL() and CASE() function .
The name of the function | effect |
---|---|
lF(value,value1,value2) | If value The value of is TRUE, return value1, Otherwise return to value2 |
IFNULL(value1, value2) | If value1 Not for NULL, return value1, Otherwise return to value2 |
CASE WHEN Conditions 1 THEN result 1 WHEN Conditions 2 THEN result 2…[ELSE resultn] END | amount to Java Of if…else if…else… |
CASE expr WHEN Constant values 1 THEN value 1 WHEN Constant values 1 THEN value 1…[ELSE value n] END | amount to Java Of switch…case… |
Practical examples :
/* Use IF(expr,v1,v2) Functions are based on expr The expression result returns the corresponding value : stay c3 in , First use STRCMP(s1,s2) Function to compare the size of two strings , character string 'abc' and 'ab' The return value of the comparison result is 1, That's the expression expr The return result of is not equal to 0 And it's not equal to NULL, The return value is v1, String character 'yes' 1,×,yes */
SELECT IF(1<2,1,0) c1,IF(1>5,'√','×') c2,IF(STRCMP('abc','ab'),'yes','no') c3;
SELECT first_name ,salary , IF(salary > 6000,' High salaries ',' commonly ') ' wages ' FROM employees
-- Use IFNULL(v1,v2) Functions are based on v1 The value of returns the corresponding value , If v1 Not for NULL, be IFNULL The function returns v1; Otherwise return to v2 Result .
SELECT IFNULL(5,8),IFNULL(NULL,'OK'),IFNULL(SQRT(-8),'FALSE'),SQRT(-8); -- 5,OK,FALSE,null
SELECT first_name ,salary,(salary + salary * IFNULL(commission_pct,0)) * 12 ' Annual salary '
/*CASE Statement to check that the value of the expression matches a set of unique values . take < expression > The value of each WHEN Compare values in clause , for example < value 1>,< value 2> etc. . If < expression > and < value n> The values are equal , Then execute the corresponding WHEN Command in branch < operation >. If WHEN In Clause < value n> With no < expression > The value of matches , be ELSE The command in clause will be executed .ELSE Clauses are optional . If omitted ELSE Clause , And no match found ,MySQL Error will be raised . */
SELECT CASE WEEKDAY(NOW())
WHEN 0 THEN ' Monday '
WHEN 1 THEN ' Tuesday '
WHEN 2 THEN ' Wednesday '
WHEN 3 THEN ' Thursday '
WHEN 4 THEN ' Friday '
WHEN 5 THEN ' Saturday '
ELSE ' Sunday ' END AS COLUMN1,
NOW(),WEEKDAY(NOW()),DAYNAME(NOW());
/* MySQL Separate calculation WHEN Every condition in clause , Until you find a value of TRUE Conditions , And then execute THEN Corresponding in clause < command >. If there is no condition for TRUE, execute ELSE In Clause < command >. If you don't specify ELSE Clause , And there is no condition for TRUE,MySQL An error message will be sent . */
SELECT CASE
WHEN WEEKDAY(NOW())=0 THEN ' Monday '
WHEN WEEKDAY(NOW())=1 THEN ' Tuesday '
WHEN WEEKDAY(NOW())=2 THEN ' Wednesday '
WHEN WEEKDAY(NOW())=3 THEN ' Thursday '
WHEN WEEKDAY(NOW())=4 THEN ' Friday '
WHEN WEEKDAY(NOW())=5 THEN ' Saturday '
WHEN WEEKDAY(NOW())=6 THEN ' Sunday ' END AS COLUMN1,
NOW(),WEEKDAY(NOW()),DAYNAME(NOW());
边栏推荐
- MySQL uses the view to report an error, explain/show can not be issued; lacking privileges for underlying table
- How to use AHAS to ensure the stability of Web services?
- The FISCO bcos console calls the contract and reports an error does not exist
- Sequence list and linked list
- I don't care about you. OKR or KPI, PPT is easy for you
- Function: find the sum of the elements on the main and sub diagonal of the matrix with 5 rows and 5 columns. Note that the elements where the two diagonals intersect are added only once. For example,
- AI helps make new breakthroughs in art design plagiarism retrieval! Professor Liu Fang's team paper was employed by ACM mm, a multimedia top-level conference
- 使用dnSpy对无源码EXE或DLL进行反编译并且修改
- 不得不会的Oracle数据库知识点(四)
- Oracle database knowledge points that cannot be learned (II)
猜你喜欢
The difference between objects and objects
功能:编写函数fun求s=1^k+2^k +3^k + ......+N^k的值, (1的K次方到N的K次方的累加和)。
Bodong medical sprint Hong Kong stocks: a 9-month loss of 200million Hillhouse and Philips are shareholders
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
Cloud dial test helps Weidong cloud education to comprehensively improve the global user experience
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
长文综述:大脑中的熵、自由能、对称性和动力学
在寻求人类智能AI的过程中,Meta将赌注押向了自监督学习
OS interrupt mechanism and interrupt handler
AI helps make new breakthroughs in art design plagiarism retrieval! Professor Liu Fang's team paper was employed by ACM mm, a multimedia top-level conference
随机推荐
Mobile asynchronous sending SMS verification code solution -efficiency+redis
CLP information - how does the digital transformation of credit business change from star to finger?
挖财帮个人开的证券账户安全吗?是不是有套路
功能:将主函数中输入的字符串反序存放。例如:输入字符串“abcdefg”,则应输出“gfedcba”。
@EnableAsync @Async
Software testers, how can you quickly improve your testing skills? Ten minutes to teach you
Print diamond pattern
Bodong medical sprint Hong Kong stocks: a 9-month loss of 200million Hillhouse and Philips are shareholders
功能:求5行5列矩阵的主、副对角线上元素之和。注意, 两条对角线相交的元素只加一次。例如:主函数中给出的矩阵的两条对角线的和为45。
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
国元证券开户是真的安全可靠吗
Future source code view -juc series
Sorry, Tencent I also refused
Thinkphp6 integrated JWT method and detailed explanation of generation, removal and destruction
On the day when 28K joined Huawei testing post, I cried: everything I have done in these five months is worth it
Regular expression of shell script value
Is the securities account opened by Caicai for individuals safe? Is there a routine
机器学习基础:用 Lasso 做特征选择
What is the GPM scheduler for go?
[software testing] you haven't mastered these real interview questions of big companies?