{"id":1199,"date":"2012-09-16T17:14:49","date_gmt":"2012-09-17T00:14:49","guid":{"rendered":"http:\/\/www.virendrachandak.com\/techtalk\/\/?p=1199"},"modified":"2012-12-25T18:58:46","modified_gmt":"2012-12-26T02:58:46","slug":"sample-mysql-table","status":"publish","type":"post","link":"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/","title":{"rendered":"Sample MySQL table"},"content":{"rendered":"<div>For my MySQL posts here is a sample MySQL table that I would be using for my examples. I would refer my posts back to this for table structure and sample data.<\/div>\n<div><strong>Table structure<\/strong>:<\/p>\n<pre>+---------+-------------+------+-----+---------+-------+\r\n| Field   | Type        | Null | Key | Default | Extra |\r\n+---------+-------------+------+-----+---------+-------+\r\n| name    | varchar(20) | YES  |     | NULL    |       |\r\n| owner   | varchar(20) | YES  |     | NULL    |       |\r\n| species | varchar(20) | YES  |     | NULL    |       |\r\n| sex     | char(1)     | YES  |     | NULL    |       |\r\n| birth   | date        | YES  |     | NULL    |       |\r\n| death   | date        | YES  |     | NULL    |       |\r\n+---------+-------------+------+-----+---------+-------+<\/pre>\n<\/div>\n<div><strong>Create Table SQL<\/strong>:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nCREATE TABLE pet (\r\n\tname VARCHAR(20),\r\n\towner VARCHAR(20),\r\n\tspecies VARCHAR(20),\r\n\tsex CHAR(1),\r\n\tbirth DATE,\r\n\tdeath DATE\r\n);\r\n<\/pre>\n<\/div>\n<div><strong>Sample Data<\/strong>:<\/p>\n<table>\n<tbody>\n<tr>\n<th>name<\/th>\n<th>owner<\/th>\n<th>species<\/th>\n<th>sex<\/th>\n<th>birth<\/th>\n<th>death<\/th>\n<\/tr>\n<tr>\n<td>Fluffy<\/td>\n<td>Harold<\/td>\n<td>cat<\/td>\n<td>f<\/td>\n<td>1993-02-04<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Claws<\/td>\n<td>Gwen<\/td>\n<td>cat<\/td>\n<td>m<\/td>\n<td>1994-03-17<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Buffy<\/td>\n<td>Harold<\/td>\n<td>dog<\/td>\n<td>f<\/td>\n<td>1989-05-13<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Fang<\/td>\n<td>Benny<\/td>\n<td>dog<\/td>\n<td>m<\/td>\n<td>1990-08-27<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Bowser<\/td>\n<td>Diane<\/td>\n<td>dog<\/td>\n<td>m<\/td>\n<td>1979-08-31<\/td>\n<td>1995-07-29<\/td>\n<\/tr>\n<tr>\n<td>Chirpy<\/td>\n<td>Gwen<\/td>\n<td>bird<\/td>\n<td>f<\/td>\n<td>1998-09-11<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Whistler<\/td>\n<td>Gwen<\/td>\n<td>bird<\/td>\n<td><\/td>\n<td>1997-12-09<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Slim<\/td>\n<td>Benny<\/td>\n<td>snake<\/td>\n<td>m<\/td>\n<td>1996-04-29<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div><strong>Insert sample data SQL<\/strong>:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nINSERT INTO pet VALUES\r\n('Fluffy','Harold','cat','f','1993-02-04',''),\r\n('Claws','Gwen','cat','m','1994-03-17',''),\r\n('Buffy','Harold','dog','f','1989-05-13',''),\r\n('Fang','Benny','dog','m','1990-08-27',''),\r\n('Bowser','Diane','dog','m','1979-08-31','1995-07-29'),\r\n('Chirpy','Gwen','bird','f','1998-09-11',''),\r\n('Whistler','Gwen','bird','','1997-12-09',''),\r\n('Slim','Benny','snake','m','1996-04-29','')\r\n<\/pre>\n<\/div>\n<div>I have taken this table structure and data from MySQL documentation (<a title=\"Creating a Table\" href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/creating-tables.html\" target=\"_blank\">Creating a table<\/a> and <a title=\"Loading Data into Table\" href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/loading-tables.html\" target=\"_blank\">Loading Data into Table<\/a>).<\/div>\n","protected":false},"excerpt":{"rendered":"<p>For my MySQL posts here is a sample MySQL table that I would be using for my examples. I would refer my posts back to this for table structure and sample data. Table structure: +&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;+&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212;-+ | Field | Type | Null | Key | Default | Extra | +&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;+&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212;-+ | name | varchar(20) | YES [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[48],"tags":[107],"class_list":["post-1199","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-sample-data"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sample MySQL table - Virendra&#039;s TechTalk<\/title>\n<meta name=\"description\" content=\"For my MySQL posts here is a sample MySQL table that I would be using for my examples. I would refer my posts back to this for table structure and sample\" \/>\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.virendrachandak.com\/techtalk\/sample-mysql-table\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sample MySQL table - Virendra&#039;s TechTalk\" \/>\n<meta property=\"og:description\" content=\"For my MySQL posts here is a sample MySQL table that I would be using for my examples. I would refer my posts back to this for table structure and sample\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/\" \/>\n<meta property=\"og:site_name\" content=\"Virendra&#039;s TechTalk\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/virendrachandak\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/virendrachandak\" \/>\n<meta property=\"article:published_time\" content=\"2012-09-17T00:14:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-12-26T02:58:46+00:00\" \/>\n<meta name=\"author\" content=\"Virendra Chandak\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@virendrachandak\" \/>\n<meta name=\"twitter:site\" content=\"@virendrachandak\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virendra Chandak\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/\"},\"author\":{\"name\":\"Virendra Chandak\",\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17\"},\"headline\":\"Sample MySQL table\",\"datePublished\":\"2012-09-17T00:14:49+00:00\",\"dateModified\":\"2012-12-26T02:58:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/\"},\"wordCount\":196,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17\"},\"keywords\":[\"sample data\"],\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/\",\"url\":\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/\",\"name\":\"Sample MySQL table - Virendra's TechTalk\",\"isPartOf\":{\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/#website\"},\"datePublished\":\"2012-09-17T00:14:49+00:00\",\"dateModified\":\"2012-12-26T02:58:46+00:00\",\"description\":\"For my MySQL posts here is a sample MySQL table that I would be using for my examples. I would refer my posts back to this for table structure and sample\",\"breadcrumb\":{\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"TechTalk\",\"item\":\"https:\/\/www.virendrachandak.com\/techtalk\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL\",\"item\":\"https:\/\/www.virendrachandak.com\/techtalk\/category\/mysql\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Sample MySQL table\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/#website\",\"url\":\"https:\/\/www.virendrachandak.com\/techtalk\/\",\"name\":\"Virendra's TechTalk\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.virendrachandak.com\/techtalk\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17\",\"name\":\"Virendra Chandak\",\"logo\":{\"@id\":\"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/www.virendrachandak.com\",\"https:\/\/www.facebook.com\/virendrachandak\",\"https:\/\/www.linkedin.com\/in\/virendrachandak\/\",\"https:\/\/x.com\/virendrachandak\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sample MySQL table - Virendra's TechTalk","description":"For my MySQL posts here is a sample MySQL table that I would be using for my examples. I would refer my posts back to this for table structure and sample","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.virendrachandak.com\/techtalk\/sample-mysql-table\/","og_locale":"en_US","og_type":"article","og_title":"Sample MySQL table - Virendra's TechTalk","og_description":"For my MySQL posts here is a sample MySQL table that I would be using for my examples. I would refer my posts back to this for table structure and sample","og_url":"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/","og_site_name":"Virendra&#039;s TechTalk","article_publisher":"https:\/\/www.facebook.com\/virendrachandak","article_author":"https:\/\/www.facebook.com\/virendrachandak","article_published_time":"2012-09-17T00:14:49+00:00","article_modified_time":"2012-12-26T02:58:46+00:00","author":"Virendra Chandak","twitter_card":"summary_large_image","twitter_creator":"@virendrachandak","twitter_site":"@virendrachandak","twitter_misc":{"Written by":"Virendra Chandak","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/#article","isPartOf":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/"},"author":{"name":"Virendra Chandak","@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17"},"headline":"Sample MySQL table","datePublished":"2012-09-17T00:14:49+00:00","dateModified":"2012-12-26T02:58:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/"},"wordCount":196,"commentCount":0,"publisher":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17"},"keywords":["sample data"],"articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/","url":"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/","name":"Sample MySQL table - Virendra's TechTalk","isPartOf":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#website"},"datePublished":"2012-09-17T00:14:49+00:00","dateModified":"2012-12-26T02:58:46+00:00","description":"For my MySQL posts here is a sample MySQL table that I would be using for my examples. I would refer my posts back to this for table structure and sample","breadcrumb":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.virendrachandak.com\/techtalk\/sample-mysql-table\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"TechTalk","item":"https:\/\/www.virendrachandak.com\/techtalk\/"},{"@type":"ListItem","position":2,"name":"MySQL","item":"https:\/\/www.virendrachandak.com\/techtalk\/category\/mysql\/"},{"@type":"ListItem","position":3,"name":"Sample MySQL table"}]},{"@type":"WebSite","@id":"https:\/\/www.virendrachandak.com\/techtalk\/#website","url":"https:\/\/www.virendrachandak.com\/techtalk\/","name":"Virendra's TechTalk","description":"","publisher":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.virendrachandak.com\/techtalk\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17","name":"Virendra Chandak","logo":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/www.virendrachandak.com","https:\/\/www.facebook.com\/virendrachandak","https:\/\/www.linkedin.com\/in\/virendrachandak\/","https:\/\/x.com\/virendrachandak"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2vTtQ-jl","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/posts\/1199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/comments?post=1199"}],"version-history":[{"count":0,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/posts\/1199\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/media?parent=1199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/categories?post=1199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/tags?post=1199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}