/*Please relook once you before Drop the Existing Table: */
DROP TABLE IF EXISTS tbl_Emp;
/*Creating New Employee Table*/
CREATE TABLE tbl_Emp(
Empno INT NOT NULL PRIMARY KEY
, Ename VARCHAR(50) NOT NULL
, Job VARCHAR(50) NOT NULL
, Mgr INT
, Hiredate DATE
, Sal DECIMAL(10,2)
, Comm DECIMAL(10,2)
, Deptno INT NOT NULL);
/*Inserting Data Into above created Table: */
INSERT INTO tbl_Emp (Empno,Ename,Job,Mgr,Hiredate,Sal,Comm,Deptno)
VALUES
(7369, 'SMITH', 'CLERK', 7902, '6/13/93', 800, 0.00, 20)
, (7499, 'ALLEN', 'SALESMAN', 7698, '8/15/98', 1600, 300, 30)
, (7521, 'WARD', 'SALESMAN', 7698, '3/26/96', 1250, 500, 30)
, (7566, 'JONES', 'MANAGER', 7839, '10/31/95', 2975, null, 20)
, (7698, 'BLAKE', 'MANAGER', 7839, '6/11/92', 2850, null, 30)
, (7782, 'CLARK', 'MANAGER', 7839, '5/14/93', 2450, null, 10)
, (7788, 'SCOTT', 'ANALYST', 7566, '3/5/96', 3000, null, 20)
, (7839, 'KING', 'PRESIDENT', null, '6/9/90', 5000, 0, 10)
, (7844, 'TURNER', 'SALESMAN', 7698, '6/4/95', 1500, 0, 30)
, (7876, 'ADAMS', 'CLERK', 7788, '6/4/99', 1100, null, 20)
, (7900, 'JAMES', 'CLERK', 7698, '6/23/00', 950, null, 30)
, (7934, 'MILLER', 'CLERK', 7782, '1/21/00', 1300, null, 10)
, (7902, 'FORD', 'ANALYST', 7566, '12/5/97', 3000, null, 20)
, (7654, 'MARTIN', 'SALESMAN', 7698, '12/5/98', 1250, 1400, 30);
/*Selecting Data from Table*/
select * from tbl_Emp
Please comment below
No comments:
Post a Comment