Question
Hi i want to achieve this in sql; The most active seller (the one who has offered the most number of items) The most active
Hi i want to achieve this in sql;
The most active seller (the one who has offered the most number of items)
The most active buyer (the one who has bought the most number of items)
The most popular seller (the one who sold the most number of items)
Here is my seller , item, and buyer tables
create table item ( itemID char(5) NOT NULL, itemName varchar(15) NOT NULL, Item_desc varchar(255), Item_initialPrice decimal(8,2), ItemQty int, ownerName varchar(20), PRIMARY KEY (itemID));
create table seller ( sellerID INT IDENTITY(1000,1) NOT NULL, sellerName varchar(20), sellerUserName varchar(20), sellerPassword varchar(32),
item_ID char(5) NOT NULL, contact_ID int NOT NULL,
primary key(sellerID), Foreign Key(item_ID) references item(itemID), Foreign Key(contact_ID) references contactInfo(contactID));
create table buyer ( buyerID INT IDENTITY(1000,1) NOT NULL, buyerName varchar(20), buyerUsername varchar(20), buyerPassowrd varchar(32),
contact_ID int,
primary key(buyerID), Foreign Key(contact_ID) references contactInfo(contactID));
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started