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

CS-18 Practical Paper Solution

Uploaded by

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

CS-18 Practical Paper Solution

Uploaded by

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

PLAZMA INSTITUTE OF COMPUTER TECHNOLOGY

BCA SEM -3
DECEMBER-2024
CS-18 PRACTICAL

Total Marks [50]


Q-1. Write Following Queries. (10)
 Create Table Employees. Field like : ID, Name, DeptID, Mo_No, Salary, Designation, City
(a) Write create table query and insert 5 record.
 create table employees(id number(5), Name varchar2(10), DeptID number(5), Mo_No
number(10), Salary number(10),Designation varchar2(10), City varchar2(10));
 insert into employees values(&id,’&Name’,&DeptID,&Mo_No,&Salary,’&Designation’,’&City’);

(b) Display Structure of Employee Table.


 desc employees;

(c) List All Employees Name and Designation from Employee table.
 Select Name, Designation from employees;

(d) List All Employees Who are Managers.


 Select * from employees where Designation='Manager';

(e) List All Employees who are not belonging to DeptID 10,20,30.
 Select * from employees where DeptID not in (10,20,30);

OR

(a) Write create table query and insert 5 record.


 create table employees(id number(5), Name varchar2(10), DeptID number(5), Mo_No
number(10), Salary number(10),Designation varchar2(10), City varchar2(10));
 insert into employees values(&id, '&Name',&DeptID,&Mo_No,&Salary, '&Designation', '&City');

(b) List all Managers and add 200 rupees in each Salary.
 update employees set salary=salary+200 where designation='Manager';

(c) List all Employees and add 1000 rupees and subtract 500 rupees in each Salary.
 Update employees set salary=salary+1000;
 Update employees set salary=salary-500;

(d) Find those Employees whose Designation not start with ‘M’.
 select * from employees where designation not like 'M%';

(e) Find average Salary of each DeptID.


 select deptid, avg(salary) from employees group by deptid;

You might also like