Skip to content

Instantly share code, notes, and snippets.

@gopinath6
Last active August 24, 2019 09:26
Show Gist options
  • Save gopinath6/b052eed03e34f94b77aee47f3d69e1af to your computer and use it in GitHub Desktop.
Save gopinath6/b052eed03e34f94b77aee47f3d69e1af to your computer and use it in GitHub Desktop.
Bulb: https://images-na.ssl-images-amazon.com/images/I/51mhtAibkwL._SL1500_.jpg
Pipe: https://5.imimg.com/data5/FY/EL/MY-4600740/heavy-duty-industrial-pvc-pipe-500x500.jpg
WIre: https://quinled.info/wp-content/uploads/2018/10/cabkethickness-1.jpg
Brick: https://images.homedepot-static.com/productImages/21bd11f8-81e9-4ea6-a9c8-cba1ed8119e7/svn/bricks-red0126mco-64_1000.jpg
--------DB Strcture-------------
CREATE TABLE T_Merchant_details
(
mid int primary key NOT NULL,
mname char(50) ,
mphone int,
mshopaddress char(50) ,
mshoppingpincode int ,
mshopname char(50)
);
CREATE TABLE T_Merchant_shop_items
(
Iid int primary key NOT NULL,
price int,
mid char(50) ,
item char(50) ,
cid int ,
isearch char(50)
);
CREATE TABLE T_category
(
cid int primary key NOT NULL,
category char(50)
);
--------DB Strcture-------------
--------------Insert query----------
INSERT INTO T_Merchant_details (
mid,mname, mphone, mshopaddress, mshoppingpincode, mshopname)
VALUES (100,'Prakash', 123 ,'403,northcross street,barath nagar,sholinganallur',600119,'Barath Hardwares');
INSERT INTO T_category(cid,category ) VALUES (1, "construction");
INSERT INTO T_category(cid,category ) VALUES (2, "electrical");
INSERT INTO T_category(cid,category ) VALUES (3, "plumbing");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (1, 100, 100, "lock", 1, "steel");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (2, 100, 50, "key", 1, "steel");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (3, 100, 200,"2waytap", 3, "steel");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (4, 100, 1500, "hosepipe", 3, "plastic");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (5, 100, 1050, "stool", 1, "wood");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (6, 100, 130, "plugpoint", 2, "plastic");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (7, 100, 400, "door", 1, "home");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (8, 100, 500, "window", 1, "wood");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (9, 100, 650,"bricks", 1, "sand");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (10, 100, 1220, "bell", 2, "steel");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (11, 100, 200, "doorhandle", 1, "steel");
INSERT INTO T_Merchant_shop_items(Iid,mid, price,item,cid,isearch) VALUES (12, 100, 80, "2wayswitch", 2, "plastic");
---------JSON-----
[
{
"Iid" : 1,
"price" : 100,
"mid" : "100",
"item" : "lock",
"cid" : 1,
"isearch" : "steel"
},
{
"Iid" : 2,
"price" : 50,
"mid" : "100",
"item" : "key",
"cid" : 1,
"isearch" : "steel"
},
{
"Iid" : 3,
"price" : 200,
"mid" : "100",
"item" : "2waytap",
"cid" : 3,
"isearch" : "steel"
},
{
"Iid" : 4,
"price" : 1500,
"mid" : "100",
"item" : "hosepipe",
"cid" : 3,
"isearch" : "plastic"
},
{
"Iid" : 5,
"price" : 1050,
"mid" : "100",
"item" : "stool",
"cid" : 1,
"isearch" : "wood"
},
{
"Iid" : 6,
"price" : 130,
"mid" : "100",
"item" : "plugpoint",
"cid" : 2,
"isearch" : "plastic"
},
{
"Iid" : 7,
"price" : 400,
"mid" : "100",
"item" : "door",
"cid" : 1,
"isearch" : "home"
},
{
"Iid" : 8,
"price" : 500,
"mid" : "100",
"item" : "window",
"cid" : 1,
"isearch" : "wood"
},
{
"Iid" : 9,
"price" : 650,
"mid" : "100",
"item" : "bricks",
"cid" : 1,
"isearch" : "sand"
},
{
"Iid" : 10,
"price" : 1220,
"mid" : "100",
"item" : "bell",
"cid" : 2,
"isearch" : "steel"
},
{
"Iid" : 11,
"price" : 200,
"mid" : "100",
"item" : "doorhandle",
"cid" : 1,
"isearch" : "steel"
},
{
"Iid" : 12,
"price" : 80,
"mid" : "100",
"item" : "2wayswitch",
"cid" : 2,
"isearch" : "plastic"
}
]
-------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment