{"id":1660,"date":"2024-05-20T10:47:44","date_gmt":"2024-05-20T07:47:44","guid":{"rendered":"https:\/\/kodu3.wordpress.com\/?page_id=1660"},"modified":"2024-10-15T21:06:30","modified_gmt":"2024-10-15T21:06:30","slug":"shopbase-localhost","status":"publish","type":"page","link":"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/","title":{"rendered":"ShopBase \/ localhost"},"content":{"rendered":"\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>Tabelite loomine<\/strong><\/p>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabeli loomine brands<\/em><\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE Database ShopBase;\nUSE ShopBase\n\n--Tabeli loomine brands\nCreate table brands(\nbrand_id int primary key identity(1,1),\nbrand_name varchar(20)\n);\nINSERT INTO brands (brand_name) \nVALUES (&#039;Zara&#039;),\n(&#039;Nike&#039;),\n(&#039;Adidas&#039;),\n(&#039;Gucci&#039;),\n(&#039;Chanel&#039;);\nSELECT * FROM brands\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-34.png?w=200\" alt=\"\" class=\"wp-image-1661\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabeli loomine categories<\/em><\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Tabeli loomine categories\nCreate table categories(\ncategory_id int primary key identity(1,1),\ncategory_name varchar(20)\n);\nINSERT INTO categories (category_name)\nVALUES (&#039;\u00dcler\u00f5ivad&#039;),\n(&#039;Talje riided&#039;),\n(&#039;Aluspesu&#039;),\n(&#039;M\u00fctsid&#039;),\n(&#039;Kingad&#039;);\nSELECT * FROM categories\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-35.png?w=256\" alt=\"\" class=\"wp-image-1663\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabeli loomine customers<\/em><\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Tabeli loomine customers\nCREATE TABLE customers(\ncustomer_id int primary key identity(1,1),\nfirst_name varchar (30),\nlast_name varchar (30),\nphone varchar (30),\nemail varchar (30),\nstreet varchar (30),\ncity varchar (30),\nstate varchar (15),\nzip_code varchar(10)\n);\nINSERT INTO customers (first_name, last_name, phone, email, street, city, state, zip_code)\nVALUES (&#039;Sofiia&#039;, &#039;Halchenko&#039;, &#039;54346644&#039;, &#039;sofiagalcenko3@gmail.com&#039;, &#039;Viljandi mnt 16&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;25544&#039;),\n(&#039;Zenja&#039;, &#039;Svirilin&#039;, &#039;58877544&#039;, &#039;zenja323@gmail.com&#039;, &#039;Majaka 9&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;25334&#039;),\n(&#039;Sasha&#039;, &#039;Semjonova&#039;, &#039;58756454&#039;, &#039;semjonova2@gmail.com&#039;, &#039;Meistri 5&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;33774&#039;),\n(&#039;Bogdan&#039;, &#039;Sergatsov&#039;, &#039;58334563&#039;, &#039;bogdan.sergatsov233@gmail.com&#039;, &#039;V\u00e4ike-\u00d5ism\u00e4e 15&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;58761&#039;),\n(&#039;Martin&#039;, &#039;Sild&#039;, &#039;58996845&#039;, &#039;martinsild@gmail.com&#039;, &#039;Peterburi tee 2&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;58364&#039;);\nSELECT * FROM customers\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-36.png?w=752\" alt=\"\" class=\"wp-image-1665\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabeli loomine products<\/em><\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Tabeli loomine products\nCREATE TABLE products(\nproduct_id int not null primary key identity(1,1),\nproduct_name varchar(20),\nbrand_id int,\ncategory_id int,\nmodel_year int,\nlist_price decimal(7, 2),\nFOREIGN KEY (brand_id) REFERENCES brands(brand_id),\nFOREIGN KEY (category_id) REFERENCES categories(category_id)\n);\nINSERT INTO products\n(product_name, brand_id, category_id,model_year,list_price)\nVALUES (&#039;s\u00e4rk&#039;, 1, 2, 2020, 25.20),\n(&#039;jope&#039;, 2, 2, 2021, 25.15),\n(&#039;seelik&#039;, 3, 2, 2022, 26.10),\n(&#039;tossud&#039;, 5, 5, 2023, 22.25),\n(&#039;ujumistrikoo&#039;, 4, 3, 2024, 20.5);\nselect * from products\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-37.png?w=513\" alt=\"\" class=\"wp-image-1667\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabeli loomine stores<\/em><\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Tabeli loomine stores\nCreate table stores(\nstore_id int primary key identity(1,1),\nstore_name varchar(20),\nphone varchar(20),\nemail varchar(20),\nstreet varchar(20),\ncity varchar(20),\nstate varchar(20),\nzip_code varchar (10)\n);\nINSERT INTO stores\n(store_name, phone, email, street, city, state, zip_code) \nVALUES (&#039;Zara&#039;,&#039;55565545&#039;, &#039;zara323@gmail.com&#039;, &#039;Narva mnt 22&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;25644&#039;),\n(&#039;Skyler&#039;,&#039;58755469&#039;, &#039;skylerl42@gmail.com&#039;, &#039;Majaka 16&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;33234&#039;),\n(&#039;AOIFE&#039;, &#039;58732463&#039;, &#039;aoife233@gmail.com&#039;, &#039;V\u00e4ike-\u00d5ism\u00e4e 15&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;58871&#039;),\n(&#039;Fashions&#039;, &#039;58334445&#039;, &#039;fashions23@gmail.com&#039;, &#039;M\u00e4nniku tee 109a&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;53324&#039;),\n(&#039;Butik&#039;, &#039;5822345&#039;, &#039;butik23@gmail.com&#039;, &#039;M\u00e4nniku tee 135a&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;51234&#039;);\nSELECT * FROM stores\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-38.png?w=641\" alt=\"\" class=\"wp-image-1669\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabeli loomine staffs<\/em><\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Tabeli loomine staffs\nCREATE TABLE staffs(\nstaff_id int primary key identity(1,1),\nfirst_name varchar (25),\nlast_name varchar (25),\nemail varchar (30),\nphone varchar (20),\nactive bit,\nstore_id int,\nmanager_id int,\nFOREIGN KEY(manager_id) REFERENCES staffs(staff_id),\nFOREIGN KEY(store_id) REFERENCES stores(store_id)\n);\nINSERT INTO staffs\n(first_name, last_name, email, phone, active, store_id, manager_id) \nVALUES (&#039;Daria&#039;, &#039;Halchenko&#039;, &#039;daragalcenko3@gmail.com&#039;, &#039;58933227&#039;, 1, 2, 1),\n(&#039;Kirill&#039;, &#039;Saats&#039;, &#039;kirill123@gmail.com&#039;, &#039;58764027&#039;, 0, 1, 2),\n(&#039;Valeria&#039;, &#039;Allik&#039;, &#039;valeria.allik@gmail.com&#039;, &#039;58746852&#039;, 1, 4, 3),\n(&#039;Lev&#039;, &#039;Jegorov&#039;, &#039;lev@gmail.com&#039;, &#039;58568797&#039;, 0, 3, 4),\n(&#039;Maksim&#039;, &#039;Svirilin&#039;, &#039;maksim134@gmail.com&#039;, &#039;5833852&#039;, 1, 5, 5);\nselect * from staffs\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-39.png?w=645\" alt=\"\" class=\"wp-image-1671\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabeli loomine orders<\/em><\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Tabeli loomine orders\nCREATE TABLE orders(\norder_id int not null primary key identity(1,1),\ncustomer_id int,\norder_status varchar(20),\norder_date date,\nrequired_date date,\nsgipped_date date,\nstore_id int,\nstaff_id int,\nFOREIGN KEY (customer_id) REFERENCES customers(customer_id),\nFOREIGN KEY (store_id) REFERENCES stores(store_id),\nFOREIGN KEY (staff_id) REFERENCES staffs(staff_id)\n);\nINSERT INTO orders\n(customer_id, order_status, order_date, required_date, sgipped_date, store_id, staff_id) \nVALUES (1, &#039;Saadetud&#039;, &#039;2024-08-15&#039;, &#039;2024-04-26&#039;, &#039;2024-08-05&#039;, 1, 2),\n(2, &#039;ravi&#039;, &#039;2024-05-13&#039;, &#039;2024-03-21&#039;, &#039;2024-06-27&#039;, 3, 5),\n(3, &#039;ootus&#039;, &#039;2024-10-25&#039;, &#039;2024-01-22&#039;, &#039;2024-03-24&#039;, 4, 1),\n(1, &#039;Saadetud&#039;, &#039;2024-03-07&#039;, &#039;2024-09-23&#039;, &#039;2024-10-24&#039;, 5, 4),\n(1, &#039;ravi&#039;, &#039;2024-11-27&#039;, &#039;2024-05-19&#039;, &#039;2024-08-24&#039;, 2, 3);\nselect * from orders\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-40.png?w=599\" alt=\"\" class=\"wp-image-1672\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabeli loomine stocks<\/em><\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Tabeli loomine stocks\nCREATE TABLE stocks(\nstore_id int not null,\nproduct_id int,\nquantity int,\nPRIMARY KEY (store_id, product_id),\nFOREIGN KEY(product_id) REFERENCES products(product_id),\nFOREIGN KEY(store_id) REFERENCES stores(store_id)\n);\nINSERT INTO stocks\n(store_id, product_id, quantity) \nVALUES (1, 9, 20),\n(2, 10, 50),\n(3, 11, 45),\n(4, 12, 25),\n(5, 13, 55);\nselect * from stocks\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-41.png?w=294\" alt=\"\" class=\"wp-image-1678\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabeli loomine order_items<\/em><\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Tabeli loomine order_items\nCREATE TABLE order_items(\norder_id int not null,\nitem_id int not null,\nproduct_id int,\nquantity int,\nlist_price decimal (7, 2),\ndiscount decimal (7, 2),\nPRIMARY KEY (order_id, item_id),\nFOREIGN KEY(product_id) REFERENCES products(product_id)\n);\nINSERT INTO order_items\n(order_id, item_id, product_id, quantity, list_price, discount) \nVALUES (1, 1, 9, 25, 23.33, 10),\n(2, 2, 10, 15, 25.45, 5),\n(3, 3, 11, 25, 215.45, 15),\n(4, 4, 12, 45, 533.45, 20),\n(5, 5, 13, 5, 25.45, 5);\nselect * from order_items\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-42.png?w=428\" alt=\"\" class=\"wp-image-1679\" \/><\/figure>\n\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>Andmeskeem<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-43.png?w=1024\" alt=\"\" class=\"wp-image-1681\" \/><\/figure>\n\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>Kasutaja staff loomine<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/image-2024-05-20-152246.jpg?w=1024\" alt=\"\" class=\"wp-image-1729\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Public andmebaasi tasemel<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-44.png?w=702\" alt=\"\" class=\"wp-image-1682\" \/><\/figure>\n\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>M\u00e4\u00e4ratleme \u00f5igused ja loobume \u00f5igustes<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--\u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c (STAFF)\nGRANT SELECT ON customers TO staff;\nGRANT SELECT ON orders TO staff;\nGRANT SELECT ON staffs TO staff;\nGRANT SELECT ON stores TO staff;\nGRANT SELECT ON order_items TO staff;\n--Staff \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u044b (orders, order_item)\nGRANT INSERT ON order_items TO staff;\nGRANT INSERT ON orders TO staff;\n--keelduda DELETE ja UPDATE (STAFF)\nDENY DELETE to staff;\nDENY UPDATE to staff;\n<\/pre><\/div>\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>Kasutaja manager loomine<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-45.png?w=708\" alt=\"\" class=\"wp-image-1683\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-47.png?w=252\" alt=\"\" class=\"wp-image-1686\" \/><\/figure>\n\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>M\u00e4\u00e4ratleme \u00f5igused ja loobume \u00f5igustes<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Manager \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u044b (stores), \u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0432\u0430\u0440\u0430\u043c\u0438, \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 \u0437\u0430\u043a\u0430\u0437\u0430\u043c\u0438. \nGRANT INSERT, SELECT, UPDATE, DELETE ON order_items TO manager;\nGRANT SELECT, UPDATE ON stores TO manager;\nGRANT INSERT, SELECT, UPDATE, DELETE ON staffs TO manager;\nGRANT INSERT, SELECT, UPDATE, DELETE ON orders TO manager;\nGRANT INSERT, SELECT, UPDATE, DELETE ON customers TO manager;\nGRANT INSERT, SELECT, UPDATE, DELETE ON categories TO manager;\nGRANT INSERT, SELECT, UPDATE, DELETE ON products TO manager;\nGRANT INSERT, SELECT, UPDATE, DELETE ON stocks TO manager;\nGRANT INSERT, SELECT, UPDATE, DELETE ON brands TO manager;\n\nGRANT SELECT to manager;\n<\/pre><\/div>\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>\u00d5iguste kontroll staff<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-48.png?w=357\" alt=\"\" class=\"wp-image-1690\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabelite vaatamine<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-49.png?w=777\" alt=\"\" class=\"wp-image-1692\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT * FROM customers;\nSELECT * FROM orders;\nSELECT * FROM staffs;\nSELECT * FROM stores;\nSELECT * FROM order_items;\n<\/pre><\/div>\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Staffil on \u00f5igus lisada tellimusi (orders)<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-54.png?w=1024\" alt=\"\" class=\"wp-image-1698\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-51.png?w=1024\" alt=\"\" class=\"wp-image-1694\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nINSERT INTO orders\n(customer_id, order_status, order_date, required_date, sgipped_date, store_id, staff_id) \nVALUES (2, &#039;Uuendatud&#039;, &#039;2024-10-25&#039;, &#039;2024-07-22&#039;, &#039;2024-07-05&#039;, 1, 3);\nSELECT * FROM orders;\n<\/pre><\/div>\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Staffil on \u00f5igus lisada tellimusi ( order_item)<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-53.png?w=967\" alt=\"\" class=\"wp-image-1696\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-52.png?w=990\" alt=\"\" class=\"wp-image-1695\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nINSERT INTO order_items\n(order_id, item_id, product_id, quantity, list_price, discount) \nVALUES (1, 3, 15, 25, 143.33, 15);\nSELECT * FROM order_items;\n<\/pre><\/div>\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>Kontrollitakse, mida kasutaja ei saa teha<\/strong><\/p>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Kontrollime UPDATE<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-55.png?w=1024\" alt=\"\" class=\"wp-image-1699\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--kontrollime UPDATE\nUPDATE order_items\nset quantity=45 where order_id=1;\n<\/pre><\/div>\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Kontrollime DELETE<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-56.png?w=1024\" alt=\"\" class=\"wp-image-1701\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--kontrollime DELETE\n\nDELETE from orders\n<\/pre><\/div>\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>\u00d5iguste kontroll manager<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-57.png?w=416\" alt=\"\" class=\"wp-image-1703\" \/><\/figure>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Tabelite vaatamine<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-58.png?w=912\" alt=\"\" class=\"wp-image-1705\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT * FROM customers;\nSELECT * FROM orders;\nSELECT * FROM staffs;\nSELECT * FROM stores;\nSELECT * FROM order_items;\nSELECT * FROM categories;\nSELECT * FROM products;\nSELECT * FROM stocks;\nSELECT * FROM brands;\n<\/pre><\/div>\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Kontrollime UPDATE<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-60.png?w=860\" alt=\"\" class=\"wp-image-1707\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nUPDATE order_items\nset quantity=45 where order_id=1;\nSELECT * FROM order_items;\n<\/pre><\/div>\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>Kontrollitakse, mida kasutaja ei saa teha<\/strong><\/p>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Kontrollime INSERT<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-59.png?w=1024\" alt=\"\" class=\"wp-image-1706\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nINSERT INTO stores\n(store_name, phone, email, street, city, state, zip_code) \nVALUES (&#039;H&amp;M&#039;,&#039;58885545&#039;, &#039;hm35675323@gmail.com&#039;, &#039;Narva mnt 22&#039;, &#039;Tallinn&#039;, &#039;Eesti&#039;, &#039;25644&#039;);\n<\/pre><\/div>\n\n\n<p class=\"has-x-large-font-size wp-block-paragraph\"><strong>Protseduurid<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-61.png?w=732\" alt=\"\" class=\"wp-image-1710\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\ncreate procedure insertToProducts(\n@prod_name varchar(50), \n@brand int, \n@category int)\nas \nINSERT INTO products(\nproduct_name, brand_id, category_id)\nValues(@prod_name, @brand, @category);\nEXEC insertToProducts\n@prod_name=automasin,@brand=1, @category=2;\nSELECT * from products\n<\/pre><\/div>\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong><em>Protseduuri kustutamiseks selle id<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-63.png?w=826\" alt=\"\" class=\"wp-image-1713\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE PROCEDURE categories_kustutamine\n@deleteID int\nAS\nBEGIN\nSELECT * FROM categories;\nDELETE FROM categories\nWHERE category_id = @deleteID;\nSELECT * FROM categories;\nEND; \n-- kontroll\nEXEC  categories_kustutamine 1;\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Tabelite loomine Tabeli loomine brands Tabeli loomine categories Tabeli loomine customers Tabeli loomine products Tabeli loomine stores Tabeli loomine staffs Tabeli loomine orders Tabeli loomine stocks Tabeli loomine order_items Andmeskeem Kasutaja staff loomine Public andmebaasi tasemel M\u00e4\u00e4ratleme \u00f5igused ja loobume \u00f5igustes Kasutaja manager loomine M\u00e4\u00e4ratleme \u00f5igused ja loobume \u00f5igustes \u00d5iguste kontroll staff Tabelite vaatamine Staffil [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1660","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ShopBase \/ localhost - Daria Halchenko &otilde;pimapp I portfoolio<\/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:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/\" \/>\n<meta property=\"og:locale\" content=\"et_EE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ShopBase \/ localhost - Daria Halchenko &otilde;pimapp I portfoolio\" \/>\n<meta property=\"og:description\" content=\"Tabelite loomine Tabeli loomine brands Tabeli loomine categories Tabeli loomine customers Tabeli loomine products Tabeli loomine stores Tabeli loomine staffs Tabeli loomine orders Tabeli loomine stocks Tabeli loomine order_items Andmeskeem Kasutaja staff loomine Public andmebaasi tasemel M\u00e4\u00e4ratleme \u00f5igused ja loobume \u00f5igustes Kasutaja manager loomine M\u00e4\u00e4ratleme \u00f5igused ja loobume \u00f5igustes \u00d5iguste kontroll staff Tabelite vaatamine Staffil [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/\" \/>\n<meta property=\"og:site_name\" content=\"Daria Halchenko &otilde;pimapp I portfoolio\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-15T21:06:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-34.png?w=200\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/shopbase-localhost\\\/\",\"url\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/shopbase-localhost\\\/\",\"name\":\"ShopBase \\\/ localhost - Daria Halchenko &otilde;pimapp I portfoolio\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/shopbase-localhost\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/shopbase-localhost\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kodu3.wordpress.com\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/pilt-34.png?w=200\",\"datePublished\":\"2024-05-20T07:47:44+00:00\",\"dateModified\":\"2024-10-15T21:06:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/shopbase-localhost\\\/#breadcrumb\"},\"inLanguage\":\"et\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/shopbase-localhost\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"et\",\"@id\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/shopbase-localhost\\\/#primaryimage\",\"url\":\"https:\\\/\\\/kodu3.wordpress.com\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/pilt-34.png?w=200\",\"contentUrl\":\"https:\\\/\\\/kodu3.wordpress.com\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/pilt-34.png?w=200\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/shopbase-localhost\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ShopBase \\\/ localhost\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/#website\",\"url\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/\",\"name\":\"Daria Halchenko &otilde;pimapp I portfoolio\",\"description\":\"Noorem Tarkvaraarendaja eriala\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/dariahalchenko23.thkit.ee\\\/wp\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"et\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ShopBase \/ localhost - Daria Halchenko &otilde;pimapp I portfoolio","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:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/","og_locale":"et_EE","og_type":"article","og_title":"ShopBase \/ localhost - Daria Halchenko &otilde;pimapp I portfoolio","og_description":"Tabelite loomine Tabeli loomine brands Tabeli loomine categories Tabeli loomine customers Tabeli loomine products Tabeli loomine stores Tabeli loomine staffs Tabeli loomine orders Tabeli loomine stocks Tabeli loomine order_items Andmeskeem Kasutaja staff loomine Public andmebaasi tasemel M\u00e4\u00e4ratleme \u00f5igused ja loobume \u00f5igustes Kasutaja manager loomine M\u00e4\u00e4ratleme \u00f5igused ja loobume \u00f5igustes \u00d5iguste kontroll staff Tabelite vaatamine Staffil [&hellip;]","og_url":"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/","og_site_name":"Daria Halchenko &otilde;pimapp I portfoolio","article_modified_time":"2024-10-15T21:06:30+00:00","og_image":[{"url":"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-34.png?w=200","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"7 minutit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/","url":"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/","name":"ShopBase \/ localhost - Daria Halchenko &otilde;pimapp I portfoolio","isPartOf":{"@id":"https:\/\/dariahalchenko23.thkit.ee\/wp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/#primaryimage"},"image":{"@id":"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/#primaryimage"},"thumbnailUrl":"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-34.png?w=200","datePublished":"2024-05-20T07:47:44+00:00","dateModified":"2024-10-15T21:06:30+00:00","breadcrumb":{"@id":"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/#breadcrumb"},"inLanguage":"et","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/"]}]},{"@type":"ImageObject","inLanguage":"et","@id":"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/#primaryimage","url":"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-34.png?w=200","contentUrl":"https:\/\/kodu3.wordpress.com\/wp-content\/uploads\/2024\/05\/pilt-34.png?w=200"},{"@type":"BreadcrumbList","@id":"https:\/\/dariahalchenko23.thkit.ee\/wp\/shopbase-localhost\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dariahalchenko23.thkit.ee\/wp\/"},{"@type":"ListItem","position":2,"name":"ShopBase \/ localhost"}]},{"@type":"WebSite","@id":"https:\/\/dariahalchenko23.thkit.ee\/wp\/#website","url":"https:\/\/dariahalchenko23.thkit.ee\/wp\/","name":"Daria Halchenko &otilde;pimapp I portfoolio","description":"Noorem Tarkvaraarendaja eriala","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dariahalchenko23.thkit.ee\/wp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"et"}]}},"_links":{"self":[{"href":"https:\/\/dariahalchenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/pages\/1660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dariahalchenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dariahalchenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dariahalchenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dariahalchenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/comments?post=1660"}],"version-history":[{"count":1,"href":"https:\/\/dariahalchenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/pages\/1660\/revisions"}],"predecessor-version":[{"id":2166,"href":"https:\/\/dariahalchenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/pages\/1660\/revisions\/2166"}],"wp:attachment":[{"href":"https:\/\/dariahalchenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/media?parent=1660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}