UseSQL Server;SELECT * fromEMP;--querying the data in scope--where which--between in ... Between--contains data within the specified range, including the specified condition itselfSelect * fromEmpwhereSalbetween - and 950; --equivalence Select * fromEmpwhereSal>= - andSal<= 950;--data that does not contain the specified range (including the specified condition itself)Select * fromEmpwhereSal not between 950 and 1250 ; --equivalence Select * fromEmpwhereSal< 950 orSal> 1250 ; --Don't look so troublesome (this is used to see the ascending of the Sal field) Select * fromEmpOrder bySalASC;--Practice --1. Query for information about all employees with wages between 1500 and 3000 (including the condition itself) Select * fromEmpwhereSalbetween the and the Order bySal; Select * fromEmpwhereSal>= the andSal<= the Order bySal; --2. Query information for all employees with a salary of less than 3000 or greater than 1500 Select * fromEmpwhereSal< the orSal> the; --3. Query information for all employees with a salary of less than 3000 and greater than 1500 Select * fromEmpwhereSalbetween 1501 and 2999--(Your salary didn't send a few cents in it) Select * fromEmpwhereSal< the andSal> the; --4. Inquire about all employees who are not paid between 1500 and 3000 (including the conditions themselves) Select * fromEmpwhereSal not between the and the Order bySal; Select * fromEmpwhereSal< the orSal> the Order bySal; /*Note: Between gets data results that contain its own condition not between get the data does not contain its own condition query what and what can only be used and cannot use or syntax: SEL ECT * FROM table where field (not) between numeric and value; The select * from table where field determines the symbolic value; The select * from table where field determines the symbolic value and (or) field to determine the symbolic value; Semantics: From table * where * and * (not) between Select property from the field in the table in the value and value (not) query property For example: SELECT * from emp where Sal is not between and 3000; Explanation: The attribute value from the EMP table, the SAL in 1500 and between 3000, the query meets the requirements field and outputs*/
4.select_between_ between what and what range