Presentation is loading. Please wait.

Presentation is loading. Please wait.

Displaying data from 2 tables

Similar presentations


Presentation on theme: "Displaying data from 2 tables"— Presentation transcript:

1 Displaying data from 2 tables
TABLE - EMPLOYEE Select * from employee,department where employee.deptid=department.deptid; ID NAME SALARY DeptId 1 ARUN 6000 2 VARUN 8000 3 ALI 9000 4 GEORGE 12000 5 MOHD output ID NAME SALARY DeptId deptid Dep_name 1 ARUN 6000 Marketing 2 VARUN 8000 Accounts 3 ALI 9000 4 GEORGE 12000 Sales 5 MOHD TABLE - department deptID Dep_NAME 1 Marketing 2 Accounts 3 Sales

2 Displaying data from 2 tables
TABLE - EMPLOYEE Select employee.*, dep_name from employee, department where employee.deptid=department.deptid; ID NAME SALARY DeptId 1 ARUN 6000 2 VARUN 8000 3 ALI 9000 4 GEORGE 12000 5 MOHD output ID NAME SALARY DeptId Dep_name 1 ARUN 6000 Marketing 2 VARUN 8000 Accounts 3 ALI 9000 4 GEORGE 12000 Sales 5 MOHD TABLE - department deptID Dep_NAME 1 Marketing 2 Accounts 3 Sales

3 Displaying data from 2 tables
TABLE - EMPLOYEE WAQ to display employee name and department name of all employees. ID NAME SALARY DeptId 1 ARUN 6000 2 VARUN 8000 3 ALI 9000 4 GEORGE 12000 5 MOHD Select name, dep_name from employee,department where employee.deptid = department.deptid; output NAME dep_name ARUN Marketing VARUN Accounts ALI GEORGE Sales MOHD TABLE - department deptID Dep_NAME 1 Marketing 2 Accounts 3 Sales

4 Find the output TABLE - EMPLOYEE Select name, dep_name from employee,department where employee.deptid = department.deptid; ID NAME SALARY DeptId 1 ARUN 6000 2 VARUN 8000 3 ALI 9000 4 GEORGE 12000 5 MOHD output NAME dep_name ARUN Marketing VARUN Accounts ALI TABLE - department deptID Dep_NAME 1 Marketing 2 Accounts 3 Sales


Download ppt "Displaying data from 2 tables"

Similar presentations


Ads by Google