What is the data length for those columns in Oracle - Table designing

213 Views Asked by At

Could you please let me know what is the Data length for those columns in the Employee table? No value is specified for "NUMBER and DATE datatypes too. I'm new to this data designing.

Table : Employee

Column_Name ----- Data_Type ------- Nullable ---- Column_Id

Emp_ID           NUMBER               No         1
Emp_Name         VARCHAR2(10 BYTE)    No         2
Emp_Notes        VARCHAR2(100 BYTE)   No         3
Notes_Date       DATE                 No         4
Gender           CHAR(1 BYTE)         No         5
Emp_det_created  TIMESTAMP(9)         No         6
 CREATE TABLE employee
  (    " Emp_ID " NUMBER NOT NULL ENABLE,       
" Emp_Name " VARCHAR2(10 BYTE) NOT NULL ENABLE,
" Emp_Notes " VARCHAR2(100 BYTE) NOT NULL ENABLE,
       " Notes_Date " DATE NOT NULL ENABLE,
       " Gender " CHAR(1 BYTE) NOT NULL ENABLE,         
       " Emp_det_created " TIMESTAMP (9) NOT NULL ENABLE,
 USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
 STORAGE(INITIAL 1000 NEXT 1948506 MINEXTENTS 1 MAXEXTENTS 2100000045
 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
 TABLESPACE "EMPL"  ENABLE
  ) SEGMENT CREATION IMMEDIATE
 PCTFREE 10 PCTUSED 20 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
 STORAGE(INITIAL 1000 NEXT 1948506 MINEXTENTS 1 MAXEXTENTS 2100000045
 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
 TABLESPACE "EMPL" ;

O/P: select * from Employee ;

Emp_Id ---- Emp_Name---- Emp_Notes--- Notes_date -- Gender --- Emp_det_created

10 -- Claire Tay -- Good given --- 04/01/2015 --- F --- 04/01/2015

20 -- Doe Rose --- Plain text ---- 03/25/2016--- M --- 03/25/2016

501 -- Aven Trummer -- Plain message -- 05/01/2017 -- M -- 05/01/2017

Please help me.

1

There are 1 best solutions below

1
Del On

To answer your question specifically, here are the sizes of the two data types you asked about:

  • Number: Can be between 1 and 22 Bytes. This default uses the max precision and scale.
  • Date: 7 Bytes

A full list of all datatypes can be found in the Oracle Documentation, here.