As in the previous article we are done with the creation of the Tables and inserting values into them.
Moving ahead, let's start this case study by performing some basic queries on the data. You are going to learn simple to fetch information in tables, Also, a concept of alias will be executed here in this article.
QUERY 1: LIST ALL THE EMPLOYEE DETAILS.
select * from Employee;
QUERY 2: LIST ALL THE DEPARTMENT DETAILS
Select * from Department;
QUERY 3: LIST ALL JOB DETAILS.
Select * from Job;
QUERY 4: LIST ALL THE LOCATIONS DETAILS.
Select * from Location;
QUERY 5: LIST OUT ID, LAST NAME, DEPARTMENT ID FOR ALL EMPLOYEES, AND ALIAS ID AS "ID OF THE EMPLOYEE", LAST NAME AS "NAME OF THE EMPLOYEE", DEPARTMENTID AS "DEP_ID".
HINT: Alias is used in SQL by using AS.
Select ID As ID_OF_THE_EMPLOYEE, Last_Name As NAME_OF_THE_EMPLOYEE, Department_id AS DEP_ID from Employee;
QUERY 6: LIST OUT THE EMPLOYEES ANNUAL SALARY WITH THEIR NAMES ONLY.
Select First_Name, Last_Name, Salary from Employee;