{"id":425,"date":"2011-07-06T12:30:34","date_gmt":"2011-07-06T12:30:34","guid":{"rendered":"https:\/\/blog.alwawee.ru\/?p=425"},"modified":"2011-07-08T15:59:42","modified_gmt":"2011-07-08T15:59:42","slug":"sqlite-on-mac-os-x-examples","status":"publish","type":"post","link":"https:\/\/blog.alwawee.ru\/?p=425","title":{"rendered":"SQLite on Mac OS X examples"},"content":{"rendered":"<p>Here I decided to write some <a href=\"http:\/\/www.sqlite.org\/\">SQLite<\/a>(SQLite on <a href=\"http:\/\/en.wikipedia.org\/wiki\/SQLite\">wiki<\/a>) on Mac OS X examples of code for creation of database and database management. <\/p>\n<p>1. Go to the folder where you want to create SQLite database (all this is written on Applications\/Services\/Terminal): <\/p>\n<p><code>cd \/Users\/user\/Documents\/<\/code><\/p>\n<p>2. Create database:<\/p>\n<p><code>sqlite3 SimpleVocabulary.sql<\/code><\/p>\n<p>3. Create table in that database: <\/p>\n<p><code>CREATE TABLE Cards(CardID VARCHAR(5) PRIMARY KEY, Word VARCHAR(1000), Translation VARCHAR(3000), MemoStatus VARCHAR(1));<\/code><\/p>\n<p>4. Insert values to the table: <\/p>\n<p><code>INSERT INTO Cards VALUES (\"1\", \"Mother\", \"Mama\", \"Y\");<\/code><\/p>\n<p>5. Select values from table: <\/p>\n<p><code>SELECT * FROM Cards;<\/code><\/p>\n<p><strong>Another code examples: <\/strong><\/p>\n<p><code>1. cd \/Users\/user\/Documents\/<br \/>\n2. sqlite3 TexDatabase.sql<br \/>\n1.SELECT * FROM Lessons;<br \/>\n2.SELECT COUNT(*) FROM Lessons;<br \/>\n3.DELETE FROM Lessons;<br \/>\n4.CREATE TABLE Lessons(LessonID VARCHAR(5) PRIMARY KEY, LessonGroup VARCHAR(5), LessonTopic VARCHAR(100), LessonText VARCHAR(20000), LessonCode VARCHAR(100), LessonPicture VARCHAR(100));<br \/>\n5.Drop table Lessons;<br \/>\n6..schema<\/code><\/p>\n<p>Here <strong>.schema<\/strong> command allows you to look at your tables structure. <\/p>\n<p><strong>Another example:<\/strong><br \/>\n<code>1. cd \/Users\/user\/Desktop\/Alwawee\/AlwaweeApps\/\u0411\u0438\u0437\u043d\u0435\u0441-\u0446\u0438\u0442\u0430\u0442\u044b\/Database<br \/>\n2. sqlite3 BusCitDatabase.sql<br \/>\n3. sqlite> CREATE TABLE BusCits(ID VARCHAR(5) PRIMARY KEY, Text VARCHAR(3000), Author VARCHAR(500));<br \/>\n4. sqlite> .quit<br \/>\n5. SELECT COUNT(*) FROM BusCits;<br \/>\n6. SELECT COUNT(*) FROM BusAuthors;<br \/>\n7. sqlite> CREATE TABLE BusAuthors(AuthorID VARCHAR(5) PRIMARY KEY, AuthorName VARCHAR(100), AuthorInfo VARCHAR(3000));<br \/>\n8. SELECT COUNT(*) FROM BusAuthors;<br \/>\n9. DELETE FROM BusAuthors;<br \/>\n10. DELETE FROM BusCits;<br \/>\n11. SELECT DISTINCT Author FROM BusCits WHERE Author NOT IN(SELECT AuthorName FROM BusAuthors);<br \/>\n12. cd \/Users\/user\/Documents\/<br \/>\n13. cd SimpVoc<br \/>\n14. sqlite3 TransWords.sql<br \/>\n15. INSERT INTO Cards VALUES (\"1\", \"Mother\", \"Madre\", \"Y\");<br \/>\n16. INSERT INTO Cards VALUES (\"2\", \"Example\", \"Ejemplo\", \"Y\");<br \/>\n17. INSERT INTO Cards VALUES (\"3\", \"World\", \"Mundo\", \"Y\");<br \/>\n18. SELECT * FROM Cards;<\/code><\/p>\n<p>Here <strong>.quit<\/strong> command quits sqlite> mode on your Terminal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here I decided to write some SQLite(SQLite on wiki) on Mac OS X examples of code for creation of database and database management. 1. Go to the folder where you want to create SQLite database (all this is written on Applications\/Services\/Terminal): cd \/Users\/user\/Documents\/ 2. Create database: sqlite3 SimpleVocabulary.sql 3. Create table in that database: CREATE [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[187,4,13,11],"class_list":["post-425","post","type-post","status-publish","format-standard","hentry","category-ios","tag-ios","tag-mac-os-x","tag-programming","tag-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQLite on Mac OS X examples - Denis Kutlubaev<\/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:\/\/blog.alwawee.ru\/?p=425\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQLite on Mac OS X examples - Denis Kutlubaev\" \/>\n<meta property=\"og:description\" content=\"Here I decided to write some SQLite(SQLite on wiki) on Mac OS X examples of code for creation of database and database management. 1. Go to the folder where you want to create SQLite database (all this is written on Applications\/Services\/Terminal): cd \/Users\/user\/Documents\/ 2. Create database: sqlite3 SimpleVocabulary.sql 3. Create table in that database: CREATE [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.alwawee.ru\/?p=425\" \/>\n<meta property=\"og:site_name\" content=\"Denis Kutlubaev\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/alwaweemobile\" \/>\n<meta property=\"article:published_time\" content=\"2011-07-06T12:30:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-07-08T15:59:42+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/blog.alwawee.com\/?attachment_id=1982\" \/>\n<meta name=\"author\" content=\"Denis Kutlubaev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Denis Kutlubaev\" \/>\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:\\\/\\\/blog.alwawee.ru\\\/?p=425#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=425\"},\"author\":{\"name\":\"Denis Kutlubaev\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\"},\"headline\":\"SQLite on Mac OS X examples\",\"datePublished\":\"2011-07-06T12:30:34+00:00\",\"dateModified\":\"2011-07-08T15:59:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=425\"},\"wordCount\":90,\"commentCount\":0,\"keywords\":[\"iOS\",\"Mac OS X\",\"Programming\",\"SQL\"],\"articleSection\":[\"iOS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.alwawee.ru\\\/?p=425#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=425\",\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=425\",\"name\":\"SQLite on Mac OS X examples - Denis Kutlubaev\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#website\"},\"datePublished\":\"2011-07-06T12:30:34+00:00\",\"dateModified\":\"2011-07-08T15:59:42+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=425#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.alwawee.ru\\\/?p=425\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=425#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.alwawee.ru\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQLite on Mac OS X examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#website\",\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/\",\"name\":\"Denis Kutlubaev\",\"description\":\"iOS Development\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.alwawee.ru\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\",\"name\":\"Denis Kutlubaev\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"caption\":\"Denis Kutlubaev\"},\"description\":\"iOS Developer, creator of Tornado Browser and many other popular apps\",\"sameAs\":[\"http:\\\/\\\/dennis.alwawee.com\"],\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQLite on Mac OS X examples - Denis Kutlubaev","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:\/\/blog.alwawee.ru\/?p=425","og_locale":"en_US","og_type":"article","og_title":"SQLite on Mac OS X examples - Denis Kutlubaev","og_description":"Here I decided to write some SQLite(SQLite on wiki) on Mac OS X examples of code for creation of database and database management. 1. Go to the folder where you want to create SQLite database (all this is written on Applications\/Services\/Terminal): cd \/Users\/user\/Documents\/ 2. Create database: sqlite3 SimpleVocabulary.sql 3. Create table in that database: CREATE [&hellip;]","og_url":"https:\/\/blog.alwawee.ru\/?p=425","og_site_name":"Denis Kutlubaev","article_publisher":"https:\/\/www.facebook.com\/alwaweemobile","article_published_time":"2011-07-06T12:30:34+00:00","article_modified_time":"2011-07-08T15:59:42+00:00","og_image":[{"url":"http:\/\/blog.alwawee.com\/?attachment_id=1982","type":"","width":"","height":""}],"author":"Denis Kutlubaev","twitter_misc":{"Written by":"Denis Kutlubaev","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.alwawee.ru\/?p=425#article","isPartOf":{"@id":"https:\/\/blog.alwawee.ru\/?p=425"},"author":{"name":"Denis Kutlubaev","@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7"},"headline":"SQLite on Mac OS X examples","datePublished":"2011-07-06T12:30:34+00:00","dateModified":"2011-07-08T15:59:42+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.alwawee.ru\/?p=425"},"wordCount":90,"commentCount":0,"keywords":["iOS","Mac OS X","Programming","SQL"],"articleSection":["iOS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.alwawee.ru\/?p=425#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.alwawee.ru\/?p=425","url":"https:\/\/blog.alwawee.ru\/?p=425","name":"SQLite on Mac OS X examples - Denis Kutlubaev","isPartOf":{"@id":"https:\/\/blog.alwawee.ru\/#website"},"datePublished":"2011-07-06T12:30:34+00:00","dateModified":"2011-07-08T15:59:42+00:00","author":{"@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7"},"breadcrumb":{"@id":"https:\/\/blog.alwawee.ru\/?p=425#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.alwawee.ru\/?p=425"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.alwawee.ru\/?p=425#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.alwawee.ru\/"},{"@type":"ListItem","position":2,"name":"SQLite on Mac OS X examples"}]},{"@type":"WebSite","@id":"https:\/\/blog.alwawee.ru\/#website","url":"https:\/\/blog.alwawee.ru\/","name":"Denis Kutlubaev","description":"iOS Development","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.alwawee.ru\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7","name":"Denis Kutlubaev","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","caption":"Denis Kutlubaev"},"description":"iOS Developer, creator of Tornado Browser and many other popular apps","sameAs":["http:\/\/dennis.alwawee.com"],"url":"https:\/\/blog.alwawee.ru\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts\/425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=425"}],"version-history":[{"count":0,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts\/425\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}