0% found this document useful (0 votes)
5 views1 page

Create Table Department

The document contains SQL commands to create two tables: 'department' and 'employee', and insert multiple records into each. It also includes two SQL SELECT queries to retrieve data from both tables based on matching IDs. The first query uses a comma-separated syntax while the second uses an explicit JOIN syntax to achieve the same result.

Uploaded by

Diksha Khera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Create Table Department

The document contains SQL commands to create two tables: 'department' and 'employee', and insert multiple records into each. It also includes two SQL SELECT queries to retrieve data from both tables based on matching IDs. The first query uses a comma-separated syntax while the second uses an explicit JOIN syntax to achieve the same result.

Uploaded by

Diksha Khera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Create Table department(

ID int,

SALARY int,

NAME Varchar(20),

DEPT_ID Varchar(255));

INSERT INTO department VALUES (1,'Neha','F','1994-06-03');

INSERT INTO department VALUES (2,'Harsh','M','1996-03-12');

INSERT INTO department VALUES (3,'Harsh','M','1995-05-01');

INSERT INTO department VALUES (4,'Rupali','F',1996-11-11');

INSERT INTO department VALUES (5,'Rohan','M','1992-03-08');

CREATE TABLE employee(

ID int,

Email Varchar(255),

City Varchar(20) );

INSERT INTO employee VALUES (1, "[email protected]", "Noida");

INSERT INTO employee VALUES (2, "[email protected]", "Jaipur");

INSERT INTO employee VALUES (3, "[email protected]", "Noida");

INSERT INTO employee VALUES (4, "[email protected]", "Jaipur");

INSERT INTO employee VALUES (5, "[email protected]", "Noida");

SELECT department.ID, department.NAME, employee.Email, employee.City

FROM department, employee

WHERE department.ID = employee.ID;

SELECT department.ID, department.NAME, employee.Email, employee.City

FROM department JOIN employee ON department.ID = employee.ID;

You might also like