The Name column only contains uppercase (A-Z) and lowercase (a-z) letters.
Query the Name of any student in STUDENTS who scored higher than Marks. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID.
SELECTNAMEFROM STUDENTSWHERE MARKS>75ORDER BY SUBSTR(NAME, LENGTH(NAME)-2, 3), ID;##์์์ ์ฌ์ฉํด๋ดค๋ substr์ ์ฌ์ฉํด์ ์ฒ์์๋ ์ ๊ทผ------------------------------------------------------------SELECTNAMEFROM STUDENTSWHERE MARKS>75ORDER BY SUBSTR(NAME, -3), ID;
Write a query that prints a list of employee names (i.e.: the name attribute) from the Employee table in alphabetical order.
Input Format
The Employee table containing employee data for a company is described as follows:
where employee_id is an employee's ID number, name is their name, months is the total number of months they've been working for the company, and salary is their monthly salary.
๋ค....
Employee Salaries
Write a query that prints a list of employee names (i.e.: the name attribute) for employees in Employee having a salary greater than 2000$ per month who have been employees for less than 10 months. Sort your result by ascending employee_id.
SELECT NAME
FROM (
SELECT *
FROM EMPLOYEE
WHERE SALARY > 2000
)
WHERE MONTHS<10
ORDER BY EMPLOYEE_ID;
-----------------------------------------
SELECT NAME
FROM EMPLOYEE
WHERE SALRAY>2000 AND MONTHS<10
ORDER BY EMPLOYEE_ID;