SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table Detail ( E_ID int not null, E_NAME varchar (20), E_SALARY int, E_AGE int, E_GENDER varchar(20), E_DEPT varchar(20), primary key(E_ID)); insert into Detail values (1,'Sam', 95000,45,'Male','Operations'), (2,'Bob',80000,21,'Male','Support'), (3,'Anne',125000,25,'Female','Analytics'), (4,'Julia',73000,30,'Female','Analytics'), (5,'Matt',159000,33,'Male','Sales'), (6,'Jeff',112000,27,'Male','Operations'); create table department (D_ID int, D_NAME varchar(20), D_LOCATION varchar(20)); insert into department values (1,'Content','New York'),(2,'Support','Chicago'), (3,'Analytics','New York'),(4,'Sales','Boston'), (5,'Tech', 'Dallas'),(6,'Finance','Chicago'); select detail.e_name,detail.e_dept ,department.d_name, department.d_location from detail inner join department on detail.e_dept=department.d_name; select detail.e_name, detail.e_dept,department.d_name, department.d_location from detail left join department on detail.e_dept=department.d_name; select detail.e_name,detail.e_dept,department.d_name, department.d_location from detail right join department on detail.e_dept=department.d_name; select detail.e_name,detail.e_dept,department.d_name, department.d_location from detail full join department on detail.e_dept=department.d_name; select detail.e_name,detail.e_depy,department.d_name, department.e_location from detail full join department on detail.e_dept=department.d_name; update detail set e_age=e_age+10 from detail join department on detail.e_dept=department.d_name where d_location='New York';
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear