Case Statements: sql Copy code SELECT column1, column2, CASE WHEN condition1 THEN result1 WHEN condition2 THEN result2 ELSE result3 END AS alias FROM table_name; Subqueries: sql Copy code SELECT column1 FROM table1 WHERE column2 IN (SELECT column3 FROM table2 WHERE condition); Keys: Primary Key: sql Copy code CREATE TABLE table_name ( id INT PRIMARY KEY, column1 datatype, column2 datatype, ... ); Foreign Key: sql Copy code CREATE TABLE table_name ( id INT PRIMARY KEY, foreign_id INT, column1 datatype, column2 datatype, FOREIGN KEY (foreign_id) REFERENCES other_table(id) ); Wildcards: sql Copy code SELECT column1 FROM table_name WHERE column2 LIKE 'abc%'; Case Statements: sql Copy code SELECT column1, column2, CASE WHEN condition1 THEN result1 WHEN condition2 THEN result2 ELSE result3 END AS alias FROM table_name; Subqueries: sql Copy code SELECT column1 FROM table1 WHERE column2 IN (SELECT column3 FROM table2 WHERE condition); Keys: Primary Key: sql Copy code CREATE TABLE table_name ( id INT PRIMARY KEY, column1 datatype, column2 datatype, ... ); Foreign Key: sql Copy code CREATE TABLE table_name ( id INT PRIMARY KEY, foreign_id INT, column1 datatype, column2 datatype, FOREIGN KEY (foreign_id) REFERENCES other_table(id) ); Wildcards: sql Copy code SELECT column1 FROM table_name WHERE column2 LIKE 'abc%' Certainly! Here's an example of performing the ORDER BY clause on two columns in the EMPLOYEE table: sql Copy code SELECT empId, name, dept, grade FROM EMPLOYEE ORDER BY grade DESC, name ASC; In this example, the ORDER BY clause is applied to the grade column in descending order (DESC) first. Then, if there are multiple rows with the same grade, the name column is used to sort those rows in ascending order (ASC). The result will be a sorted result set where the rows are arranged based on the grade in descending order. Within each grade, the rows will be further sorted based on the name in ascending order. You can modify the column names and the sort order based on your specific requirements. Simply specify the desired columns in the ORDER BY clause and indicate whether you want them sorted in ascending (ASC) or descending (DESC) order. select avg(grade) from EMPLOYEE select avg(grade) from EMPLOYEE where dept='Accounting' select * from EMPLOYEE where grade<(select avg(grade) from EMPLOYEE where dept='Accounting') Certainly! Here's an example of performing the ORDER BY clause on two columns in the EMPLOYEE table: sql Copy code SELECT empId, name, dept, grade FROM EMPLOYEE ORDER BY grade DESC, name ASC; In this example, the ORDER BY clause is applied to the grade column in descending order (DESC) first. Then, if there are multiple rows with the same grade, the name column is used to sort those rows in ascending order (ASC). The result will be a sorted result set where the rows are arranged based on the grade in descending order. Within each grade, the rows will be further sorted based on the name in ascending order. You can modify the column names and the sort order based on your specific requirements. Simply specify the desired columns in the ORDER BY clause and indicate whether you want them sorted in ascending (ASC) or descending (DESC) order.