{"id":2136,"date":"2022-09-11T01:11:12","date_gmt":"2022-09-10T16:11:12","guid":{"rendered":"http:\/\/www.agile-software.site\/?p=2136"},"modified":"2022-11-06T15:39:58","modified_gmt":"2022-11-06T06:39:58","slug":"sqlite%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=2136","title":{"rendered":"SQLite\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">SQLite\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h2>\n\n\n\n<p>\u30d6\u30e9\u30a6\u30b6\u3067 SQLite \u306e\u516c\u5f0f\u30da\u30fc\u30b8\u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u30fb<a href=\"https:\/\/www.sqlite.org\/\">https:\/\/www.sqlite.org\/<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.javadrive.jp\/sqlite\/install\/img\/p1-1.png\" alt=\"SQLite\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9(1)\"\/><\/figure>\n\n\n\n<p>\u753b\u9762\u4e0a\u90e8\u306b\u3042\u308b\u30e1\u30cb\u30e5\u30fc\u306e\u4e2d\u306e\u300cDownload\u300d\u3068\u66f8\u304b\u308c\u305f\u30e1\u30cb\u30e5\u30fc\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.javadrive.jp\/sqlite\/install\/img\/p1-2.png\" alt=\"SQLite\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9(2)\"\/><\/figure>\n\n\n\n<p>SQLite \u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u4e00\u89a7\u306e\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.javadrive.jp\/sqlite\/install\/img\/p1-3.png\" alt=\"SQLite\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9(3)\"\/><\/figure>\n\n\n\n<p>\u4eca\u56de\u306fWindows10(64bit)\u306e\u74b0\u5883\u3067\u5229\u7528\u3057\u307e\u3059\u306e\u3067\u300cPrecompiled Binaries for Windows\u300d\u306e\u30d6\u30ed\u30c3\u30af\u3092\u898b\u3066\u4e0b\u3055\u3044\u3002\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u306e\u3067\u300csqlite-tools-win32-x86-3270200.zip\u300d\u3068\u66f8\u304b\u308c\u305f\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.javadrive.jp\/sqlite\/install\/img\/p1-4.png\" alt=\"SQLite\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9(4)\"\/><\/figure>\n\n\n\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u958b\u59cb\u3055\u308c\u307e\u3059\u3002\u4efb\u610f\u306e\u5834\u6240\u306b\u4fdd\u5b58\u3057\u3066\u304a\u3044\u3066\u4e0b\u3055\u3044\u3002\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306f\u4ee5\u4e0a\u3067\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SQLite\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u914d\u7f6e<\/h2>\n\n\n\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u5727\u7e2e\u30d5\u30a1\u30a4\u30eb\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u89e3\u51cd\u3057\u305f\u4e0a\u3067\u4efb\u610f\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u8a2d\u7f6e\u3057\u3066\u4e0b\u3055\u3044\u3002\u4eca\u56de\u306f c:\u00a5pg\u00a5sqlite3 \u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u30d5\u30a1\u30a4\u30eb\u3092\u8a2d\u7f6e\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.javadrive.jp\/sqlite\/install\/img\/p1-5.png\" alt=\"SQLite\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u914d\u7f6e(1)\"\/><\/figure>\n\n\n\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3067\u3042\u308b sqlite3.exe \u30012\u3064\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5dee\u5206\u3092\u8abf\u3079\u308b sqldiff.exe \u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5206\u6790\u30ec\u30dd\u30fc\u30c8\u3092\u8868\u793a\u3059\u308b sqlite3_analyzer.exe \u306e3\u3064\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n\n\n\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>#sqlite3 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\nqlite3 mydb.db<\/code><\/pre><\/div>\n\n\n\n<p>\u3068\u3044\u3046\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u65b0\u898f\u306b\u4f5c\u6210\u3055\u308c\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u304c\u884c\u306a\u308f\u308c\u3066\u3044\u307e\u3059(\u305f\u3060\u3057\u5b9f\u969b\u306b\u5b9f\u4f53\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4e2d\u306b\u30c6\u30fc\u30d6\u30eb\u306a\u3069\u30921\u3064\u4f5c\u6210\u3057\u305f\u6642\u3067\u3059)\u3002<\/p>\n\n\n\n<p>\u6b21\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4e2d\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u4e00\u3064\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>#CREATE TABLE &lt;\u30c6\u30fc\u30d6\u30eb\u540d&gt;(&lt;\u30ab\u30e9\u30e0\u540d&gt;&lt;\u30c7\u30fc\u30bf\u578b&gt;,&lt;\u30ab\u30e9\u30e0\u540d&gt;&lt;\u30c7\u30fc\u30bf\u578b&gt;,..)\nsqlite&gt; CREATE TABLE User (\n   ...&gt; UserId INTEGER PRIMARY KEY NOT NULL,\n   ...&gt; Name TEXT DEFAULT &#39;anonymous&#39;,\n   ...&gt; Email TEXT NOT NULL,\n   ...&gt; Age INTEGER CHECK(Age &gt; 0));<\/code><\/pre><\/div>\n\n\n\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u78ba\u8a8d<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>.tables<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\nsqlite&gt; INSERT INTO User (UserId, Name, Email, Age)\n   ...&gt; VALUES (1,&#39;John&#39;, &#39;John@gmail.com&#39;, 30);<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">UPDATE\u3068DELETE<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\nsqlite&gt; UPDATE User SET Email=&quot;newjohn@gmail.com&quot;\n   ...&gt; WHERE Name=&quot;John&quot;;<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\nsqlite&gt; DELETE FROM User WHERE Name=&quot;John&quot;;<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30ec\u30b3\u30fc\u30c9\u3092\u8868\u793a\u3059\u308b<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\nsqlite&gt; SELECT * FROM User;<\/code><\/pre><\/div>\n\n\n\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306e\u63a5\u7d9a\u3092\u7d42\u4e86\u3059\u308b\u306b\u306f\u300c.exit\u300d\u3068\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>.exit<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>SQLite\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 \u30d6\u30e9\u30a6\u30b6\u3067 SQLite \u306e\u516c\u5f0f\u30da\u30fc\u30b8\u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u4e0b\u3055\u3044\u3002 \u30fbhttps:\/\/www.sqlite.org\/ \u753b\u9762\u4e0a\u90e8\u306b\u3042\u308b\u30e1\u30cb\u30e5\u30fc\u306e\u4e2d\u306e\u300cDownload\u300d\u3068\u66f8\u304b\u308c\u305f\u30e1\u30cb\u30e5\u30fc\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066<\/p>\n","protected":false},"author":1,"featured_media":2235,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2136","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql"],"_links":{"self":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2136"}],"version-history":[{"count":2,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2136\/revisions"}],"predecessor-version":[{"id":2139,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2136\/revisions\/2139"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/media\/2235"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}