plus2net Home
HOME
PHP
JavaScript
HTML
Python
ASP
jQuery
C
PhotoShop
SQL
SQL Home
Database Basic
PHP MySQL
Date
Math
Select
Insert
Delete
Left Join
String
Search
Login
×
Login
Username
Password
Login
Contact Us
products sales and customers SQL dump ( Sample )
Copy to clipboard
CREATE TABLE IF NOT EXISTS `customers_v2` ( `c_id` int(1) DEFAULT NULL, `customer` varchar(4) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `customers_v2` -- INSERT INTO `customers_v2` (`c_id`, `customer`) VALUES (1, 'Rabi'), (2, 'Raju'), (3, 'Alex'), (4, 'Rani'), (5, 'King'), (7, 'Ronn'), (8, 'Jem'), (9, 'Tom'); -- -------------------------------------------------------- -- -- Table structure for table `products_v2` -- CREATE TABLE IF NOT EXISTS `products_v2` ( `p_id` int(1) DEFAULT NULL, `product` varchar(12) DEFAULT NULL, `price` int(2) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `products_v2` -- INSERT INTO `products_v2` (`p_id`, `product`, `price`) VALUES (1, 'Hard Disk', 80), (2, 'RAM', 90), (3, 'Monitor', 75), (4, 'CPU', 55), (5, 'Keyboard', 20), (6, 'Mouse', 10), (7, 'Motherboard', 50), (8, 'Power supply', 20); -- -------------------------------------------------------- -- -- Table structure for table `sales_v2` -- CREATE TABLE IF NOT EXISTS `sales_v2` ( `sale_id` int(1) DEFAULT NULL, `c_id` int(1) DEFAULT NULL, `p_id` int(1) DEFAULT NULL, `product` varchar(7) DEFAULT NULL, `qty` int(1) DEFAULT NULL, `store` varchar(3) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `sales_v2` -- INSERT INTO `sales_v2` (`sale_id`, `c_id`, `p_id`, `product`, `qty`, `store`) VALUES (1, 2, 3, 'Monitor', 2, 'ABC'), (2, 2, 4, 'CPU', 1, 'DEF'), (3, 1, 3, 'Monitor', 3, 'ABC'), (4, 4, 2, 'RAM', 2, 'DEF'), (5, 2, 3, 'Monitor', 3, 'ABC'), (6, 3, 3, 'Monitor', 2, 'DEF'), (7, 2, 2, 'RAM', 3, 'ABC'), (8, 3, 2, 'RAM', 2, 'DEF'), (9, 2, 3, 'Monitor', 2, 'ABC'), (10, 10, 20, 'USB', 2, 'ABC'), (11, 10, 21, 'pendriv', 1, 'DEF'), (12, 11, 22, 'Cable', 3, 'DEF');
«
SQL Inner Join
RIGHT JOIN
→
«
SQL
This article is written by
plus2net.com
team.
Be the first to post comment:
plus2net.com
▼ More on Math functions in SQL
Math functions used in SQL
avg:Getting average of data in MySQL
sum:Sum of a range of data in MySQL
sum of multiple columns in MySQL & to get Percentage and total
min:Getting the Minimum value of data in MySQL
max:Getting the Miximum value of data in MySQL
mod:Getting the reminder of a division by using Mod function
Getting second highest number from the student table
format: Formatting MySQL data in a query while managing records of a table
floor: MySQL function to get highest integer lower than the input value
ceil: MySQL function to get lowest integer higher than the input value
abs: MySQL abs function to get absolute value
round: MySQL round function to get rounded value from column
conv: MySQL conv to convert numbers from one base to other
truncate: MySQL truncate function to remove decimal places
sqrt: square root of number by sqrt function
pow: Power of a number pow function
Post your comments , suggestion , error , requirements etc here
Detail
Queries
INSERT
UPDATE
Aggregate Queries
AVG ( Average )
SUM
MIN
MAX
SQL Video Tutorials
SQL Exercise
✖
We use cookies to improve your browsing experience. .
Learn more
HTML
MySQL
PHP
JavaScript
ASP
Photoshop
Articles
FORUM
.
Contact us
©
2000-2021
plus2net.com
All rights reserved worldwide
Privacy Policy
Disclaimer