Importing Customer and Order Data

Create Schema

Syntax:

CREATE SCHEMA $SchemaName$;

Tasks :

  1. Replace $SchemaName$ with an appropriate schema name

Create Table's

  1. Create the customer table by executing the SQL below:
    1. Replace $schema_name with the name chosen above
CREATE TABLE $schema_name.customer (
	customer_id INTEGER,
	customer_name TEXT,
	email TEXT,
	phone_number TEXT,
	address_line_1 TEXT,
	city TEXT
);
  1. Create the orders table by executing the SQL below:
    1. Replace $schema_name with the name chosen above
CREATE TABLE $schema_name.orders (
	order_id INTEGER,
	customer_id INTEGER,
	order_date TEXT,
	total_amount REAL,
	order_status_id INTEGER
);

Insert Data

  1. Once the tables have been created you can insert the data by going to table editor

image.png

  1. finding the schema and table and import from csv - drag and drop the relevant file

image.png

Querying Customer and Order Data