the question is: 1. Write the DDL statement for defining the Employee table. (Assume that the Reward and Department tables have already been created)
Instructions:
Write the suitable SQL statement to answer the following questions based on the following tables ( image for better table)
Table Name: Employee
EMP_ID FNAME LNAME SALARY JOIN_DATE DEP_NO
101 John Abraham 10000 01-JAN-13 11
202 Michael Clarke 80000 01-JAN-13 22
303 Roy Thomas 70000 01-FEB-13 11
404 Tom Jose 60000 01-FEB-13 22
505 Jerry Pinto 65000 01-FEB-13 22
606 Philip Mathew 75000 01-JAN-13 33
707 Thomas Jack 65000 01-JAN-13 33
Table Name: Reward
EMP_ID REWARD_DATE AMOUNT
101 01-FEB-13 5000
202 01-FEB-13 3000
303 01-FEB-13 4000
101 01-JAN-13 4500
202 01-JAN-13 3500
Table Name: Department
DEP_NO DEP_NAME
11 Banking
22 Insurance
33 Services
44 Marketing
the question is:
1. Write the DDL statement for defining the Employee table.
(Assume that the Reward and Department tables have already been created)
![+Table Name: Employee
EMP ID
FNAME
101
John
202
Michael
303
Roy
404
Tom
505
606
707
Jerry
Philip
Thomas
LNAME SALARY
Abraham
Clarke
Thomas
Jose
Pinto
Mathew
Jack
Table Name: Reward
EMP ID REWARD DATE
101
01-FEB-13
20
01-FEB-13
303
01-FEB-13
101
01-JAN-13
202
01-JAN-13
10000
80000
70000
60000
65000
75000
65000
AMOUNT
5000
3000
4000
4500
3500
JOIN DATE
01-JAN-13
01-JAN-13
01-FEB-13
01-FEB-13
01-FEB-13
01-JAN-13
01-JAN-13
DEP NO
11
22
11
22
22
33
33
Table Name: Department
DEP NO DEP NAME
11
22
33
44
Banking
Insurance
Services
Marketing](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F79ce16d0-b933-46ad-98ad-b13dc0b61fed%2Fc660ed01-2c2a-4942-8e7f-0ce527155eec%2Fo8d30e8_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
in the question it said that "Assume that the Reward and Department tables have already been created " so i don't need to create the tables + there is a link from rewards and department to the Employee as in the picture for a reference,
my answer is :
CREATE TABLE Employee (
EMP_ID CHAR(3) NOT NULL,
FNAME VARCHAR(15) NOT NULL,
LNAME VARCHAR(15) NOT NULL,
SALARY DECIMAL(10,2),
JOIN_DATE DATE
DEP_NO CHAR(2) NOT NULL
PRIMARY KEY(EMP_ID),
FOREIGN KEY(EMP_ID) REFRENCE Rewrad,
FOREIGN KEY(DEP_NO) REFRENCE Department
);
is it wrong ?
![+Table Name: Employee
EMP ID
FNAME
101
John
202
Michael
303
Roy
404
Tom
505
606
707
Jerry
Philip
Thomas
LNAME SALARY
Abraham
Clarke
Thomas
Jose
Pinto
Mathew
Jack
Table Name: Reward
EMP ID REWARD DATE
101
01-FEB-13
20
01-FEB-13
303
01-FEB-13
101
01-JAN-13
202
01-JAN-13
10000
80000
70000
60000
65000
75000
65000
AMOUNT
5000
3000
4000
4500
3500
JOIN DATE
01-JAN-13
01-JAN-13
01-FEB-13
01-FEB-13
01-FEB-13
01-JAN-13
01-JAN-13
DEP NO
11
22
11
22
22
33
33
Table Name: Department
DEP NO DEP NAME
11
22
33
44
Banking
Insurance
Services
Marketing](https://content.bartleby.com/qna-images/question/79ce16d0-b933-46ad-98ad-b13dc0b61fed/567c9c6f-e573-4922-98d2-6d55b64a3db5/yh38zy6_thumbnail.png)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)