{"id":432,"date":"2021-12-02T08:53:29","date_gmt":"2021-12-02T08:53:29","guid":{"rendered":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/?p=432"},"modified":"2021-12-02T09:26:26","modified_gmt":"2021-12-02T09:26:26","slug":"creating-a-table-2","status":"publish","type":"post","link":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/2021\/12\/02\/creating-a-table-2\/","title":{"rendered":"Creating a Table"},"content":{"rendered":"\n<p>Let\u2019s assume that you are working for a audio store and need to create a database to hold details about all the types of devices in the store. You are told that there are nine families of devices\u2014Amplifier, minidisc, DVD, C-casette, Turntable, DAT, DCC, Turner, and DAB\u2014so you\u2019ll need a column for that. Then each device has been given a name, so that\u2019s another column, and you also want to keep track of their ages, which is another. Of course, you will probably need more columns later, perhaps to hold voltage requirements, and other details, but for now that\u2019s enough to get going. A unique identifier is also needed for each device, so you also decide to create a column for that called id.<\/p>\n\n\n\n<p>The code you might use to create a MySQL table to hold this<br>data, with the main query assignment in bold text.<\/p>\n\n\n\n<p><a href=\"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/data\/table.txt\">Creating a table called devices<\/a><\/p>\n\n\n\n<p>As you can see, the MySQL query looks just like what you would type directly at the command line, except without the trailing semicolon.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let\u2019s assume that you are working for a audio store and need to create a database to hold details about all the types of devices in the store. You are told that there are nine families of devices\u2014Amplifier, minidisc, DVD, C-casette, Turntable, DAT, DCC, Turner, and DAB\u2014so you\u2019ll need a column for that. Then each &hellip; <a href=\"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/2021\/12\/02\/creating-a-table-2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Creating a Table<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/432"}],"collection":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=432"}],"version-history":[{"count":3,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/432\/revisions"}],"predecessor-version":[{"id":443,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/432\/revisions\/443"}],"wp:attachment":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}