Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. create database mydb;
  2. use mydb;
  3.  
  4. insert into category(category_name,category_desc) values('Beauty, health and wellness', 'This is a description about bhw');
  5. insert into category(category_name,category_desc) values('Food and drinks', 'This is a description about fd');
  6. insert into category(category_name,category_desc) values('Travels', 'This is a description about travels');
  7. insert into category(category_name,category_desc) values('Fashion', 'This is a description about fashion');
  8. insert into category(category_name,category_desc) values('Other', 'This is a description about other');
  9.  
  10. insert into seller values(1,'Mateja', 'Stefanovic', 'matke', 'matke', 'matke88@gmail.com', '0659213380');
  11. insert into seller values(2,'Petar', 'Mikic', 'mika', 'mika', 'mika@bgwellness.com', '0613388000');
  12. insert into seller values(3, 'Mirjana' , 'Spremic' , 'mira', 'mira', 'mira@moda.rs', '0670011304');
  13.  
  14.  
  15. insert into offer(offer_active,offer_created_date, offer_description, offer_expiration_date,
  16. offer_max_offers, offer_name, offer_purchased_offers, offer_regular_price, offer_sale_price, offer_valid_from, offer_valid_to, category_id, seller_id, cDate, eDate, vfDate, vtDate)
  17.  
  18. values(true,NOW(), 'Chicken with peanut and vegetables 250 din instead 440 din, 2 for 400 din', NOW() + INTERVAL 5 DAY,
  19. 5, 'Chicken with peanut and vegetables 250 din instead 440 din', 0, 440, 250, NOW() + INTERVAL 10 DAY, NOW() + INTERVAL 30 DAY,2,1,null,null,null,null),
  20.  
  21. (true,NOW(), 'Chicken with bamboo and brocolli 220 din instead 450 din, 2 for 380 din', NOW() + INTERVAL 6 DAY,
  22. 10, 'Chicken with bamboo and brocolli 220 din instead 450 din', 0, 450, 220, NOW() + INTERVAL 12 DAY, NOW() + INTERVAL 32 DAY,2,1,null,null,null,null),
  23.  
  24. (true,NOW(), 'Imperial chicken only 300 din instead 600 din, 2 for 700 din', NOW() + INTERVAL 8 DAY,
  25. 30, 'Imperial chicken only 300 din instead 600 din', 0, 600,300, NOW() + INTERVAL 10 DAY, NOW() + INTERVAL 40 DAY,2,1,null,null,null,null),
  26.  
  27. (true,NOW(), '4609 din for night, jakuzzi, champagne and 2 massages (60 min)', NOW() + INTERVAL 6 DAY,
  28. 8, '4609 din for night, jakuzzi, champagne and 2 massages', 0,9000, 4690, NOW() + INTERVAL 10 DAY, NOW() + INTERVAL 40 DAY,1,2,null,null,null,null),
  29.  
  30. (true,NOW(), 'Trip to Krakow', NOW() + INTERVAL 6 DAY,
  31. 8, 'Trip to krakov (bus plus 2 nights)', 0, 12000, 6000 , NOW() + INTERVAL 10 DAY, NOW() + INTERVAL 40 DAY,3,2,null,null,null,null),
  32.  
  33. (true,NOW(), 'Trip to London', NOW() + INTERVAL 6 DAY,
  34. 2, 'Trip to krakov (bus plus 3 nights)', 0,12000, 6300, NOW() + INTERVAL 10 DAY, NOW() + INTERVAL 40 DAY,3,2,null,null,null,null),
  35.  
  36. (true,NOW(), 'Trip to Amsterdam', NOW() + INTERVAL 6 DAY,
  37. 2, 'Trip to Amsterdam (bus plus 3 nights)', 0, 20000, 16300, NOW() + INTERVAL 10 DAY, NOW() + INTERVAL 40 DAY,3,2,null,null,null,null),
  38.  
  39.  
  40. (true,NOW(), 'Trip to Paradise for small amount of money', NOW() + INTERVAL 6 DAY,
  41. 11, 'Trip to Paradise (bus plus 3 nights)', 0, 600000,300000, NOW() + INTERVAL 10 DAY, NOW() + INTERVAL 40 DAY,3,2,null,null,null,null),
  42.  
  43. (true,NOW(), 'Trip to India for small amount of money', NOW() + INTERVAL 6 DAY,
  44. 31, 'Trip to India (bus plus 3 nights)', 0, 60000 , 30000, NOW() + INTERVAL 10 DAY, NOW() + INTERVAL 40 DAY,3,2,null,null,null,null);
  45.  
  46. insert into comment values(1, 'Ovo je proba za komentar',1,1);
  47. insert into comment values(2, 'Ovo je prvi komentar',1,1);
  48. insert into comment values(3, 'Ovo je drugi komentar',1,1);
  49. insert into comment values(4, 'Almost 1 million listeners for CHAPEAU CLAQUE & Pretty Pink - Schöner Moment @ La Belle Musique smile emoticon thank you for this great support ',1,1);
  50. insert into comment values(5, 'Ne čeka te večera posle radnog dana, sama spremaš? Koleginice, svaka čast... ',1,1);
  51.  
  52. insert into admin values(1,'admin','admin','admin','admin');
  53. insert into buyer values(1,'branko', 'gvoka', 'bane', 'bane', 'tralala', 'bane92ru@gmail.com' , 'kao neka ulica');
  54.  
  55. insert into branch values (1, 'Bulevar Vojvode Stepe br 18, Novi Sad', 'Kinezi 88', '0699333292',1);
  56. insert into branch values (2, 'Mise Dimitrijevica br 33, Novi Sad', 'Kinezi 888', '0699333294',1);
  57. insert into branch values (3, 'Kralja Petra br 111, Beograd', 'Kinezi 88Plus', '0699333252',1);
  58.  
  59. select c.* from category c inner join offer o where c.category_name like 3 and o.offer_active is true;
  60. select * from offer o where o.category_id = 3 and o.offer_active is true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement