TA Ch7 - INSERT INTO EMP_1 VALUES ('101', 'News', 'John',...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 7: Problems: 1. Write the SQL code that will create the table structure for a table named EMP_1. This table is a subset of the EMPLOYEE table. The basic EMP_1 table structure is summarized in the following table. CREATE TABLE EMP_1 ( EMP_NUM CHAR(3) NOT NULL, UNIQUE EMP_LNAME VARCHAR(15) NOT NULL EMP_FNAME VARCHAR(15) NOT NULL EMP_INITAL CHAR(1) NOT NULL EMP_HIREDATE DATE NOT NULL JOB_CODE CHAR(3) PRIMARY KEY (EMP_NUM) FOREIGN KEY (JOB_CODE) 2. Having created the table structure in Problem 1, write the SQL code to enter the first two rows for the table shown in Figure P7.2.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: INSERT INTO EMP_1 VALUES ('101', 'News', 'John', 'G', '08-Nov-00', '502') INSERT INTO EMP_1 VALUES ('102', 'Senior', 'David', 'H', '12-Jul-89', '501') 3. Assuming that the data shown in the EMP_1 table have been entered, write the SQL code that will list all attributes for a job code of 502. SELECT JOB_CODE FROM EMP_1 ; 6. Write the SQL code to delete the row for the person named William Smithfield, who was hired on June 22, 2004, and whose job code classification is 500. DELETE FROM EMP_1 WHERE EMP_LNAME = Smithfield...
View Full Document

This note was uploaded on 07/13/2011 for the course IST 210 taught by Professor Mcconn,charlotteryoo,jungwoo during the Summer '08 term at Pennsylvania State University, University Park.

Ask a homework question - tutors are online