{"id":586,"date":"2009-12-27T14:15:14","date_gmt":"2009-12-27T14:15:14","guid":{"rendered":"http:\/\/www.mysqltutorial.org\/?page_id=586"},"modified":"2023-12-29T02:03:56","modified_gmt":"2023-12-29T09:03:56","slug":"mysql-sample-database","status":"publish","type":"page","link":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/","title":{"rendered":"MySQL Sample Database"},"content":{"rendered":"\n<p>We use the <code>classicmodels<\/code> database as a <strong>MySQL sample database<\/strong> to help you work with MySQL quickly and effectively. <\/p>\n\n\n\n<p>The <code>classicmodels<\/code> database is a retailer of scale models of classic cars. It contains typical business data, including information about customers, products, sales orders, sales order line items, and more.<\/p>\n\n\n\n<p>We&#8217;ll use this sample database in our <a title=\"MySQL Tutorial\" href=\"https:\/\/www.mysqltutorial.org\/\">MySQL tutorials<\/a> to demonstrate a wide range of MySQL features, from <a title=\"Basic MySQL Tutorial\" href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/\">simple queries<\/a> to complex <a title=\"MySQL Stored Procedures\" href=\"https:\/\/www.mysqltutorial.org\/mysql-stored-procedure\/\">stored procedures<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Download MySQL Sample Database<\/h2>\n\n\n\n<p>You can download the sample database&nbsp;from the following link:<\/p>\n\n\n\n<p><a class=\"btn btn-primary\" href=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysqlsampledatabase.zip\">Download MySQL Sample Database<\/a><\/p>\n\n\n\n<p>The download file is in ZIP format, so you&#8217;ll need a zip program to unzip it. You can download a free zip program at <a title=\"download free zip program\" href=\"http:\/\/www.7-zip.org\" rel=\"nofollow\">www.7-zip.org<\/a>.<\/p>\n\n\n\n<p>After uncompressing the <code>sampledatabase.zip<\/code> file, you can <a href=\"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/how-to-load-sample-database-into-mysql-database-server\/\">load the sample database into the MySQL database<\/a> server by following the tutorial&nbsp;on how to do so.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MySQL Sample Database Schema<\/h2>\n\n\n\n<p>The MySQL sample database schema consists of the following tables:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>customers<\/strong>: stores customer&#8217;s data.<\/li>\n\n\n\n<li><strong>products<\/strong>: stores a list of scale model cars.<\/li>\n\n\n\n<li><strong>productlines<\/strong>: stores a list of product lines.<\/li>\n\n\n\n<li><strong>orders<\/strong>: stores sales orders placed by customers.<\/li>\n\n\n\n<li><strong>orderdetails<\/strong>: stores sales order line items for every sales order.<\/li>\n\n\n\n<li><strong>payments<\/strong>: stores payments made by customers based on their accounts.<\/li>\n\n\n\n<li><strong>employees<\/strong>: stores employee information and the organization structure such as who reports to whom.<\/li>\n\n\n\n<li><strong>offices<\/strong>: stores sales office data.<\/li>\n<\/ul>\n\n\n\n<p>The following picture illustrates the ER diagram of the sample database:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"879\" height=\"761\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysql-sample-database.png\" alt=\"MySQL Sample Database\" class=\"wp-image-11948\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysql-sample-database.png 879w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysql-sample-database-200x173.png 200w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysql-sample-database-768x665.png 768w\" sizes=\"auto, (max-width: 879px) 100vw, 879px\" \/><\/figure>\n\n\n\n<p>You can download the MySQL sample database ER diagram in PDF format from the following link:<\/p>\n\n\n\n<p><a class=\"btn btn-primary\" href=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2018\/04\/MySQL-Sample-Database-Diagram-PDF-A4.pdf\" rel=\"noopener\">Download MySQL Sample Database Diagram PDF A4<\/a><\/p>\n\n\n\n<p>We recommend printing out the ER diagram and placing it on your desk to help you become familiar with the schema as you learn MySQL.<\/p>\n\n\n\n<p>Have fun learning MySQL!<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful? <\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"586\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/\"\n\t\t\t\tdata-post-title=\"MySQL Sample Database\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"586\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/\"\n\t\t\t\tdata-post-title=\"MySQL Sample Database\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Provides a sample database to help you to practice with MySQL effectively and fast.<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":9017,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-586","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MySQL Sample Database<\/title>\n<meta name=\"description\" content=\"This page provides you with a MySQL sample database that helps you to practice with MySQL effectively and quickly.\" \/>\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.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL Sample Database\" \/>\n<meta property=\"og:description\" content=\"This page provides you with a MySQL sample database that helps you to practice with MySQL effectively and quickly.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/\" \/>\n<meta property=\"og:site_name\" content=\"MySQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-29T09:03:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysql-sample-database.png\" \/>\n<meta name=\"twitter:label1\" content=\"Est. 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:\\\/\\\/www.mysqltutorial.org\\\/getting-started-with-mysql\\\/mysql-sample-database\\\/\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/getting-started-with-mysql\\\/mysql-sample-database\\\/\",\"name\":\"MySQL Sample Database\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/getting-started-with-mysql\\\/mysql-sample-database\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/getting-started-with-mysql\\\/mysql-sample-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/mysql-sample-database.png\",\"datePublished\":\"2009-12-27T14:15:14+00:00\",\"dateModified\":\"2023-12-29T09:03:56+00:00\",\"description\":\"This page provides you with a MySQL sample database that helps you to practice with MySQL effectively and quickly.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/getting-started-with-mysql\\\/mysql-sample-database\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mysqltutorial.org\\\/getting-started-with-mysql\\\/mysql-sample-database\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/getting-started-with-mysql\\\/mysql-sample-database\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/mysql-sample-database.png\",\"contentUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/mysql-sample-database.png\",\"width\":879,\"height\":761,\"caption\":\"MySQL Sample Database\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/getting-started-with-mysql\\\/mysql-sample-database\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting Started with MySQL\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/getting-started-with-mysql\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MySQL Sample Database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\",\"name\":\"MySQL Tutorial\",\"description\":\"A comprehensive MySQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mysqltutorial.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL Sample Database","description":"This page provides you with a MySQL sample database that helps you to practice with MySQL effectively and quickly.","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.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/","og_locale":"en_US","og_type":"article","og_title":"MySQL Sample Database","og_description":"This page provides you with a MySQL sample database that helps you to practice with MySQL effectively and quickly.","og_url":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/","og_site_name":"MySQL Tutorial","article_modified_time":"2023-12-29T09:03:56+00:00","og_image":[{"url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysql-sample-database.png","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/","url":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/","name":"MySQL Sample Database","isPartOf":{"@id":"https:\/\/www.mysqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/#primaryimage"},"image":{"@id":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysql-sample-database.png","datePublished":"2009-12-27T14:15:14+00:00","dateModified":"2023-12-29T09:03:56+00:00","description":"This page provides you with a MySQL sample database that helps you to practice with MySQL effectively and quickly.","breadcrumb":{"@id":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/#primaryimage","url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysql-sample-database.png","contentUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/mysql-sample-database.png","width":879,"height":761,"caption":"MySQL Sample Database"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mysqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"Getting Started with MySQL","item":"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/"},{"@type":"ListItem","position":3,"name":"MySQL Sample Database"}]},{"@type":"WebSite","@id":"https:\/\/www.mysqltutorial.org\/#website","url":"https:\/\/www.mysqltutorial.org\/","name":"MySQL Tutorial","description":"A comprehensive MySQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mysqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/comments?post=586"}],"version-history":[{"count":5,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/586\/revisions"}],"predecessor-version":[{"id":13808,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/586\/revisions\/13808"}],"up":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/9017"}],"wp:attachment":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/media?parent=586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}