Help Normalizing a Big Table to 3 Sub Tables
Asked By
280 points
N/A
Posted on - 05/12/2011

Hi,
I am assigned for normalizing an established database written in MySQL. The database consists of only 1 table, with about 18 columns. All of them having information about the members(personal detail), their address, and job detail. I exported the database to Oracle with some effort, but I do not know how to divide this big table to 3 smaller ones. Here is the main table:
ID VARCHAR2(500),
NAME VARCHAR2(500),
ADDR VARCHAR2(500),
AREA_CODE VARCHAR2(500),
TEL VARCHAR2(100),
AINS VARCHAR2(100),
YEARPASS VARCHAR2(100),
CENTRE VARCHAR2(500),
DOP VARCHAR2(100),
DUES VARCHAR2(100),
DIPNO VARCHAR2(100),
CODE VARCHAR2(100),
DEPT VARCHAR2(100),
DOB VARCHAR2(100),
GENDER VARCHAR2(100),
EMAIL VARCHAR2(100),
RELIGION VARCHAR2(100),
FAX VARCHAR2(100),
FOREIGN VARCHAR2(100),
MEM_ID NUMBER
I have designed the children tables as follows. They will also use lookup tables, for National ID, Department etc.
CREATE TABLE PERSONNEL (
ID NUMBER,
MEM_NO VARCHAR2(50),
NAME VARCHAR2(50),
TEL VARCHAR2(50),
GENDER NUMBER,
ADDRESS VARCHAR2(500),
AREA NUMBER,
DOB DATE,
EMAIL VARCHAR2(50),
RELIGION NUMBER,
FAX VARCHAR2(50)
)
CREATE TABLE professional_detail(
Id NUMBER,
Ains NUMBER,
Year pass NUMBER,
Centre NUMBER,
Dipno VARCHAR2(30),
Code NUMBER,
Dept NUMBER
)
CREATE TABLE ACCOUNT_INFO(
ID NUMBER,
DUE VARCHAR2(10),
DOP DATE
)
Problem is that some of the columns in the big table is NULL and almost all of them do not follow any typical rule. I tried to create a procedure just to handle them but it seems to be a very ugly routine, to add all these (53,000) records by just hand coding. Even when I do so, the NULL values seem to cause a lot of trouble. The insertion does not work at all. Please help.
