{"id":657,"date":"2018-11-12T17:10:01","date_gmt":"2018-11-12T17:10:01","guid":{"rendered":"http:\/\/learnlearn.uk\/gcsecs\/?page_id=657"},"modified":"2020-03-21T04:01:10","modified_gmt":"2020-03-21T04:01:10","slug":"sql-queries","status":"publish","type":"page","link":"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/","title":{"rendered":"SQL Queries"},"content":{"rendered":"\n<div class=\"arconix-tabs-horizontal\"><ul class=\"arconix-tabs\"><li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-SELECTQueries\"><a class=\"\" href=\"#tab-SELECTQueries\">SELECT Queries<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-SQLPractice\"><a class=\"\" href=\"#tab-SQLPractice\">SQL Practice<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-SQLandPython\"><a class=\"\" href=\"#tab-SQLandPython\">SQL and Python<\/a><\/li><\/ul>\n<div class=\"arconix-panes\"><div class=\"arconix-pane pane-SELECTQueries\">\n<h3>SELECT Query<\/h3>\n<p>This is the main query that is needed for the OCR GCSE Specification in the exam. This is the query used to retrieve data stored in a database.<\/p>\n<p>There are many other SQL queries but it is unlikely that you will be test on them.<\/p>\n<p><strong>Examples Queries<\/strong><\/p>\n<p><strong>SELECT Queries with Wildcard<\/strong><\/p>\n<p><span style=\"color: #0000ff;\">SELECT * FROM Customers;<\/span><\/p>\n<p>This would select all the columns from the customer table.<\/p>\n<p><strong>SELECT Queries with where<\/strong><\/p>\n<p><span style=\"color: #0000ff;\">SELECT Name, Telephone FROM Customers WHERE OrderID = 521;<\/span><\/p>\n<p>This would select the Name and Telephone Columns from the Customers\u00a0 table for any record where the OrderId = 521;<\/p>\n<p><strong>SELECT Queries with Logical Operators<\/strong><\/p>\n<p><span style=\"color: #0000ff;\">SELECT\u00a0 Name, Address FROM Customers WHERE Age &gt; 55;<\/span><\/p>\n<p>This would return the name and address of all cutomers who are over 55 years old<\/p>\n<\/div>\n<div class=\"arconix-pane pane-SQLPractice\">\n<h3>SQL Practice<\/h3>\n<p>The best way to learn SQL is to just practice the queries. Have a go at these sites and learn some SQL!<\/p>\n<p><strong>SQL Zoo<\/strong><\/p>\n<p>Great for practice activities<\/p>\n<p><a href=\"https:\/\/sqlzoo.net\/\">https:\/\/sqlzoo.net\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>w3Schools SQL<\/strong><\/p>\n<p>Another great site for practice<\/p>\n<p><a href=\"https:\/\/www.w3schools.com\/sql\/\">https:\/\/www.w3schools.com\/sql\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>SQL Island Game<\/strong><\/p>\n<p>Progress through this game by using SQL<\/p>\n<p><a href=\"http:\/\/wwwlgis.informatik.uni-kl.de\/extra\/game\/\">http:\/\/wwwlgis.informatik.uni-kl.de\/extra\/game\/<\/a><\/p>\n<\/div>\n<div class=\"arconix-pane pane-SQLandPython\">\n<p>You can use Python to read and write SQLite databases on your computer, which is a great way to store data when you move beyond simple text files in your GCSE Coding projects. Check out these videos on how it works:<\/p>\n<p><strong>Creating SQLite\u00a0 databases and tables<\/strong><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/ED55kTWCaq8\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><strong>Inserting Data into Databases<\/strong><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/E6tUcbnh7hM\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><strong>Retrieving data from databases<\/strong><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/niN6de6JQYw\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><strong>Updating database tables<\/strong><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/yS4V1CfNgEo\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><strong>Deleting items from databases<\/strong><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/XRs2zZoUX90\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<\/div><\/div><\/div>\n\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":70,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL Queries - GCSE Computer Science Theory<\/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:\/\/learnlearn.uk\/gcsecs\/sql-queries\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Queries - GCSE Computer Science Theory\" \/>\n<meta property=\"og:description\" content=\"&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/\" \/>\n<meta property=\"og:site_name\" content=\"GCSE Computer Science Theory\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-21T04:01:10+00:00\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/\",\"name\":\"SQL Queries - GCSE Computer Science Theory\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#website\"},\"datePublished\":\"2018-11-12T17:10:01+00:00\",\"dateModified\":\"2020-03-21T04:01:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"OCR GCSE Computer Science Home\",\"item\":\"https:\/\/learnlearn.uk\/gcsecs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Queries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#website\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/\",\"name\":\"GCSE Computer Science Theory\",\"description\":\"Just another My Blog site\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/gcsecs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#organization\",\"name\":\"GCSE Computer Science Theory\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png\",\"width\":710,\"height\":98,\"caption\":\"GCSE Computer Science Theory\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Queries - GCSE Computer Science Theory","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:\/\/learnlearn.uk\/gcsecs\/sql-queries\/","og_locale":"en_GB","og_type":"article","og_title":"SQL Queries - GCSE Computer Science Theory","og_description":"&nbsp;","og_url":"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/","og_site_name":"GCSE Computer Science Theory","article_modified_time":"2020-03-21T04:01:10+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/","url":"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/","name":"SQL Queries - GCSE Computer Science Theory","isPartOf":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/#website"},"datePublished":"2018-11-12T17:10:01+00:00","dateModified":"2020-03-21T04:01:10+00:00","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/gcsecs\/sql-queries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"OCR GCSE Computer Science Home","item":"https:\/\/learnlearn.uk\/gcsecs\/"},{"@type":"ListItem","position":2,"name":"SQL Queries"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/gcsecs\/#website","url":"https:\/\/learnlearn.uk\/gcsecs\/","name":"GCSE Computer Science Theory","description":"Just another My Blog site","publisher":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/gcsecs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/gcsecs\/#organization","name":"GCSE Computer Science Theory","url":"https:\/\/learnlearn.uk\/gcsecs\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png","contentUrl":"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png","width":710,"height":98,"caption":"GCSE Computer Science Theory"},"image":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/"}}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/gcsecs\/author\/learnlearnadmin\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":"&nbsp;","_links":{"self":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages\/657"}],"collection":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/comments?post=657"}],"version-history":[{"count":6,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages\/657\/revisions"}],"predecessor-version":[{"id":944,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages\/657\/revisions\/944"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/media?parent=657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}