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

Answer SQL Questions

The document outlines SQL commands for managing an 'Employees' table, including creating the table, inserting records, updating salaries, deleting entries, and querying data. It also includes commands to alter the table by adding an email column and to filter results based on specific criteria. The operations demonstrate basic database manipulation techniques using SQL.
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)
4 views2 pages

Answer SQL Questions

The document outlines SQL commands for managing an 'Employees' table, including creating the table, inserting records, updating salaries, deleting entries, and querying data. It also includes commands to alter the table by adding an email column and to filter results based on specific criteria. The operations demonstrate basic database manipulation techniques using SQL.
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

Ans 1 CREATE TABLE Employees (

EmployeeID INT PRIMARY KEY,

FirstName VARCHAR(50),

LastName VARCHAR(50),

DateOfBirth DATE,

Position VARCHAR(50),

Salary DECIMAL(10, 2)

);

Ans. 2. INSERT INTO Employees (EmployeeID, FirstName, LastName, DateOfBirth, Position, Salary)

VALUES (1, 'Alice', 'Johnson', '1985-07-15', 'Manager', 60000);

INSERT INTO Employees (EmployeeID, FirstName, LastName, DateOfBirth, Position, Salary)

VALUES (2, 'Bob', 'Smith', '1990-08-25', 'Developer', 50000);

Ans.3. SELECT * FROM Employees;

Ans. 4. UPDATE Employees

SET Salary = 55000

WHERE EmployeeID = 2;

Ans. 5 DELETE FROM Employees

WHERE EmployeeID = 1;

Ans. 6 SELECT * FROM Employees

WHERE Salary > 50000;

Ans.7 ALTER TABLE Employees

ADD Email VARCHAR(100);


Ans. SELECT * FROM Employees

WHERE FirstName LIKE 'A%';

Ans. 8. SELECT * FROM Employees

ORDER BY LastName ASC;

You might also like