Ayush Naithani

an anonymous user · September 23, 2022
-- create a table
create table customer_t
(
customer_id int (11,0)not null primary key  , 
customer_names varchar(25) not null,
customer_address varchar(30),
city varchar(20),
state varchar(20),
postalcode varchar(9)
);
create table order_t(
order_id int(11,0)not null primary key ,
"order"date" default system ,
customer_id  numeric(11,0)
order foreign key (customer_id) references customer_t (customer_id) 
);
create table product_t (
product_id integer not null primary key,
product_discriotion varchar(50),
product_finish varchar(20),
standard_price decimal(6,2),
product_line_id integer,
);
create table order_line_t
(
order_id numeric(11,0) primary key,
product_id numeric (11,0) not null ,
ordered_quantity numeric(11,0),
order_line (order_id) foreign key references order_t (order_id),
order_line foreign key (product_id) references product_t (product_id),
order_line foreign key references product_t
);
Output
(Run the program to view its output)

Comments

Please sign up or log in to contribute to the discussion.