//queries
1. Query to display Employee Name, Job, Hire Date, Employee Number; for each employee with the Employee Number appearing first.
SELECT Eno, Ename, Job_type, Hire_date FROM employee;
2. Query to display unique Jobs from the Employee Table.
SELECT DISTINCT Job_type FROM employee;
3. Query to display the Employee Name concatenated by a Job separated by a comma.
SELECT CONCAT(Ename, ',', Job_type) AS Name_Job FROM employee;
4. Query to display all the data from the Employee Table. Separate each Column by a comma and name the said column as THE_OUTPUT.
SELECT CONCAT(Eno , ', ', Ename, ',', Job_type, ', ',Manager, ',' ,Hire_date, ',' ,Dno, ',' ,Commission, ',' ,Salary) AS THE_OUTPUT FROM employee;
5. Query to display the Employee Name and Salary of all the employees earning more than $2850.
SELECT Ename, Salary FROM employee WHERE ( Salary + Commission ) > 2850;
6. Query to display Employee Name and Department Number for the Employee No= 790.
SELECT Ename,Dno FROM employee WHERE Eno='790';
7. Query to display Employee Name and Salary for all employees whose salary is not in the range of $1500 and $2850.
SELECT Ename,Salary FROM employee WHERE Salary NOT BETWEEN 1500 AND 2850;
8. Query to display Employee Name and Department No. Of all the employees in Dept 10 and Dept 30 in the alphabetical order by name.
SELECT Ename,Dno FROM employee WHERE Dno=10 OR DNO=30 ORDER BY Ename;
9. Query to display Name and Hire Date of every Employee who was hired in 1981.
SELECT Ename,Hire_date FROM EMPLOYEE WHERE Hire_date LIKE '1981%';
10. Query to display Name and Job of all employees who don’t have a current Manager.
SELECT Ename,Job_type FROM employee WHERE Manager IS NULL;
Thanks for this queries this helps a lot to all university students... thanks again
ReplyDeleteI don't have the idea of creating database I'm new to DBMS, please post that thing aslo.
ReplyDelete