Project 1

create t
able Seller (
seller_id int not null,
s_pass varchar (10),
Name varchar (20),
address varchar (20),
primary key (seller_id)
);
create table seller_phone_num(
phone_no int not null,
seller_id int not null,
foreign key (seller_id) references Seller (seller_id)
);
create table Cart (
cart_id int not null,
primary key (cart_id)
);
create table Customer (
customer_id int not null,
c_pass varchar (20) not null,
Name Varchar (20) not null,
Address varchar (30) not null,
Phone_no Int not null,
Pincode int not null,
cart_id int not null,
primary key (customer_id),
foreign key (cart_id) references Cart (cart_id)
);
create table payment (
payment_id int not null,
payment_date date,
Total_amount int not null,
customer_id int not null,
cart_id int not null,
primary key (payment_id),
foreign key (customer_id) references Customer (customer_id),
foreign key (cart_id) references Cart (cart_id)
);
create table product(
product_id int not null,
Type int not null,
color varchar (20),
age_group int not null,
size varchar (5),
gender varchar (1),
commission int not null,
cost int not null,
quantity int not null,
seller_id int not null,
primary key (product_id),
foreign key (seller_id) references Seller (seller_id)
);
create table cart_item (
cart_id int not null,
product_id int not null,
quantity_wished int not null,
Date_added date,
purchased varchar (20),
foreign key (cart_id) references Cart (cart_id),
foreign key (product_id) references product (product_id),
primary key (cart_id, product_id)
);
3.
1.select city as City from customer
order by asc
2.select pro_id as Prod_id, type as prod_type , color as Prod_color, P_size as Prod_size, Gender as Pro_Gender, Commission as Prod_comm, Cost as Prod_cost, Quantity as Prod_Quantity from product
3.select * from customer
where like a%a
purchased > 1
4.select * from customer
purchased <= 1
6.create table table_name
insert into table_name (columns names)
value( columns values)
alter table table_name
rename table_name;