Assigment 4
Assigment 4
SELECT
'PROFILE' AS PROFILE UNION ALL
SELECT emp_name || ' is a ' || designation AS PROFILE
FROM employee_table;
2. Write a query to Find out the total number of characters in the names of each customer
from the Customer table.
Write your query here
SELECT customer_name, LENGTH(customer_name) AS total_characters
FROM Customer;
3. Write a query to display the content of the customer table having customer names in
capital only.
Write your query here
SELECT *FROM Customer WHERE UPPER(customer_name) =
customer_name;
6. The EMPLOYEE table has a column JOIN_DATE of data type DATE, containing
the date the employee joined the company.
Write a query to display details of employees where JOIN_DATE is within the last
24 months
Write your query here
SELECT *FROM EMPLOYEE
WHERE JOIN_DATE >= DATE_SUB(CURDATE(), INTERVAL 24 MONTH);
7. Write a query to get the details of all customers whose name starts with ‘an$’.
Write your query here
SELECT *FROM Customers
WHERE customer_name LIKE 'an%';
8. Write a query to get the round up salaries of each employee.
Write your query here
SELECT employee_id, name, CEIL(salary) AS rounded_salary
FROM Employees;
9. From the EMPLOYEES table, write a SQL query to find the employees who have
joined after 2018 Return first_name,join_date, salary.
Write your query here
SELECT first_name, join_date, salary FROM EMPLOYEES
WHERE join_date > '2018-01-01';
TO_CHAR(number_column, '9999.99')