Computer Science
Create table Employee as per following Table Instance Chart.
Column Name | EmpID | EmpName | EmpAddress | EmpPhone | EmpSal | DeptID |
---|---|---|---|---|---|---|
Key Type | Primary | Foreign | ||||
Nulls/Unique | NOT NULL | |||||
Fk Table | Department | |||||
Fk Column | Dept_ID | |||||
Datatype | NUMBER | VARCHAR | VARCHAR | VARCHAR | NUMBER | VARCHAR |
Length | 6 | 20 | 30 | 10 | 9, 2 | 2 |
DDL & DML
9 Likes
Answer
CREATE TABLE Employee (
EmpID NUMBER(6) PRIMARY KEY,
EmpName VARCHAR(20) NOT NULL,
EmpAddress VARCHAR(30),
EmpPhone VARCHAR(10),
EmpSal NUMBER(9, 2),
DeptID VARCHAR(2),
FOREIGN KEY (DeptID) REFERENCES Department (Dept_ID)
ON DELETE CASCADE ON UPDATE CASCADE
);
Answered By
7 Likes
Related Questions
Insert few records with relevant information, in the table.
Drop the column CustomerIncomeGroup from table Customer.
Create table Department as per following Table Instance Chart.
Column Name DeptID DeptName Key Type Primary Nulls/Unique NOT NULL Datatype NUMBER VARCHAR Length 2 20 View structures of all tables created by you.