B2C e-commerce website database

Source: Internet
Author: User

Create Database b2cshopdb

Use b2cshopdb

Create Table users
(
Userid int identity (1, 1) primary key,
Username varchar (32 ),
Password varchar (32 ),
Address varchar (200 ),
Telephone varchar (12 ),
Email varchar (30 ),
State int
)
Go
Select * from users

Insert into users (username, password, address, telephone, email, state) values ('admin', 'admin', 'address', '123', 'long11310 @ 163.com ', '1 ')

Create Table companys
(
Companyid int identity (1, 1) primary key,
Name varchar (32 ),
December varchar (1000 ),
Address varchar (200 ),
Telephone varchar (20 ),
Email varchar (50 ),
)
Go

Insert into companys (name, decimal, address, telephone, email) values ('Company name', 'Company introduction', 'Company address', '123 ', 'gongsi @ 163.com ')

Select * From companys
Go

Create Table categorys
(
Categoryid int identity (1, 1) primary key,
Description varchar (100 ),
)
Go

Insert into categorys (description) values ('Type details description ')
Insert into categorys (description) values ('Type description 2 ')
Go

Select * From categorys

Create Table Products
(
Productid int identity (1, 1) primary key,
Description varchar (2000 ),
Pictureid int,
Companyid int,
Categoryid int,
Quantity int,
Price money,
Pubdate datetime default (getdate ()),
Details1 text,
Details2 text,
Details3 text,
Details4 text,
Details5 text,
)
Go

Insert into products (description, pictureid, companyid, categoryid, quantity, price, details1, details2, details3, details4, details5) values ('item description name', '1 ', '1', '1', '000000', 200, 'commodity detailed attribute description', 'commodity detailed attribute description2', 'commodity detailed attribute description ', 'item details attribute description 4', 'item details attribute description 5 ')
Insert into products (description, pictureid, companyid, categoryid, quantity, price, details1, details2, details3, details4, details5) values ('item description name 2', '2 ', '1', '1', '000000', 400, 'item detailed attribute description 1-2 ', 'item detailed attribute description 2-2', 'item detailed attribute description 3-2 ', 'product details attributes 4-2 ', 'product details attributes 5-2 ')
Go

Select * from products
Go

Create Table shopcarts
(
Shopcartid int identity (1, 1) primary key,
Userid int,
Pubdate datetime default (getdate ()),
Totalnum int,
Totalprice int,
)
Go

Insert into shopcarts (userid, totalnum, totalprice) values ('1', '20', '123 ')
Go

Select * From shopcarts
Go

Create Table productcarts
(
Productid int,
Shopcartid int,
Quantity int,
)
Go

Insert into productcarts (productid, shopcartid, quantity) values ('1', '1', '20 ')
Go

Select * From productcarts
Go

 

Create Table pictures
(
Pictureid int identity (1, 1) primary key,
Title varchar (50 ),
Pictureurl varchar (100 ),
)
Go

Insert into pictures (title, pictureurl) values ('image description', 'pic/1.jpg ')
Insert into pictures (title, pictureurl) values ('image description 2', 'pic/2.jpg ')
Go
Go

Select * from pictures
Go

Create Table Admin

(
Adminid int identity (1, 1) primary key,
Username varchar (32 ),
Password varchar (32 ),
State int,
)

Insert into admin (username, password, state) values ('admin', 'admin', '2 ')

Select * from Admin

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.