SyedaKashafNaqvi-125-4C T1 DBL
SyedaKashafNaqvi-125-4C T1 DBL
SyedaKashafNaqvi-125-4C T1 DBL
SOFTWARE ENGINEERING
DEPARTMENT
Database Systems
“SQL Queries”
Question#1:
Create an Employee Table:
create database EmployeeDB
use EmployeeDB
Insert Data:
INSERT INTO Employee (EmployeeName, EmployeeSal, EmployeeCity,
EmployeeDob)
VALUES
('Kashaf', 50000.00, 'Gujranwala', '2004-01-08'),
('Fatima', 90000.00, 'Lahore', '2000-08-28'),
('Rida', 40000.00, 'Gujrat', '2001-06-06')
UPDATE Employee
SET EmployeeSal = 55000.00
WHERE EmployeeNo = 1 AND EmployeeName = 'Kashaf';
2|Page
Assignment#1
Question#2:
Create a Persons Table:
CREATE TABLE Persons (
P_Id INT PRIMARY KEY,
LastName VARCHAR(255),
FirstName VARCHAR(255),
Address VARCHAR(255),
City VARCHAR(255)
);
Insert Data:
INSERT INTO Persons (P_Id, LastName, FirstName, Address, City)
VALUES
(1, 'Hansen', 'Christ', 'Timoteivn 10', 'Sandnes'),
(2, 'Svendson', 'Tove', 'Borgvn 23', 'Sandnes'),
(3, 'Pettersen', 'Michael', 'Storgt 20', 'Stavanger');
3|Page
Assignment#1
UPDATE Persons
SET Address = 'Nissestien 67', City = 'Sandnes'
WHERE P_Id = 5;
4|Page