Hello, I received the following assignment questions and I am not sure how to answer them. Can you help me?   Write the SQL code that will create only the table structure for a table named EMP_1. This table will be a subset of the EMPLOYEE table. The basic EMP_1 table structure is summarized in the following table. Use EMP_NUM as the primary key. Note that the JOB_CODE is the FK to JOB so be certain to enforce referential integrity. Your code should also prevent null entries in EMP_LNAME and EMP_FNAME.   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 P8.2. Each row should be inserted individually, without using a subquery. Insert the rows in the order that they are listed in the figure.

Fundamentals of Information Systems
9th Edition
ISBN:9781337097536
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter3: Database Systems And Big Data
Section: Chapter Questions
Problem 16SAT
icon
Related questions
Question
100%

Hello,

I received the following assignment questions and I am not sure how to answer them. Can you help me?

 

  1. Write the SQL code that will create only the table structure for a table named EMP_1. This table will be a subset of the EMPLOYEE table. The basic EMP_1 table structure is summarized in the following table. Use EMP_NUM as the primary key. Note that the JOB_CODE is the FK to JOB so be certain to enforce referential integrity. Your code should also prevent null entries in EMP_LNAME and EMP_FNAME.

 

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 P8.2. Each row should be inserted individually, without using a subquery. Insert the rows in the order that they are listed in the figure.

Figure P8.2.
The Contents of the EMP_1 Table
EMP_NUM EMP_LNAME EMP_FNAME
101
102
103
EMP INITIAL
EMP HREDATE JOB_CODE
News
John
08-Nov-00 502
Senior
David
H.
12-Jul-89 501
E
K
K
Arbough
June
01-Dec-96 500
104
105
106
107
Ramoras
Anne
15-Nov-87 501
Johnson
Alice
01-Feb-93 502
Smithfield
William
22-Jun-04 500
Alonzo
Maria
D.
10-Oct-93 500
108
Washington
Ralph
22-Aug-91 501
109
Smith
Larry
18-Jul-97 501
Transcribed Image Text:Figure P8.2. The Contents of the EMP_1 Table EMP_NUM EMP_LNAME EMP_FNAME 101 102 103 EMP INITIAL EMP HREDATE JOB_CODE News John 08-Nov-00 502 Senior David H. 12-Jul-89 501 E K K Arbough June 01-Dec-96 500 104 105 106 107 Ramoras Anne 15-Nov-87 501 Johnson Alice 01-Feb-93 502 Smithfield William 22-Jun-04 500 Alonzo Maria D. 10-Oct-93 500 108 Washington Ralph 22-Aug-91 501 109 Smith Larry 18-Jul-97 501
Table P8.1.
Constructco Database Structure
ATTRIBUTE (FIELD) NAME DATA DECLARATION
EMP_NUM
CHAR(3)
EMP LNAME
VARCHAR(15)
EMP_FNAME
VARCHAR(15)
EMP_INITIAL
CHAR(1)
EMP_HIREDATE
DATE
JOB_CODE
CHAR(3)
Transcribed Image Text:Table P8.1. Constructco Database Structure ATTRIBUTE (FIELD) NAME DATA DECLARATION EMP_NUM CHAR(3) EMP LNAME VARCHAR(15) EMP_FNAME VARCHAR(15) EMP_INITIAL CHAR(1) EMP_HIREDATE DATE JOB_CODE CHAR(3)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781305082168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr