0% found this document useful (0 votes)
12 views2 pages

Project 1

project my

Uploaded by

rrjangra440
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)
12 views2 pages

Project 1

project my

Uploaded by

rrjangra440
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/ 2

Answer the given questions:

1. Create a table “Employees” using create table command having columns


(Employee_name, Department, Salary) into a new database named “test_database”.
Write your query here
CREATE TABLE Employees ( Employees_name VARCHAR(250), Department
VARCHAR(100), Salary DECIMAL(10, 2)

2. Import this Dummy Data into “Employees” Table : (Employee1, Dep1,10000),


(Employee2, Dep1,12000)(,Employee5, Dep3,10500).
Write your query here
INSERT INTO Employees (Employees_name, Department, Salary) VALUES
('Employee1', 'Dep1', 10000), ('Employee2', 'Dep1', 12000), ('Employee5',
'Dep3', 10500);

3. Import Data into “Employees” table using this CSV file


Write your query here
copy employees_name
from C:\Users\me\OneDrive\Documents\Employee data - Sheet1.csv\copy.csv
delimiter','
csv header

4. Write a query to select distinct employees from the employee table


Write your query here
SELECT DISTINCT “column name” FROM “table name”;

5. Write a query to get the salary of ‘Employee3’.


Write your query here
SELECT Salary
FROM Employees
WHERE Employee_name = 'Employee3';

6. Write a query to get the Employees having salaries greater than 13000 and less than
17000.
Write your query here
SELECT Employees_name, Department, Salary FROM
Employees WHERE Salary > 13000 AND Salary < 17000;
7. Delete the data of employee 10 from the “Employees” table.
Write your query here
DELETE FROM Employees WHERE Employees_name = 'Employee10';

8. Update the data of Employee7 and change the salary to 20000


Write your query here
UPDATE Employees
SET Salary = 20000
WHERE Employee_name = 'Employee7';

9. Alter the Employees Table and change the data type of salary column to varchar
Write your query here
ALTER TABLE Employees
MODIFY COLUMN Salary VARCHAR(255);

10. Backup this “test_database” and restore it by the name of employee_database.

You might also like