Create a database for a store that sells outdoor camping and sporting goods. The
ID: 3546816 • Letter: C
Question
Create a database for a store that sells outdoor camping and sporting goods. The tables should be as shown. See attached document below for further explanations and examples:
1. Customers: CustID (PK), FName, LName, Address, City, State, zipcode, email.
2. Clothes: ItemNo (primary key), type, label, gender, Color, size
3. Equipment: equipID (PK), type, manufacture, color, material
4. CustomerSales: CustID (FK) and ItemNo (FK)
5. Vendor: VendorID (PK), ItemType (clothes, equipment, etc), address, city, state, zip, phoneNo, email
Explanation / Answer
CREATE DATABASE dbSportsStore;
creating tables :
Use dbSportsStore
CREATE TABLE clothes
(
ItemNo integer(10) primary key,
Type varchar(100),
label varchar(100),
gender varchar(1),
color varchar(100),
size varchar(100),
);
CREATE TABLE Customers
(
CustID integer(10) primary key,
FName varchar(100),
Lname varchar(100),
Address varchar(255),
city varchar(100),
state varchar(100),
Zipcode integer(10),
email varchar(50)
);
CREATE TABLE eqiuipment
(
eqipmentID integer(10) primary key,
type varchar(100),
manufacture varchar(100),
color varchar(255),
material varchar(100)
);
CREATE TABLE customersales
(
CustID integer(10) not null,
ItemNo integer(10) not null,
FOREIGN KEY (CustID ) REFERENCES Customers(CustID ),
FOREIGN KEY (ItemNo ) REFERENCES clothes(ItemNo)
)
VendorID (PK), ItemType (clothes, equipment, etc), address, city, state, zip, phoneNo, email
CREATE TABLE Vendor
(
VendorId integer(10) primary key,
ItemType varchar(100),
address varchar(100),
city varchar(100),
state varchar(100),
Zipcode integer(10),
phone ineteger(10),
email varchar(50)
);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.