Migrate MySQL to Oracle - Tutorial Step 3

 

Step 3

Login to Oracle database and create a table by name "orders" with same structure as in MySQL by taking appropriate datatypes and widths. i.e. if the datatype is INTEGER in MySQL it should be NUMBER in Oracle, if it's Varchar in MySQL we should take it as Varchar2 in Oracle and so on.

So the create table command we need to issue in Oracle should be like this

CREATE TABLE orders (
OrderID NUMBER(11) NOT NULL,
CustomerID VARCHAR2(5),
EmployeeID NUMBER(11) ,
OrderDate DATE ,
RequiredDate DATE ,
ShippedDate DATE ,
ShipVia NUMBER(11) ,
Freight NUMBER,
ShipName VARCHAR2(40) ,
ShipAddress VARCHAR2(60) ,
ShipCity VARCHAR2(15) ,
ShipRegion VARCHAR2(15) ,
ShipPostalCode VARCHAR2(10) ,
ShipCountry VARCHAR2(15))

create table in oracle

 

next step

New: Modern Oracle

Concepts here also apply to Oracle 19c/21c/23ai unless a version note says otherwise. See the homepage for what's changed.