{"id":2151,"date":"2020-10-29T07:00:00","date_gmt":"2020-10-29T04:00:00","guid":{"rendered":"https:\/\/www.dataplatform.gr\/?p=2151"},"modified":"2024-07-01T17:51:55","modified_gmt":"2024-07-01T14:51:55","slug":"pos-mporoyme-na-vroyme-ta-asfalistra-t","status":"publish","type":"post","link":"https:\/\/www.dataplatform.gr\/en\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/","title":{"rendered":"How can we calculate our car insurance premiums in SQL Server using Python (no API)"},"content":{"rendered":"<p>Let&#039;s say we have in <strong>SQL Server <\/strong>a table of cars and drivers and we want to find their cheapest premium. This will certainly be possible with one <strong>API <\/strong>\/ <strong>Web Service<\/strong>. However, this solution would require the cooperation of the IT departments (between the insurance company and ours) in its creation and use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u03c4\u03b9-\u03b1\u03ba\u03c1\u03b9\u03b2\u03ce\u03c2-\u03b8\u03ad\u03bb\u03bf\u03c5\u03bc\u03b5-\u03bd\u03b1-\u03c0\u03b5\u03c4\u03cd\u03c7\u03bf\u03c5\u03bc\u03b5\">What exactly do we want to achieve?<\/h3>\n\n\n\n<p>In short we want to have a table in the database like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"127\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-01.png\" alt=\"\" class=\"wp-image-2152\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-01.png 755w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-01-300x50.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/figure>\n\n\n\n<p>Fill in the premium price and it should look something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"758\" height=\"126\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-05.png\" alt=\"\" class=\"wp-image-2156\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-05.png 758w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-05-300x50.png 300w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9-\u03ac\u03bb\u03bb\u03b7-\u03bb\u03cd\u03c3\u03b7\">Is there another solution?<\/h2>\n\n\n\n<p>Obviously, for the article to exist, there is also the way \ud83d\ude42 . <\/p>\n\n\n\n<p>Using the library <strong>selenium <\/strong>and <strong>pyodbc <\/strong>her <strong>Python <\/strong>we can essentially copy the human movements we would do in his browser <strong>Chrome <\/strong>so that we can calculate the premiums and update the field in each database record.<\/p>\n\n\n\n<p>We had seen a similar solution in <a href=\"https:\/\/www.dataplatform.gr\/en\/pos-mporoyme-na-kanoyme-metafrasi-ped\/\" target=\"_blank\" rel=\"noreferrer noopener\">this<\/a> the article to translate fields from English to Greek.<\/p>\n\n\n\n<p>In our example I will use a random insurance company site that has a calculator. I will not mention it since the article exists for educational purposes only.<\/p>\n\n\n\n<p>The site we will use has this format. Several fields are needed for pricing, some of them are dropdowns and at the end there is also the calculation button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"937\" height=\"523\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-02.png\" alt=\"\" class=\"wp-image-2153\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-02.png 937w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-02-300x167.png 300w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-02-768x429.png 768w\" sizes=\"auto, (max-width: 937px) 100vw, 937px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"requirements\">Prerequisites<\/h3>\n\n\n\n<p>We should download the corresponding version that is our chrome  <a href=\"http:\/\/chromedriver.chromium.org\/downloads?tmpl=%2Fsystem%2Fapp%2Ftemplates%2Fprint%2F&amp;showPrintDialog=1\">Chromedriver<\/a>.<\/p>\n\n\n\n<p>In the command prompt, install python with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>cmd python<\/code><\/pre>\n\n\n\n<p>In the command prompt we run these commands to install the modules we need:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">pip install \u2013U selenium\n\npip install pyodbc<\/pre>\n\n\n\n<p>We will also need a database user who has rights to this table.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u03b7-\u03c0\u03c1\u03bf\u03b5\u03c4\u03bf\u03b9\u03bc\u03b1\u03c3\u03af\u03b1-\u03c3\u03c4\u03bf\u03bd-\u03c0\u03b9\u03bd\u03b1\u03ba\u03ac\u03c2-\u03bc\u03b1\u03c2\">The preparation on our table<\/h3>\n\n\n\n<p>We will now make one <strong>staging table <\/strong>which could be populated with values from other tables present in the base.<\/p>\n\n\n\n<p>As we saw on the site <strong>dropdown <\/strong>menus only work with default values we should convert our data to these values:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">create table car_calc(\nid int identity(1,1) primary key,\ninsurance varchar(10) default null,\nbirth_d varchar(10),\nbirth_m varchar(10),\nbirth_y varchar(10),\nemail varchar(50),\nplate varchar(10),\nplate2 varchar(10),\ncc varchar(10),\nvalue varchar(10),\ntk varchar(10),\ndmg varchar(10) default '0',\nduration varchar(10) default '6 \u03bc\u03ae\u03bd\u03b5\u03c2',\ncar_age varchar(10),\nsex varchar(10),\nlicence_age varchar(20))<\/pre>\n\n\n\n<p>Since this is an example and I don&#039;t have any other tables, I will simply insert 3 records, making sure that the fields that are dropdowns have exactly the same text:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">insert into car_calc\n(birth_d,birth_m,birth_y,email,plate,plate2,cc,value,tk,dmg,duration,car_age,sex,licence_age)\nvalues\n('24','01','1990','patatakia@hotmail.com','\u039f\u0395\u0396','5120','1600','2000','15773','2','6 \u03bc\u03ae\u03bd\u03b5\u03c2','5 \u03b5\u03c4\u03ce\u03bd','\u0393\u03c5\u03bd\u03b1\u03af\u03ba\u03b1','3')\n,('15','05','2000','dokimi@hotmail.com','\u039c\u03a5\u0395','2300','1000','4500','81100','0','6 \u03bc\u03ae\u03bd\u03b5\u03c2','2 \u03b5\u03c4\u03ce\u03bd','''\u0391\u03bd\u03b4\u03c1\u03b1\u03c2','8')\n,('12','03','1962','calc@hotmail.com','\u0399\u0391\u0395','3920','2400','15000','15770','1','6 \u03bc\u03ae\u03bd\u03b5\u03c2','3 \u03b5\u03c4\u03ce\u03bd','''\u0391\u03bd\u03b4\u03c1\u03b1\u03c2','7'); \n\nselect * from car_calc;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"127\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-01.png\" alt=\"\" class=\"wp-image-2152\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-01.png 755w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-01-300x50.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u03b7-\u03c0\u03c1\u03bf\u03b5\u03c4\u03bf\u03b9\u03bc\u03b1\u03c3\u03af\u03b1-\u03b3\u03b9\u03b1-\u03c4\u03bf-python-script\">Preparing for the Python script<\/h3>\n\n\n\n<p>The hardest part of the process is this. We will need to keep it from the site <strong>xPath <\/strong>from each box or list that is completed, the button that performs the calculation and finally from the box that will display the results.<\/p>\n\n\n\n<p>Doing <strong>right click<\/strong> to each \u2013 <strong>Inspect <\/strong>&#8211; <strong>Copy <\/strong>&#8211; <strong>Copy xPath<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"327\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-03.png\" alt=\"\" class=\"wp-image-2154\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-03.png 800w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-03-300x123.png 300w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-03-768x314.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"571\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-04.png\" alt=\"\" class=\"wp-image-2155\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-04.png 855w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-04-300x200.png 300w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-04-768x513.png 768w\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" \/><\/figure>\n\n\n\n<p>We keep these values one by one for later use in variables e.g.:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">D_birthbox ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_Day\"]'\n<\/pre>\n\n\n\n<p>For those that have a dropdown, we will need to keep their price <strong>Options <\/strong>appending the list parameter to the end <strong>\/li[@data-val=\u201d%s\u201d]&#039; <\/strong>and in this way with the <strong>% duration_parameter <\/strong>at the end it will take as an option the list the value of this variable:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">duration_select_box_option ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_InsuraceDurationDropDownSelectBoxItOptions\"]\/li[@data-val=\"%s\"]' % duration_parameter<\/pre>\n\n\n\n<p>Also for the <strong>dropdown <\/strong>we will need to keep the <strong>xPath <\/strong>which displays the options to let us choose them. Thus imitating his process <strong>click<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">duration_select_box ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_InsuraceDurationDropDownSelectBoxIt\"]'\n\ndriver.find_element_by_xpath(duration_select_box).click()\ntime.sleep(1);\ndriver.find_element_by_xpath(duration_select_box_option).click()<\/pre>\n\n\n\n<p>Finally, we should not forget to keep it <strong>xPath <\/strong>from the calculation button and the box showing the amount respectively:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">submit_button = '\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_Submit\"]'\n\noutput_box = '\/\/*[@id=\"ResultsTable\"]\/tbody\/tr[20]\/td[2]\/b'<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u03bf-\u03b5\u03c0\u03b5\u03be\u03ae\u03b3\u03b7\u03c3\u03b7-\u03c4\u03bf\u03c5-\u03ba\u03ce\u03b4\u03b9\u03ba\u03b1-\u03b2\u03ae\u03bc\u03b1-\u03b2\u03ae\u03bc\u03b1\">The explanation of the code step by step<\/h3>\n\n\n\n<p>With .get to <strong>webdriver <\/strong>we declare the page that will open to us on <strong>Chrome<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">chromedriver_location = \"C:\\\\Users\\\\smatzouranis\\\\Desktop\\\\python\\\\chromedriver\"\n\ndriver = webdriver.Chrome(chromedriver_location)\n\ndriver.get('https:\/\/www.............\/calculator\/')<\/pre>\n\n\n\n<p>With the module <strong>pyodbc <\/strong>connect to the database:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">conn = pyodbc.connect(\"Driver={SQL Server};\"\n\"Server=SMATZOURANISLP\\SQL19;\"\n\"Database=db_test;\"\n\"username=python;\"\n\"password=python;\"\n\"trusted_connection = yes;\")<\/pre>\n\n\n\n<p>We open one <strong>cursor <\/strong>in which we will have our select query with the data from the database:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">cursor = conn.cursor()\ncursor.execute('select id,birth_d,birth_m,birth_y,email,plate,plate2,cc,value,tk,dmg,duration,car_age,sex,licence_age from car_calc')\nresults = cursor.fetchall()<\/pre>\n\n\n\n<p>Now we can in the results variable we have one <strong>two-dimensional table <\/strong>where results[i][0] as i we define the row of the table and as 0 its first column. E.g. results[0][4] is the email of the first registration. So with one <strong>loop <\/strong>we can pass one by one all the fields in the cells of the site to do the calculation and proceed to the next record.<\/p>\n\n\n\n<p>We assign to a variable the <strong>update statement<\/strong> which will pass to our base the amount of the insurance premium:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">update = \"\"\"update car_calc set insurance=? where id=?\"\"\"<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u03bf-\u03c3\u03c5\u03bd\u03bf\u03bb\u03b9\u03ba\u03cc\u03c2-\u03ba\u03ce\u03b4\u03b9\u03ba\u03b1\u03c2-\u03c4\u03bf\u03c5-python-script\">The overall code of the Python script<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">#python\n\nfrom selenium import webdriver \nfrom selenium.common.exceptions  import StaleElementReferenceException\n\nimport pyodbc,time\n\nchromedriver_location = \"C:\\\\Users\\\\smatzouranis\\\\Desktop\\\\python\\\\chromedriver\"\n\ndriver = webdriver.Chrome(chromedriver_location)\n\ndriver.get('https:\/\/www.............\/calculator\/')\n\nconn = pyodbc.connect(\"Driver={SQL Server};\"\n                        \"Server=SMATZOURANISLP\\SQL19;\"\n                        \"Database=db_test;\"\n                        \"username=python;\"\n                        \"password=python;\"\n                        \"trusted_connection = yes;\")\n\noutput_box = '\/\/*[@id=\"ResultsTable\"]\/tbody\/tr[20]\/td[2]\/b'\ncursor = conn.cursor()\ncursor.execute('select id,birth_d,birth_m,birth_y,email,plate,plate2,cc,value,tk,dmg,duration,car_age,sex,licence_age from car_calc')\nresults = cursor.fetchall()\nprint(results)\nupdate = \"\"\"update car_calc set insurance=? where id=?\"\"\"\n\nfor i in range(len(results)):\n        try:\n\n\n                D_birthbox ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_Day\"]'\n                D_birth_parameter = results[i][1]\n                driver.find_element_by_xpath(D_birthbox).clear()\n                driver.find_element_by_xpath(D_birthbox).send_keys(D_birth_parameter)\n\n                M_birthbox ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_Month\"]'\n                M_birth_parameter = results[i][2]\n                driver.find_element_by_xpath(M_birthbox).clear()\n                driver.find_element_by_xpath(M_birthbox).send_keys(M_birth_parameter)\n\n                Y_birthbox ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_Year\"]'\n                Y_birth_parameter = results[i][3]\n                driver.find_element_by_xpath(Y_birthbox).clear()\n                driver.find_element_by_xpath(Y_birthbox).send_keys(Y_birth_parameter)\n\n                mail_textbox ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_EmailCar\"]'\n                mail_parameter = results[i][4]\n                driver.find_element_by_xpath(mail_textbox).clear()\n                driver.find_element_by_xpath(mail_textbox).send_keys(mail_parameter)\n\n\n                PLATEp1_textbox ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_RegistrationNumber1\"]'\n                PLATEp1_parameter = results[i][5]\n                driver.find_element_by_xpath(PLATEp1_textbox).clear()\n                driver.find_element_by_xpath(PLATEp1_textbox).send_keys(PLATEp1_parameter)\n\n                PLATEp2_textbox ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_RegistrationNumber2\"]'\n                PLATEp2_parameter = results[i][6]\n                driver.find_element_by_xpath(PLATEp2_textbox).clear()\n                driver.find_element_by_xpath(PLATEp2_textbox).send_keys(PLATEp2_parameter)\n\n                CC_textbox = '\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_CC\"]'\n                CC_parameter = results[i][7]\n                driver.find_element_by_xpath(CC_textbox).clear()\n                driver.find_element_by_xpath(CC_textbox).send_keys(CC_parameter)\n\n                value_textbox = '\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_VehicleValue\"]'\n                value_parameter = results[i][8]\n                driver.find_element_by_xpath(value_textbox).clear()\n                driver.find_element_by_xpath(value_textbox).send_keys(value_parameter)\n\n\n                TK_textbox = '\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_ZipCode\"]'\n                TK_parameter = results[i][9]\n                driver.find_element_by_xpath(TK_textbox).clear()\n                driver.find_element_by_xpath(TK_textbox).send_keys(TK_parameter)\n\n\n                dmg_parameter = results[i][10]\n                dmg_select_box_option ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_CrashCountDropDownSelectBoxItOptions\"]\/li[@data-val=\"%s\"]' % dmg_parameter\n                dmg_select_box ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_CrashCountDropDownSelectBoxIt\"]'\n                driver.find_element_by_xpath(dmg_select_box).click()\n                time.sleep(1);\n                driver.find_element_by_xpath(dmg_select_box_option).click()\n\n                \n                duration_parameter = results[i][11]\n                duration_select_box_option ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_InsuraceDurationDropDownSelectBoxItOptions\"]\/li[@data-val=\"%s\"]' % duration_parameter\n                duration_select_box ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_InsuraceDurationDropDownSelectBoxIt\"]'\n                driver.find_element_by_xpath(duration_select_box).click()\n                time.sleep(1);\n                driver.find_element_by_xpath(duration_select_box_option).click()\n\n\n\n                carage_parameter = results[i][12]\n                carage_select_box_option ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_VehicleAgeDropDownSelectBoxItOptions\"]\/li[@data-val=\"%s\"]' % carage_parameter\n                carage_select_box ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_VehicleAgeDropDownSelectBoxItText\"]'\n                driver.find_element_by_xpath(carage_select_box).click()\n                time.sleep(1);\n                driver.find_element_by_xpath(carage_select_box_option).click()\n\n\n                SEX_parameter = results[i][13]\n                SEX_select_box_option ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_SexTypeDropDownSelectBoxItOptions\"]\/li[@data-val=\"%s\"]' % SEX_parameter\n                SEX_select_box ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_SexTypeDropDownSelectBoxIt\"]'\n                driver.find_element_by_xpath(SEX_select_box).click()\n                time.sleep(1);\n                driver.find_element_by_xpath(SEX_select_box_option).click()\n\n                Y_parameter = results[i][14]\n                Y_select_box_option ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_YearsDiplomaDropDownSelectBoxItOptions\"]\/li[@data-val=\"%s\"]' % Y_parameter\n                Y_select_box ='\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_YearsDiplomaDropDownSelectBoxItText\"]'\n                driver.find_element_by_xpath(Y_select_box).click()\n                time.sleep(1);\n                driver.find_element_by_xpath(Y_select_box_option).click()\n\n\n                submit_button = '\/\/*[@id=\"ContentPlaceHolderDefault_MainPlaceHolder_CarCalculator_6_Submit\"]'\n                driver.find_element_by_xpath(submit_button).click()\n\n                time.sleep(4);\n                \n                price = driver.find_element_by_xpath(output_box).text\n                cursor.execute(update,(price,i+1))\n\n                print(driver.find_element_by_xpath(output_box).text)\n                \n        except StaleElementReferenceException:\n                pass\nconn.commit();\ncursor.close();\ndriver.quit;\nconn.close();\nexit();\n<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u03c4\u03bf-\u03b1\u03c0\u03bf\u03c4\u03ad\u03bb\u03b5\u03c3\u03bc\u03b1\">The result<\/h2>\n\n\n\n<p>So running it <strong>Python <\/strong>script we will see that when we select the table it will have for each in the second column <strong>the amount of the premium<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"758\" height=\"126\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-05.png\" alt=\"\" class=\"wp-image-2156\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-05.png 758w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/ci-05-300x50.png 300w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u03b1\u03bd-\u03b8\u03ad\u03bb\u03bf\u03c5\u03bc\u03b5-\u03bd\u03b1-\u03c4\u03bf-\u03b5\u03ba\u03c4\u03b5\u03bb\u03bf\u03cd\u03bc\u03b5-\u03bc\u03ad\u03c3\u03b1-\u03b1\u03c0\u03cc-job-\u03c3\u03c4\u03bf\u03bd-sql-server\">If we want to run it through a job in SQL Server<\/h3>\n\n\n\n<p>We enable the feature on <strong>SQL Server <\/strong>to run direct cmd script:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">exec sp_configure 'show advanced option',1\ngo\nsp_configure 'xp_cmdshell',1\ngo\nreconfigure with override<\/pre>\n\n\n\n<p>In the event that it will be run by <strong>SQL Server Agent<\/strong>. We also create a Job that will contain the full path with the name of the file it will execute:<\/p>\n\n\n\n<p>e.g.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">\"C:\\Users\\smatzouranis\\Desktop\\python\\python_chrome_automation_insurance.py\"<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"794\" height=\"393\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/4-xp.png\" alt=\"\" class=\"wp-image-1038\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/4-xp.png 794w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/4-xp-300x148.png 300w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/4-xp-768x380.png 768w\" sizes=\"auto, (max-width: 794px) 100vw, 794px\" \/><\/figure>\n\n\n\n<p>The job is ready to run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">exec msdb.dbo.sp_start_job 'callPythonw'<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>In closing I should mention that simply by changing the parameters to <strong>pyodbc<\/strong> the script could work on <strong>anyone <\/strong>database compatible with it.<\/p>","protected":false},"excerpt":{"rendered":"<p>Let&#039;s say we have in SQL Server a table of cars and drivers and we want to find their cheapest premium. This will certainly be possible with an API \/ Web Service. However, this solution would require the cooperation of the IT departments (between the insurance company and ours) in the creation and use [...]<\/p>","protected":false},"author":1,"featured_media":703,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,15,14],"tags":[29,23,92,9,6],"class_list":["post-2151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-ms-sqlserver","category-python","tag-databases","tag-microsoft","tag-programming","tag-python","tag-sqlserver"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API) - DataPlatform.gr<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dataplatform.gr\/en\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API) - DataPlatform.gr\" \/>\n<meta property=\"og:description\" content=\"\u0391\u03c2 \u03c0\u03bf\u03cd\u03bc\u03b5 \u03cc\u03c4\u03b9 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03c4\u03bf\u03bd SQL Server \u03ad\u03bd\u03b1\u03bd \u03c0\u03af\u03bd\u03b1\u03ba\u03b1 \u03bc\u03b5 \u03b1\u03c5\u03c4\u03bf\u03ba\u03af\u03bd\u03b7\u03c4\u03b1 \u03ba\u03b1\u03b9 \u03bf\u03b4\u03b7\u03b3\u03bf\u03cd\u03c2 \u03ba\u03b1\u03b9 \u03b8\u03ad\u03bb\u03bf\u03c5\u03bc\u03b5 \u03bd\u03b1 \u03b2\u03c1\u03bf\u03cd\u03bc\u03b5 \u03c4\u03bf \u03c6\u03b8\u03b7\u03bd\u03cc\u03c4\u03b5\u03c1\u03bf \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03bf \u03c4\u03bf\u03c5\u03c2. \u0391\u03c5\u03c4\u03cc \u03c3\u03af\u03b3\u03bf\u03c5\u03c1\u03b1 \u03b8\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b5\u03c6\u03b9\u03ba\u03c4\u03cc \u03bc\u03b5 \u03ad\u03bd\u03b1 API \/ Web Service. \u0397 \u03bb\u03cd\u03c3\u03b7 \u03b1\u03c5\u03c4\u03ae \u03cc\u03bc\u03c9\u03c2 \u03b8\u03b1 \u03b1\u03c0\u03b1\u03b9\u03c4\u03bf\u03cd\u03c3\u03b5 \u03c4\u03b7\u03bd \u03c3\u03c5\u03bd\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03c9\u03bd IT \u03c4\u03bc\u03b7\u03bc\u03ac\u03c4\u03c9\u03bd (\u03bc\u03b5\u03c4\u03b1\u03be\u03cd \u03c4\u03b7\u03c2 \u03b1\u03c3\u03c6\u03b1\u03bb\u03b9\u03c3\u03c4\u03b9\u03ba\u03ae\u03c2 \u03ba\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b4\u03b9\u03ba\u03ae \u03bc\u03b1\u03c2) \u03c3\u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03ba\u03b1\u03b9 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dataplatform.gr\/en\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/\" \/>\n<meta property=\"og:site_name\" content=\"DataPlatform.gr\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dataplatform.gr\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-29T04:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-01T14:51:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver_python.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Stratos Matzouranis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stratos Matzouranis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/\"},\"author\":{\"name\":\"Stratos Matzouranis\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\"},\"headline\":\"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API)\",\"datePublished\":\"2020-10-29T04:00:00+00:00\",\"dateModified\":\"2024-07-01T14:51:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/\"},\"wordCount\":98,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver_python.png\",\"keywords\":[\"Databases\",\"Microsoft\",\"Programming\",\"Python\",\"SQL Server\"],\"articleSection\":[\"Databases\",\"Microsoft SQL Server\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/\",\"name\":\"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API) - DataPlatform.gr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver_python.png\",\"datePublished\":\"2020-10-29T04:00:00+00:00\",\"dateModified\":\"2024-07-01T14:51:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver_python.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver_python.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-vroyme-ta-asfalistra-t\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Microsoft SQL Server\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/ms-sqlserver\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"name\":\"dataplatform.gr - Sky is not the limit!\",\"description\":\"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dataplatform.gr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\",\"name\":\"dataplatform.gr\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"width\":322,\"height\":139,\"caption\":\"dataplatform.gr\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dataplatform.gr\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dataplatform-gr\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\",\"name\":\"Stratos Matzouranis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"caption\":\"Stratos Matzouranis\"},\"sameAs\":[\"https:\\\/\\\/www.dataplatform.gr\"],\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/en\\\/author\\\/stratos-matzouranis\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API) - DataPlatform.gr","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dataplatform.gr\/en\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/","og_locale":"en_US","og_type":"article","og_title":"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API) - DataPlatform.gr","og_description":"\u0391\u03c2 \u03c0\u03bf\u03cd\u03bc\u03b5 \u03cc\u03c4\u03b9 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03c4\u03bf\u03bd SQL Server \u03ad\u03bd\u03b1\u03bd \u03c0\u03af\u03bd\u03b1\u03ba\u03b1 \u03bc\u03b5 \u03b1\u03c5\u03c4\u03bf\u03ba\u03af\u03bd\u03b7\u03c4\u03b1 \u03ba\u03b1\u03b9 \u03bf\u03b4\u03b7\u03b3\u03bf\u03cd\u03c2 \u03ba\u03b1\u03b9 \u03b8\u03ad\u03bb\u03bf\u03c5\u03bc\u03b5 \u03bd\u03b1 \u03b2\u03c1\u03bf\u03cd\u03bc\u03b5 \u03c4\u03bf \u03c6\u03b8\u03b7\u03bd\u03cc\u03c4\u03b5\u03c1\u03bf \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03bf \u03c4\u03bf\u03c5\u03c2. \u0391\u03c5\u03c4\u03cc \u03c3\u03af\u03b3\u03bf\u03c5\u03c1\u03b1 \u03b8\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b5\u03c6\u03b9\u03ba\u03c4\u03cc \u03bc\u03b5 \u03ad\u03bd\u03b1 API \/ Web Service. \u0397 \u03bb\u03cd\u03c3\u03b7 \u03b1\u03c5\u03c4\u03ae \u03cc\u03bc\u03c9\u03c2 \u03b8\u03b1 \u03b1\u03c0\u03b1\u03b9\u03c4\u03bf\u03cd\u03c3\u03b5 \u03c4\u03b7\u03bd \u03c3\u03c5\u03bd\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03c9\u03bd IT \u03c4\u03bc\u03b7\u03bc\u03ac\u03c4\u03c9\u03bd (\u03bc\u03b5\u03c4\u03b1\u03be\u03cd \u03c4\u03b7\u03c2 \u03b1\u03c3\u03c6\u03b1\u03bb\u03b9\u03c3\u03c4\u03b9\u03ba\u03ae\u03c2 \u03ba\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b4\u03b9\u03ba\u03ae \u03bc\u03b1\u03c2) \u03c3\u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03ba\u03b1\u03b9 \u03c4\u03b7 \u03c7\u03c1\u03ae\u03c3\u03b7 [&hellip;]","og_url":"https:\/\/www.dataplatform.gr\/en\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/","og_site_name":"DataPlatform.gr","article_publisher":"https:\/\/www.facebook.com\/dataplatform.gr\/","article_published_time":"2020-10-29T04:00:00+00:00","article_modified_time":"2024-07-01T14:51:55+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver_python.png","type":"image\/png"}],"author":"Stratos Matzouranis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stratos Matzouranis","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/#article","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/"},"author":{"name":"Stratos Matzouranis","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf"},"headline":"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API)","datePublished":"2020-10-29T04:00:00+00:00","dateModified":"2024-07-01T14:51:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/"},"wordCount":98,"commentCount":0,"publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver_python.png","keywords":["Databases","Microsoft","Programming","Python","SQL Server"],"articleSection":["Databases","Microsoft SQL Server","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/","url":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/","name":"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API) - DataPlatform.gr","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/#primaryimage"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver_python.png","datePublished":"2020-10-29T04:00:00+00:00","dateModified":"2024-07-01T14:51:55+00:00","breadcrumb":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/#primaryimage","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver_python.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver_python.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-vroyme-ta-asfalistra-t\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae","item":"https:\/\/www.dataplatform.gr\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/www.dataplatform.gr\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"Microsoft SQL Server","item":"https:\/\/www.dataplatform.gr\/category\/databases\/ms-sqlserver\/"},{"@type":"ListItem","position":4,"name":"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b1\u03c3\u03c6\u03ac\u03bb\u03b9\u03c3\u03c4\u03c1\u03b1 \u03b1\u03c5\u03c4\u03bf\u03ba\u03b9\u03bd\u03ae\u03c4\u03c9\u03bd \u03c0\u03bf\u03c5 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 SQL Server \u03bc\u03b5 \u03c7\u03c1\u03ae\u03c3\u03b7 Python (\u03c7\u03c9\u03c1\u03af\u03c2 API)"}]},{"@type":"WebSite","@id":"https:\/\/www.dataplatform.gr\/#website","url":"https:\/\/www.dataplatform.gr\/","name":"dataplatform.gr - Sky is not the limit!","description":"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.","publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dataplatform.gr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dataplatform.gr\/#organization","name":"dataplatform.gr","url":"https:\/\/www.dataplatform.gr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","width":322,"height":139,"caption":"dataplatform.gr"},"image":{"@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dataplatform.gr\/","https:\/\/www.linkedin.com\/company\/dataplatform-gr\/"]},{"@type":"Person","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf","name":"Stratos Matzouranis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","caption":"Stratos Matzouranis"},"sameAs":["https:\/\/www.dataplatform.gr"],"url":"https:\/\/www.dataplatform.gr\/en\/author\/stratos-matzouranis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/2151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/comments?post=2151"}],"version-history":[{"count":1,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/2151\/revisions"}],"predecessor-version":[{"id":5783,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/2151\/revisions\/5783"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media\/703"}],"wp:attachment":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media?parent=2151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/categories?post=2151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/tags?post=2151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}