Question

In: Computer Science

Database design of cothing Online Shopping System. Schema represents minimal information required to store information of...

Database design of cothing Online Shopping System. Schema represents minimal information required to store information of a shop and products to sell. Cart information can be stored in session or if wish-list / watchlist is needed, the schema can be simply extended. Enjoy. SQL and methodology.

Solutions

Expert Solution

Requirements:

users – shop admin, owner and customers
products – products to sell
categories - category of products. eg. laptops, phones etc
orders – customer placed a order
order_details – order always won't have a single item. store details here.
sales – order is sold.
contact – when customers / visitors contact shop owner

Install XAMPP or WAMP and go to your localhost and then phpmyadmin to create database.

In users table ->

user_ID INT(11)

firstname VARCHAR(255)

middlename VARCHAR(255)

lastname VARCHAR(255)

email VARCHAR(255)

password VARCHAR(255)

address VARCHAR(255)

phone VARCHAR(255)

pincode INT(11)

type VARCHAR(255)

created_at INT(11)

In products table ->

product_ID INT(11)

name VARCHAR(255)

description VARCHAR(255)

category_ID INT(11)

image VARCHAR(255)

quantity VARCHAR(255)

brand VARCHAR(255)

model VARCHAR(255)

configuration VARCHAR(255)

price VARCHAR(255)

featured INT(11)

created_at INT(11)

In category table ->

id INT(11)

name VARCHAR(255)

details VARCHAR(255)

In contact table ->

contact_ID INT(11)

firstname VARCHAR(255)

middlename VARCHAR(255)

lastname VARCHAR(255)

email VARCHAR(255)

message VARCHAR(255)

created_at INT(11)

In orders table ->

order_ID INT(11)

user_ID INT(11)

shipping_address VARCHAR(255)

shipping_date INT(11)

shipping_status VARCHAR(255)

created_at INT(11)

In order details table ->

order_details_id INT(11)

order_id INT(11)

product_id INT(11)

quantity INT(11)

In sales table ->

sales_id INT(11)

order_id INT(11)

sales_amount INT(11)

created_at INT(11)

CREATE TABLE IF NOT EXISTS `category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`details` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `category`
--
INSERT INTO `category` (`id`, `name`, `details`) VALUES
(1, 'laptops', 'laptops lorem ipsum'),
(2, 'phones', 'phones details'),
(3, 'tablets', 'tablets details');
-- --------------------------------------------------------
--
-- Table structure for table `contact`
--
CREATE TABLE IF NOT EXISTS `contact` (
`contact_id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(255) NOT NULL,
`middlename` varchar(255) DEFAULT NULL,
`lastname` varchar(255) NOT NULL,
`emai` varchar(255) NOT NULL,
`message` varchar(255) NOT NULL,
`created_at` int(11) NOT NULL,
PRIMARY KEY (`contact_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `contact`
--

-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE IF NOT EXISTS `orders` (
`order_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`shiping_address` varchar(255) DEFAULT NULL,
`shiping_date` int(11) DEFAULT NULL,
`shipping_status` varchar(255) DEFAULT NULL,
`created_at` int(11) NOT NULL,
PRIMARY KEY (`order_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `orders`
--

-- --------------------------------------------------------
--
-- Table structure for table `order_details`
--
CREATE TABLE IF NOT EXISTS `order_details` (
`order_details_id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
PRIMARY KEY (`order_details_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `order_details`
--

-- --------------------------------------------------------
--
-- Table structure for table `products`
--
CREATE TABLE IF NOT EXISTS `products` (
`product_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` text NOT NULL,
`image` varchar(255) NOT NULL,
`category_id` int(11) NOT NULL,
`quantity` varchar(255) NOT NULL,
`brand` varchar(255) DEFAULT NULL,
`model` varchar(255) DEFAULT NULL,
`configuration` varchar(255) DEFAULT NULL,
`price` varchar(255) NOT NULL,
`featured` int(11) NOT NULL,
`created_at` int(11) NOT NULL,
PRIMARY KEY (`product_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `products`
--

-- --------------------------------------------------------
--
-- Table structure for table `sales`
--
CREATE TABLE IF NOT EXISTS `sales` (
`sales_id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL,
`sales_amount` int(11) NOT NULL,
`created_at` int(11) NOT NULL,
PRIMARY KEY (`sales_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `sales`
--

-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(255) NOT NULL,
`middlename` varchar(255) DEFAULT NULL,
`lastname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`created_at` int(11) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `users`


Related Solutions

Need an example of a database schema for an online or ecommerce store and an explanation...
Need an example of a database schema for an online or ecommerce store and an explanation of the how it functions
draw traceability matrix for online shopping system ( online grocery store)
draw traceability matrix for online shopping system ( online grocery store)
1. Discuss the elements of a database system. Like The database schema Schema objects Indexes Tables...
1. Discuss the elements of a database system. Like The database schema Schema objects Indexes Tables Fields and columns Records and rows Keys Relationships Data types 2. Discuss the key components of a database management system architecture and how they collaborate. 3. Discuss why a database management system needs a good query optimizer.
To complete this task you are required to design an information system for Fashion clothing store...
To complete this task you are required to design an information system for Fashion clothing store to assist with their business. You have discussed Porter’s Value Chain in class and you should understand the Primary and support activities within businesses. For this task you need to concentrate on Marketing and Sales only. The development of your professional skills includes researching information systems to assist with organisational issues that are encountered in contemporary business. You will be learning important ‘agile’ skills...
Consider the following information to design a database for a catalogue of an online video service...
Consider the following information to design a database for a catalogue of an online video service that offers access to popular TV series. The following is the description of the application: Each series has a name and a description. Each series has many episodes. Each episode of a series has an episode number, the date it was first aired, and the length of the episode in minutes. The episode number uniquely identifies an episode with respect to the series, but...
Listed below is the relational database schema for an online store(SQL/Java): MEMBER(last_name, first_name, email, password, user,street,...
Listed below is the relational database schema for an online store(SQL/Java): MEMBER(last_name, first_name, email, password, user,street, city, state, zip, card_type, card_no, expiration, name_on_card) book_SALE(listing_no, seller, isbn, condition, price) ORDERS(order_no, buyer, order_date, tot) ITEM(order_no, listing_no) BOOK(isbn, title, author, edition, publisher, keywords) The bold attribute(s) in a relation is the primary key of that relation. The italized attributes in some relations denote foreign keys. The seller attribute in the book_SALE relation is a foreign key to the user attribute in the MEMBER...
Listed below is the relational database schema for an online store(SQL/Java): MEMBER(last_name, first_name, email, password, user,street,...
Listed below is the relational database schema for an online store(SQL/Java): MEMBER(last_name, first_name, email, password, user,street, city, state, zip, card_type, card_no, expiration, name_on_card) book_SALE(listing_no, seller, isbn, condition, price) ORDERS(order_no, buyer, order_date, tot) ITEMS(order_no, listing_no) BOOK(isbn, title, author, edition, publisher, keywords) The bold attribute(s) in a relation is the primary key of that relation. The italized attributes in some relations denote foreign keys. Create/Define the table.
Discuss the three-schema architecture and its benefits for database development and design.
Discuss the three-schema architecture and its benefits for database development and design.
Design a survey questionnaire that gather information on who, when, and how individuals use online shopping....
Design a survey questionnaire that gather information on who, when, and how individuals use online shopping. Ask 20 questions that provide quantity, frequency and reasons for their use, which will help you analyze the impact of online commerce on transportation and urban development.
Case: A national football association needs to design a database to store information about all the...
Case: A national football association needs to design a database to store information about all the players (identified by pid, with DOB, position and salary as attributes) registered under it, all the football clubs (identified by name, with city and asset as attributes) in the nation, and the stakeholders of each club (with name, age and percentage of holdings). Each player plays for one club, and each club has a captain player. Each stakeholder can only hold the shares of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT