RDBMS Query 4 (1)
RDBMS Query 4 (1)
Create the database COMPANY and create given tables with all necessary constraints such
asprimary key, foreign key, unique key, not null and check constraints.
Insert proper data (at least 5 appropriate records) in all the tables.
3. Display the names of all the employees who names starts with ‘A’ ends with ‘A’.
4. Find the name of employee and salary for those who had obtain minimum salary.
8. Print the record of employee and dept table as “Employee works in department ‘CE’.
10. List department wise names of employees who has more than 5 years of experience
Solution:
dept_no INT,
address VARCHAR2(100),
designation VARCHAR2(50),
salary NUMBER(10,2),
experience INT,
email VARCHAR2(100),
);
location VARCHAR2(100)
);
type_of_project VARCHAR2(50),
status VARCHAR2(50),
start_date DATE,
emp_id INT,
);
Display the names and the designation of all female employees in descending order:
Display the names of all the employees whose names start with ‘A’ and end with ‘A’:
Find the name of the employee and salary for those who had obtained the minimum salary
SELECT emp_name, salary FROM EMPLOYEE WHERE salary = (SELECT MIN (salary)
FROM EMPLOYEE);
Add a 10% raise in salary for all employees whose department is ‘CIVIL’
UPDATE EMPLOYEE SET salary = salary * 1.1 WHERE dept_no = (SELECT dept_no FROM
DEPART WHERE dept_name = 'CIVIL');
List the names of employees who are fresher’s (less than 1 year of experience)
List department-wise names of employees who have more than 5 years of experience