أخر الاخبار

Database query

 



/sol

Answer 1 : SELECT MAX ( salary ) , MIN ( salary ) FROM employees ;


 Answer 2 ; SELECT dep_id , job_name , count ( * ) FROM employees GROUP BY dep_id , job_name ;


 Answer 3 ; SELECT w.manager_id , count ( * ) FROM employees w , employees m WHERE w.manager_id = m.emp_id GROUP BY w.manager_id ORDER BY w.manager_id ASC ; 


Answer 4 : SELECT employee_id , first_name , salary FROM employees WHERE salary > ( SELECT AVG ( salary ) FROM employees ) AND department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE ' % J % ' ) ; 


Answer 5 : SELECT employee_id , first_name , salary FROM employees WHERE salary > ( SELECT AVG ( salary ) FROM employees ) AND department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE ' % J % ' )


Answer 6 : SELECT first_name , last_name , hire_date FROM employees WHERE YEAR ( hire_date ) LIKE ' 2014 % ' ;


 Answer 7 : INTCAP ( ) . 

SELECT first_name , last_name , concat ( lower ( first_name ) , ' ' , lower ( last_name ) " Name of Employee in lower case " , initcap ( concat ( first_name , ' ' , last_name ) ) " Proper Name " FROM employees WHERE department_id = 100 UPPAR ( ) . SELECT Firstname , Lastname , upper ( Country ) as COUNTRY FROM Employee ;

 LOWER ( ) . SELECT Firstname , Lastname , lower ( Country ) as COUNTRY FROM Employee ;


 Answer 8 : SELECT FIRST_NAME , SYSDATE ( ) , HIRE_DATE , DATEDIFF ( SYSDATE ( ) , hire_date ) / 365 FROM employees ;   .

تعليقات



حجم الخط
+
16
-
تباعد السطور
+
2
-