Class 12
Class 12
3. Relation - (Select)
Date :
RELATION –EMPLOYEE
(Create, Insert,Select,Alter,Update)
Consider the following Employee table:
T
h
e primary key of this table is Employee_ID and Manager_ID is a foreign key that references
Employee_ID.
QUERIES
1. Create the above table.
9. Write a query to display the name and Job title of those employees
whose Manager is “Amyra”.
mysql> SELECT EMPLOYEE_NAME,JOB_TITLE FROM EMPLOYEE WHERE
EMPLOYEE_NAME="Amyra" AND JOB_TITLE="MANAGER";
+---------------------+----------------+
| EMPLOYEE_NAME | JOB_TITLE |
+---------------------+---------------+
| Amyra | Manager |
+--------------------+-----------------+
1 row in set (0.00 sec)
10. Write a query to display the name and Job title of those employees
aged between 26 years and 30 years (both inclusive)