2. Create the seminar table Field Siure Data T text test text Emp city Emp salar
ID: 3718708 • Letter: 2
Question
2. Create the seminar table Field Siure Data T text test text Emp city Emp salary 10 text Insen the following data into the seminar table which you have created Seminar table Sem no S1 S2 Sem name database Sem cost 1000 1200 insert the following data into the employee table which you have created Employee table Emp no El E2 ?? E4 E5 E6 Sem no S2 S2 SI MaryamS Mohamed Sharjah Sharjah 15000 12000 8500 16000 22000 9000 Dubai ona Sharjah Aleem Dubai ReemSharjah S2 Write/run the SQL commands for the following queries .List the employee name and the seminar name for the employees who join S2. 6. Create a new table from a query which displays the names of the employees and their salary who live in Sharjah and their salary is greater than $10000. Name the new table "Sharjahemp" 7 Display the first three characters of the employee name whose city is Sharjah. SWhat is the number of employees in each seminar for the seminars which have more than two employees? Display the seminar number and the number of empl 9. Add 500 Dirhams to the employees whose salary is less than 15000. Display the employee name, the old salary and the new salary. Name the new field "newsalary" oyeesExplanation / Answer
CREATING THE SEMINAR TABLE:-
create table seminar_table(Sem_no varchar2(3), Sem_name varchar2(15), Sem_cost int(7),
primary key(Sem_no));
INSERTING VALUES INTO THE SEMINNAR TABLE:-
Insert into seminar_table(Sem_no,Sem_name,Sem_cost)values('s1','database',1000);
Insert into seminar_table(Sem_no,Sem_name,Sem_cost)values('s2','analysis',1200);
CREATING THE EMPLOYEE TABLE:-
create table Employee_table(Emp_no char(5),Emp_name char(15), Emp_city char(10),
Emp_salary int(7), Sem_no char(3), primary key(Emp_no));
INSERTING VALUES INTO THE EMPLOYEE TABLE;-
Insert into Employee_table(Emp_no,Emp_name,Emp_city,Emp_salary,Sem_no)
values('E1','Maryam','sharjah',15000,'s2');
Insert into Employee_table(Emp_no,Emp_name,Emp_city,Emp_salary,Sem_no)
values('E2','Mohamed','sharjah',12000,'s2');
Insert into Employee_table(Emp_no,Emp_name,Emp_city,Emp_salary,Sem_no)
values('E3','Tarq','Dubai',8500,'s1');
Insert into Employee_table(Emp_no,Emp_name,Emp_city,Emp_salary,Sem_no)
values('E4','Mona','sharjah',16000,NULL);
Insert into Employee_table(Emp_no,Emp_name,Emp_city,Emp_salary,Sem_no)
values('E5','Aleem','Dubai',22000,'s2');
Insert into Employee_table(Emp_no,Emp_name,Emp_city,Emp_salary,Sem_no)
values('E6','Reem','sharjah',9000,NULL);
5)
select Emp_name, Sem_name from Employee_table INNER JOIN seminar_table on
Employee_table.Sem_no=seminar_table.Sem_no;
6)
select Emp_name, Emp_salary from Employee_table where Emp_city='sharjah' and Emp_salary>10000;
7)
SELECT SUBSTRING( Emp_name, 1, 3 ) FROM Employee_table where Emp_city='sharjah';
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.