0% found this document useful (0 votes)
26 views4 pages

Waqar 4

The document contains SQL statements to create an EMPLOYEE table in a QUIZ database, insert, update, select, delete and alter data. It creates the table, inserts one record, updates an employee's job code, selects employees with a specific job code, deletes a record by date and job code, and alters the table twice to add new columns.

Uploaded by

Zawiyar Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views4 pages

Waqar 4

The document contains SQL statements to create an EMPLOYEE table in a QUIZ database, insert, update, select, delete and alter data. It creates the table, inserts one record, updates an employee's job code, selects employees with a specific job code, deletes a record by date and job code, and alters the table twice to add new columns.

Uploaded by

Zawiyar Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

181323

(LATE SUBMISSION DUE TO INTERNET AND LIGHT ISSUE)


INSERT INTO

EMPLOYEE([EMP_NUM], [EMP_LNAME], [EMP_FNAME], [EMP_INITIAL], [EMP_HIREDATE],


[JOB_CODE])

values (109, 'Sheikh', 'sulman', 'B', '1997-07-18',501)

select * from EMPLOYEE


CREATE DATABASE QUIZ

use[QUIZ]

create table EMPLOYEE(

EMP_NUM char(3),

EMP_LNAME varchar(15),

EMP_FNAME varchar(15),

EMP_INITIAL char(1),

Emp_HIREDATE DATE,

JOB_CODE char(3) ,

)
INSERT INTO

EMPLOYEE([EMP_NUM], [EMP_LNAME], [EMP_FNAME], [EMP_INITIAL], [EMP_HIREDATE],


[JOB_CODE])

values (109, 'Sheikh', 'sulman', 'B', '1997-07-18',501)

UPDATE EMPLOYEE

set

JOB_CODE= 501

where EMP_NUM= 107

SELECT *from EMPLOYEE where JOB_CODE=501

DELETE FROM Employee WHERE EMP_HIREDATE='1993-10-10' AND JOB_CODE='500'

ALTER TABLE EMPLOYEE

ADD EMP_PCT VARCHAR(15)

ALTER TABLE EMPLOYEE

ADD PRJ_NUM VARCHAR(15)

update EMPLOYEE

set

PRJ_NUM= 14

Where Emp_HIREDATE='1994-1-1' and JOB_CODE <=502

select * from EMPLOYEE

You might also like