{"id":57,"date":"2025-02-11T14:59:41","date_gmt":"2025-02-11T12:59:41","guid":{"rendered":"https:\/\/adriportfoolio6.wordpress.com\/?page_id=57"},"modified":"2025-02-11T14:59:41","modified_gmt":"2025-02-11T12:59:41","slug":"sql-veateated-ja-nende-lahendamine","status":"publish","type":"page","link":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/","title":{"rendered":"SQL veateated ja nende lahendamine"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>S\u00dcNTAKSI<\/strong> <strong>VIGA SQL&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-19.png?w=708\" alt=\"\" class=\"wp-image-60\" \/><\/figure>\n\n\n\n<p>&#8211;vale s\u00fcntaksi p\u00e4ring<\/p>\n\n\n\n<p><strong>lahendus<\/strong>: lisada andmebaasi nimi: create database veateade;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><strong>S\u00dcNTAKSI<\/strong> VIGA XAMPP&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-20.png?w=589\" alt=\"\" class=\"wp-image-61\" \/><\/figure>\n\n\n\n<p>&#8211;vale s\u00fcntaksi p\u00e4ring<\/p>\n\n\n\n<p><strong>lahendus<\/strong>: lisada andmebaasi nimi: create database veateade;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>PUUDUV VEERG SQL&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-21.png?w=1024\" alt=\"\" class=\"wp-image-62\" \/><\/figure>\n\n\n\n<p>&#8211;puudub veerg kuhu lisatakse primaarne v\u00f5ti<\/p>\n\n\n\n<p><strong>&#8211;\u00f5ige SQL:<\/strong> alter table test alter column id int not null;<br>alter table test add primary key (id);<\/p>\n\n\n\n<p>&#8211;lisasime alter column ja not null<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>PUUDUV VEERG<\/strong> <strong>XAMPP&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-22.png?w=1019\" alt=\"\" class=\"wp-image-63\" \/><\/figure>\n\n\n\n<p><strong>&#8211;\u00f5ige XAMPP:<\/strong>ALTER TABLE test<br>MODIFY COLUMN id INT PRIMARY KEY AUTO_INCREMENT;<\/p>\n\n\n\n<p>&#8211;kasutame modify kuna me ei saa kasutada add seeparast see on veel uks viga sest meil on juba olemas veerg id<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>TUNDMATU TABELI NIMI SQL&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-23.png?w=758\" alt=\"\" class=\"wp-image-64\" \/><\/figure>\n\n\n\n<p>&#8211;meil puudub tabel nimega &#8220;test2&#8221; <\/p>\n\n\n\n<p><strong>lahendus:<\/strong> meil on vaja kirjutada olemasolevat tabelit sel juhul see on tabel test<\/p>\n\n\n\n<p><strong>&#8211;\u00f5ige<\/strong> <strong>SQL:<\/strong>insert into test(id, test)<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>TUNDMATU TABELI NIMI XAMPP&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-24.png?w=356\" alt=\"\" class=\"wp-image-65\" \/><\/figure>\n\n\n\n<p>&#8211;see on sama viga ja sama lahendus<\/p>\n\n\n\n<p><strong>&#8211;\u00f5ige XAMPP:<\/strong>insert into test(id, test)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>TUNDMATU VEERG SQL&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-25.png?w=680\" alt=\"\" class=\"wp-image-66\" \/><\/figure>\n\n\n\n<p>&#8211;siin puudub veerg nimega test sel juhul vahetame olevale veerule nimi<\/p>\n\n\n\n<p><strong>&#8211;\u00f5ige<\/strong> <strong>SQL:<\/strong> insert into test(id, nimi)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>TUNDMATU VEERG <strong>XAMPP&#8217;IS<\/strong><\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-26.png?w=532\" alt=\"\" class=\"wp-image-67\" \/><\/figure>\n\n\n\n<p>&#8211;siin puudub veerg nimega test sel juhul vahetame olevale veerule nimi<\/p>\n\n\n\n<p><strong>&#8211;\u00f5ige XAMPP:<\/strong>insert into test(id, nimi)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>ANDMET\u00dc\u00dcBI VIGA<\/strong> <strong>SQL&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-27.png?w=1024\" alt=\"\" class=\"wp-image-68\" \/><\/figure>\n\n\n\n<p>-andmet\u00fc\u00fcp tabelis on int, aga me sisestasime teksti &#8216;t&#8217; <\/p>\n\n\n\n<p>&#8211;vahetame &#8216;t&#8217; 1 peale<\/p>\n\n\n\n<p><strong>&#8211;\u00f5ige SQL:<\/strong>insert into test(id, nimi)<br>values (1, &#8216;test&#8217;);<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>PROTSEDUURI VIGA SQL&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-29.png?w=1024\" alt=\"\" class=\"wp-image-70\" \/><\/figure>\n\n\n\n<p>&#8211;oli tehtud protseduur, vale suntaks sest, enne begin peab olema as <\/p>\n\n\n\n<p>(ma ei tea kas saab  seda vigat lugeda, sest see on ka syntax viga)<\/p>\n\n\n\n<p><strong>&#8211;\u00f5ige SQL:<\/strong>create procedure lisanimi<br>@nnimi varchar(30)<\/p>\n\n\n\n<p>as<br>begin<br><br>insert into test (nimi)<br>values (@nnimi)<br>select * from test;<\/p>\n\n\n\n<p>end;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>JUTTUM\u00c4RKIDE VIGA SQL&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-30.png?w=853\" alt=\"\" class=\"wp-image-71\" \/><\/figure>\n\n\n\n<p>&#8211;meie kirjutasime andme tabeli jaoks kahekorralistes juttumarkides aga peab uhekorralistes selle parast programm motleb et see on veerg <\/p>\n\n\n\n<p><strong>&#8211;\u00f5ige SQL:<\/strong>insert into test(id, nimi)<br>values (2, &#8216;test&#8217;);<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>PRIMARY KEY VIGA<\/strong> <strong>SQL&#8217;IS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-32.png?w=1024\" alt=\"\" class=\"wp-image-73\" \/><\/figure>\n\n\n\n<p>&#8211;primary key ei saa korrata peab  lihtsalt vahetada id numbrit<\/p>\n\n\n\n<p><strong>&#8211;\u00f5ige SQL:<\/strong>insert into test(id, nimi)<br>values (3, &#8216;test&#8217;);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>S\u00dcNTAKSI VIGA SQL&#8217;IS &#8211;vale s\u00fcntaksi p\u00e4ring lahendus: lisada andmebaasi nimi: create database veateade; S\u00dcNTAKSI VIGA XAMPP&#8217;IS &#8211;vale s\u00fcntaksi p\u00e4ring lahendus: lisada andmebaasi nimi: create database veateade; PUUDUV VEERG SQL&#8217;IS &#8211;puudub veerg kuhu lisatakse primaarne v\u00f5ti &#8211;\u00f5ige SQL: alter table test alter column id int not null;alter table test add primary key (id); &#8211;lisasime alter column [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-with-title","meta":{"footnotes":""},"class_list":["post-57","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL veateated ja nende lahendamine - Adriana Pikaljov Portfolio ||| ENG<\/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:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL veateated ja nende lahendamine - Adriana Pikaljov Portfolio ||| ENG\" \/>\n<meta property=\"og:description\" content=\"S\u00dcNTAKSI VIGA SQL&#8217;IS &#8211;vale s\u00fcntaksi p\u00e4ring lahendus: lisada andmebaasi nimi: create database veateade; S\u00dcNTAKSI VIGA XAMPP&#8217;IS &#8211;vale s\u00fcntaksi p\u00e4ring lahendus: lisada andmebaasi nimi: create database veateade; PUUDUV VEERG SQL&#8217;IS &#8211;puudub veerg kuhu lisatakse primaarne v\u00f5ti &#8211;\u00f5ige SQL: alter table test alter column id int not null;alter table test add primary key (id); &#8211;lisasime alter column [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/\" \/>\n<meta property=\"og:site_name\" content=\"Adriana Pikaljov Portfolio ||| ENG\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/sql-veateated-ja-nende-lahendamine\\\/\",\"url\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/sql-veateated-ja-nende-lahendamine\\\/\",\"name\":\"SQL veateated ja nende lahendamine - Adriana Pikaljov Portfolio ||| ENG\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/sql-veateated-ja-nende-lahendamine\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/sql-veateated-ja-nende-lahendamine\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/adriportfoolio6.wordpress.com\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/image-19.png?w=708\",\"datePublished\":\"2025-02-11T12:59:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/sql-veateated-ja-nende-lahendamine\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/sql-veateated-ja-nende-lahendamine\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/sql-veateated-ja-nende-lahendamine\\\/#primaryimage\",\"url\":\"https:\\\/\\\/adriportfoolio6.wordpress.com\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/image-19.png?w=708\",\"contentUrl\":\"https:\\\/\\\/adriportfoolio6.wordpress.com\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/image-19.png?w=708\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/sql-veateated-ja-nende-lahendamine\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL veateated ja nende lahendamine\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/#website\",\"url\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/\",\"name\":\"Adriana Pikaljov Portfolio ||| ENG\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/adrianapikaljov24.thkit.ee\\\/wp\\\/eng\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL veateated ja nende lahendamine - Adriana Pikaljov Portfolio ||| ENG","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:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/","og_locale":"en_GB","og_type":"article","og_title":"SQL veateated ja nende lahendamine - Adriana Pikaljov Portfolio ||| ENG","og_description":"S\u00dcNTAKSI VIGA SQL&#8217;IS &#8211;vale s\u00fcntaksi p\u00e4ring lahendus: lisada andmebaasi nimi: create database veateade; S\u00dcNTAKSI VIGA XAMPP&#8217;IS &#8211;vale s\u00fcntaksi p\u00e4ring lahendus: lisada andmebaasi nimi: create database veateade; PUUDUV VEERG SQL&#8217;IS &#8211;puudub veerg kuhu lisatakse primaarne v\u00f5ti &#8211;\u00f5ige SQL: alter table test alter column id int not null;alter table test add primary key (id); &#8211;lisasime alter column [&hellip;]","og_url":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/","og_site_name":"Adriana Pikaljov Portfolio ||| ENG","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/","url":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/","name":"SQL veateated ja nende lahendamine - Adriana Pikaljov Portfolio ||| ENG","isPartOf":{"@id":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/#website"},"primaryImageOfPage":{"@id":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/#primaryimage"},"image":{"@id":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/#primaryimage"},"thumbnailUrl":"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-19.png?w=708","datePublished":"2025-02-11T12:59:41+00:00","breadcrumb":{"@id":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/#primaryimage","url":"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-19.png?w=708","contentUrl":"https:\/\/adriportfoolio6.wordpress.com\/wp-content\/uploads\/2025\/02\/image-19.png?w=708"},{"@type":"BreadcrumbList","@id":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/sql-veateated-ja-nende-lahendamine\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/"},{"@type":"ListItem","position":2,"name":"SQL veateated ja nende lahendamine"}]},{"@type":"WebSite","@id":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/#website","url":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/","name":"Adriana Pikaljov Portfolio ||| ENG","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/wp-json\/wp\/v2\/pages\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":0,"href":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/wp-json\/wp\/v2\/pages\/57\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrianapikaljov24.thkit.ee\/wp\/eng\/wp-json\/wp\/v2\/media?parent=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}