#1 Create table in SQL with table name "Employee" with the column name given below
EmpId | FullName | ManagerId | DateOfJoining | City |
---|---|---|---|---|
100 | Salman | 321 | 2019-01-31 | Mumbai |
101 | Shahrukh | 986 | 2020-01-30 | Navi Mumbai |
102 | Amir | 876 | 2023-05-30 | Pune |
103 | Amitabh | 123 | 2023-01-30 | Chennai |
104 | Ajay | 456 | 2020-01-30 | Noida |
Ans :
CREATE TABLE Employee (
EmpId INT NOT NULL,
FullName VARCHAR(255) NOT NULL,
ManagerId INT,
DateOfJoining DATE,
City VARCHAR(255),
PRIMARY KEY (EmpId)
);
#2 Insert the records in Employee Table
Ans :
INSERT INTO Employee (EmpId, FullName, ManagerId, DateOfJoining, City) VALUES
(100, 'Salman', 321, '2019-01-31', 'Mumbai'),
(101, 'Shahrukh', 986, '2020-01-30', 'Navi Mumbai'),
(102, 'Amir', 876, '2023-05-30', 'Pune'),
(103, 'Amitabh', 123, '2023-01-30', 'Chennai'),
(104, 'Ajay', 456, '2020-01-30', 'Noida');