Advertisement
HandieAndy

sqlite_tutorial

Mar 2nd, 2021
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.70 KB | None | 0 0
  1. SQLite version 3.34.1 2021-01-20 14:10:07
  2. Enter ".help" for usage hints.
  3. Connected to a transient in-memory database.
  4. Use ".open FILENAME" to reopen on a persistent database.
  5. sqlite> .help
  6. .auth ON|OFF Show authorizer callbacks
  7. .backup ?DB? FILE Backup DB (default "main") to FILE
  8. .bail on|off Stop after hitting an error. Default OFF
  9. .binary on|off Turn binary output on or off. Default OFF
  10. .cd DIRECTORY Change the working directory to DIRECTORY
  11. .changes on|off Show number of rows changed by SQL
  12. .check GLOB Fail if output since .testcase does not match
  13. .clone NEWDB Clone data into NEWDB from the existing database
  14. .databases List names and files of attached databases
  15. .dbconfig ?op? ?val? List or change sqlite3_db_config() options
  16. .dbinfo ?DB? Show status information about the database
  17. .dump ?TABLE? Render database content as SQL
  18. .echo on|off Turn command echo on or off
  19. .eqp on|off|full|... Enable or disable automatic EXPLAIN QUERY PLAN
  20. .excel Display the output of next command in spreadsheet
  21. .exit ?CODE? Exit this program with return-code CODE
  22. .expert EXPERIMENTAL. Suggest indexes for queries
  23. .explain ?on|off|auto? Change the EXPLAIN formatting mode. Default: auto
  24. .filectrl CMD ... Run various sqlite3_file_control() operations
  25. .fullschema ?--indent? Show schema and the content of sqlite_stat tables
  26. .headers on|off Turn display of headers on or off
  27. .help ?-all? ?PATTERN? Show help text for PATTERN
  28. .import FILE TABLE Import data from FILE into TABLE
  29. .imposter INDEX TABLE Create imposter table TABLE on index INDEX
  30. .indexes ?TABLE? Show names of indexes
  31. .limit ?LIMIT? ?VAL? Display or change the value of an SQLITE_LIMIT
  32. .lint OPTIONS Report potential schema issues.
  33. .log FILE|off Turn logging on or off. FILE can be stderr/stdout
  34. .mode MODE ?TABLE? Set output mode
  35. .nullvalue STRING Use STRING in place of NULL values
  36. .once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE
  37. .open ?OPTIONS? ?FILE? Close existing database and reopen FILE
  38. .output ?FILE? Send output to FILE or stdout if FILE is omitted
  39. .parameter CMD ... Manage SQL parameter bindings
  40. .print STRING... Print literal STRING
  41. .progress N Invoke progress handler after every N opcodes
  42. .prompt MAIN CONTINUE Replace the standard prompts
  43. .quit Exit this program
  44. .read FILE Read input from FILE
  45. .restore ?DB? FILE Restore content of DB (default "main") from FILE
  46. .save FILE Write in-memory database into FILE
  47. .scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off
  48. .schema ?PATTERN? Show the CREATE statements matching PATTERN
  49. .selftest ?OPTIONS? Run tests defined in the SELFTEST table
  50. .separator COL ?ROW? Change the column and row separators
  51. .sha3sum ... Compute a SHA3 hash of database content
  52. .shell CMD ARGS... Run CMD ARGS... in a system shell
  53. .show Show the current values for various settings
  54. .stats ?on|off? Show stats or turn stats on or off
  55. .system CMD ARGS... Run CMD ARGS... in a system shell
  56. .tables ?TABLE? List names of tables matching LIKE pattern TABLE
  57. .testcase NAME Begin redirecting output to 'testcase-out.txt'
  58. .testctrl CMD ... Run various sqlite3_test_control() operations
  59. .timeout MS Try opening locked tables for MS milliseconds
  60. .timer on|off Turn SQL timer on or off
  61. .trace ?OPTIONS? Output each SQL statement as it is run
  62. .vfsinfo ?AUX? Information about the top-level VFS
  63. .vfslist List all available VFSes
  64. .vfsname ?AUX? Print the name of the VFS stack
  65. .width NUM1 NUM2 ... Set minimum column widths for columnar output
  66. sqlite> CREATE TABLE users (
  67. ...> id INTEGER PRIMARY KEY AUTOINCREMENT,
  68. ...> name TEXT NOT NULL UNIQUE
  69. ...> );
  70. sqlite> SELECT * FROM users;
  71. sqlite> SELECT * FROM usersa;
  72. Error: no such table: usersa
  73. sqlite> INSERT INTO users (name) VALUES ('Andrew');
  74. sqlite> SELECT * FROM users;
  75. 1|Andrew
  76. sqlite> INSERT INTO users (name) VALUES ('Andrew');
  77. Error: UNIQUE constraint failed: users.name
  78. sqlite> INSERT INTO users (id, name) VALUES (1, 'Andrew2');
  79. Error: UNIQUE constraint failed: users.id
  80. sqlite> INSERT INTO users (id, name) VALUES (2, 'Andrew2');
  81. sqlite> SELECT * FROM users;
  82. 1|Andrew
  83. 2|Andrew2
  84. sqlite> INSERT INTO users (name) VALUES ('Andrew3');
  85. sqlite> SELECT * FROM users;
  86. 1|Andrew
  87. 2|Andrew2
  88. 3|Andrew3
  89. sqlite> INSERT INTO users (id, name) VALUES (5, 'Andrew5');
  90. sqlite> SELECT * FROM users;
  91. 1|Andrew
  92. 2|Andrew2
  93. 3|Andrew3
  94. 5|Andrew5
  95. sqlite> INSERT INTO users (name) VALUES ('Andrew6');
  96. sqlite> SELECT * FROM users;
  97. 1|Andrew
  98. 2|Andrew2
  99. 3|Andrew3
  100. 5|Andrew5
  101. 6|Andrew6
  102. sqlite> drop table users;
  103. sqlite> CREATE TABLE vehicle (
  104. ...> vin INTEGER PRIMARY KEY AUTOINCREMENT,
  105. ...> price INTEGER NOT NULL,
  106. ...> model TEXT NOT NULL UNIQUE
  107. ...> );
  108. sqlite> CREATE TABLE car (
  109. ...> vin INTEGER PRIMARY KEY,
  110. ...> engine_size REAL NOT NULL,
  111. ...> FOREIGN KEY (vin) REFERENCES vehicle(vin) ON UPDATE CASCADE ON DELETE CASCADE
  112. ...> );
  113. sqlite> insert into vehicle (vin, price, model) values (1, 5, 'a');
  114. sqlite> select * from vehicle;
  115. 1|5|a
  116. sqlite> insert into car (vin, engine_size) values (1, 5.5);
  117. sqlite> insert into car (vin, engine_size) values (2, 5.5);
  118. sqlite> PRAGMA foreign_keys = ON;
  119. sqlite> insert into car (vin, engine_size) values (3, 5.5);
  120. Error: FOREIGN KEY constraint failed
  121. sqlite> select * from car;
  122. 1|5.5
  123. 2|5.5
  124. sqlite> delete from car where vin = 2;
  125. sqlite> select * from car;
  126. 1|5.5
  127. sqlite> select * from vehicle;
  128. 1|5|a
  129. sqlite> UPDATE vehicle SET vin = 42 WHERE vin = 1;
  130. sqlite> select * from vehicle;
  131. 42|5|a
  132. sqlite> select * from car;
  133. 42|5.5
  134. sqlite> delete from vehicle;
  135. sqlite> select * from car;
  136. sqlite> CREATE TABLE suv (
  137. ...> vin INTEGER PRIMARY KEY,
  138. ...> seat_count INTEGER NOT NULL DEFAULT 4,
  139. ...> FOREIGN KEY (vin) REFERENCES vehicle(vin) ON UPDATE CASCADE ON DELETE CASCADE
  140. ...> );
  141. sqlite> insert into vehicle (vin, price, model) values (1, 5, 'a');
  142. sqlite> insert into suv (vin) values (1);
  143. sqlite> select * from suv;
  144. 1|4
  145. sqlite> .open Northwind_small.sqlite
  146. sqlite> select * from Customer;
  147. ALFKI|Alfreds Futterkiste|Maria Anders|Sales Representative|Obere Str. 57|Berlin|Western Europe|12209|Germany|030-0074321|030-0076545
  148. ANATR|Ana Trujillo Emparedados y helados|Ana Trujillo|Owner|Avda. de la Constitución 2222|México D.F.|Central America|05021|Mexico|(5) 555-4729|(5) 555-3745
  149. ANTON|Antonio Moreno Taquería|Antonio Moreno|Owner|Mataderos 2312|México D.F.|Central America|05023|Mexico|(5) 555-3932|
  150. AROUT|Around the Horn|Thomas Hardy|Sales Representative|120 Hanover Sq.|London|British Isles|WA1 1DP|UK|(171) 555-7788|(171) 555-6750
  151. BERGS|Berglunds snabbköp|Christina Berglund|Order Administrator|Berguvsvägen 8|Luleå|Northern Europe|S-958 22|Sweden|0921-12 34 65|0921-12 34 67
  152. BLAUS|Blauer See Delikatessen|Hanna Moos|Sales Representative|Forsterstr. 57|Mannheim|Western Europe|68306|Germany|0621-08460|0621-08924
  153. BLONP|Blondesddsl père et fils|Frédérique Citeaux|Marketing Manager|24, place Kléber|Strasbourg|Western Europe|67000|France|88.60.15.31|88.60.15.32
  154. BOLID|Bólido Comidas preparadas|Martín Sommer|Owner|C/ Araquil, 67|Madrid|Southern Europe|28023|Spain|(91) 555 22 82|(91) 555 91 99
  155. BONAP|Bon app|Laurence Lebihan|Owner|12, rue des Bouchers|Marseille|Western Europe|13008|France|91.24.45.40|91.24.45.41
  156. BOTTM|Bottom-Dollar Markets|Elizabeth Lincoln|Accounting Manager|23 Tsawassen Blvd.|Tsawassen|North America|T2F 8M4|Canada|(604) 555-4729|(604) 555-3745
  157. BSBEV|B's Beverages|Victoria Ashworth|Sales Representative|Fauntleroy Circus|London|British Isles|EC2 5NT|UK|(171) 555-1212|
  158. CACTU|Cactus Comidas para llevar|Patricio Simpson|Sales Agent|Cerrito 333|Buenos Aires|South America|1010|Argentina|(1) 135-5555|(1) 135-4892
  159. CENTC|Centro comercial Moctezuma|Francisco Chang|Marketing Manager|Sierras de Granada 9993|México D.F.|Central America|05022|Mexico|(5) 555-3392|(5) 555-7293
  160. CHOPS|Chop-suey Chinese|Yang Wang|Owner|Hauptstr. 29|Bern|Western Europe|3012|Switzerland|0452-076545|
  161. COMMI|Comércio Mineiro|Pedro Afonso|Sales Associate|Av. dos Lusíadas, 23|Sao Paulo|South America|05432-043|Brazil|(11) 555-7647|
  162. CONSH|Consolidated Holdings|Elizabeth Brown|Sales Representative|Berkeley Gardens 12 Brewery|London|British Isles|WX1 6LT|UK|(171) 555-2282|(171) 555-9199
  163. DRACD|Drachenblut Delikatessen|Sven Ottlieb|Order Administrator|Walserweg 21|Aachen|Western Europe|52066|Germany|0241-039123|0241-059428
  164. DUMON|Du monde entier|Janine Labrune|Owner|67, rue des Cinquante Otages|Nantes|Western Europe|44000|France|40.67.88.88|40.67.89.89
  165. EASTC|Eastern Connection|Ann Devon|Sales Agent|35 King George|London|British Isles|WX3 6FW|UK|(171) 555-0297|(171) 555-3373
  166. ERNSH|Ernst Handel|Roland Mendel|Sales Manager|Kirchgasse 6|Graz|Western Europe|8010|Austria|7675-3425|7675-3426
  167. FAMIA|Familia Arquibaldo|Aria Cruz|Marketing Assistant|Rua Orós, 92|Sao Paulo|South America|05442-030|Brazil|(11) 555-9857|
  168. FISSA|FISSA Fabrica Inter. Salchichas S.A.|Diego Roel|Accounting Manager|C/ Moralzarzal, 86|Madrid|Southern Europe|28034|Spain|(91) 555 94 44|(91) 555 55 93
  169. FOLIG|Folies gourmandes|Martine Rancé|Assistant Sales Agent|184, chaussée de Tournai|Lille|Western Europe|59000|France|20.16.10.16|20.16.10.17
  170. FOLKO|Folk och fä HB|Maria Larsson|Owner|Åkergatan 24|Bräcke|Northern Europe|S-844 67|Sweden|0695-34 67 21|
  171. FRANK|Frankenversand|Peter Franken|Marketing Manager|Berliner Platz 43|München|Western Europe|80805|Germany|089-0877310|089-0877451
  172. FRANR|France restauration|Carine Schmitt|Marketing Manager|54, rue Royale|Nantes|Western Europe|44000|France|40.32.21.21|40.32.21.20
  173. FRANS|Franchi S.p.A.|Paolo Accorti|Sales Representative|Via Monte Bianco 34|Torino|Southern Europe|10100|Italy|011-4988260|011-4988261
  174. FURIB|Furia Bacalhau e Frutos do Mar|Lino Rodriguez|Sales Manager|Jardim das rosas n. 32|Lisboa|Southern Europe|1675|Portugal|(1) 354-2534|(1) 354-2535
  175. GALED|Galería del gastrónomo|Eduardo Saavedra|Marketing Manager|Rambla de Cataluña, 23|Barcelona|Southern Europe|08022|Spain|(93) 203 4560|(93) 203 4561
  176. GODOS|Godos Cocina Típica|José Pedro Freyre|Sales Manager|C/ Romero, 33|Sevilla|Southern Europe|41101|Spain|(95) 555 82 82|
  177. GOURL|Gourmet Lanchonetes|André Fonseca|Sales Associate|Av. Brasil, 442|Campinas|South America|04876-786|Brazil|(11) 555-9482|
  178. GREAL|Great Lakes Food Market|Howard Snyder|Marketing Manager|2732 Baker Blvd.|Eugene|North America|97403|USA|(503) 555-7555|
  179. GROSR|GROSELLA-Restaurante|Manuel Pereira|Owner|5ª Ave. Los Palos Grandes|Caracas|South America|1081|Venezuela|(2) 283-2951|(2) 283-3397
  180. HANAR|Hanari Carnes|Mario Pontes|Accounting Manager|Rua do Paço, 67|Rio de Janeiro|South America|05454-876|Brazil|(21) 555-0091|(21) 555-8765
  181. HILAA|HILARION-Abastos|Carlos Hernández|Sales Representative|Carrera 22 con Ave. Carlos Soublette #8-35|San Cristóbal|South America|5022|Venezuela|(5) 555-1340|(5) 555-1948
  182. HUNGC|Hungry Coyote Import Store|Yoshi Latimer|Sales Representative|City Center Plaza 516 Main St.|Elgin|North America|97827|USA|(503) 555-6874|(503) 555-2376
  183. HUNGO|Hungry Owl All-Night Grocers|Patricia McKenna|Sales Associate|8 Johnstown Road|Cork|British Isles||Ireland|2967 542|2967 3333
  184. ISLAT|Island Trading|Helen Bennett|Marketing Manager|Garden House Crowther Way|Cowes|British Isles|PO31 7PJ|UK|(198) 555-8888|
  185. KOENE|Königlich Essen|Philip Cramer|Sales Associate|Maubelstr. 90|Brandenburg|Western Europe|14776|Germany|0555-09876|
  186. LACOR|La corne d'abondance|Daniel Tonini|Sales Representative|67, avenue de l'Europe|Versailles|Western Europe|78000|France|30.59.84.10|30.59.85.11
  187. LAMAI|La maison d'Asie|Annette Roulet|Sales Manager|1 rue Alsace-Lorraine|Toulouse|Western Europe|31000|France|61.77.61.10|61.77.61.11
  188. LAUGB|Laughing Bacchus Wine Cellars|Yoshi Tannamuri|Marketing Assistant|1900 Oak St.|Vancouver|North America|V3F 2K1|Canada|(604) 555-3392|(604) 555-7293
  189. LAZYK|Lazy K Kountry Store|John Steel|Marketing Manager|12 Orchestra Terrace|Walla Walla|North America|99362|USA|(509) 555-7969|(509) 555-6221
  190. LEHMS|Lehmanns Marktstand|Renate Messner|Sales Representative|Magazinweg 7|Frankfurt a.M.|Western Europe|60528|Germany|069-0245984|069-0245874
  191. LETSS|Let's Stop N Shop|Jaime Yorres|Owner|87 Polk St. Suite 5|San Francisco|North America|94117|USA|(415) 555-5938|
  192. LILAS|LILA-Supermercado|Carlos González|Accounting Manager|Carrera 52 con Ave. Bolívar #65-98 Llano Largo|Barquisimeto|South America|3508|Venezuela|(9) 331-6954|(9) 331-7256
  193. LINOD|LINO-Delicateses|Felipe Izquierdo|Owner|Ave. 5 de Mayo Porlamar|I. de Margarita|South America|4980|Venezuela|(8) 34-56-12|(8) 34-93-93
  194. LONEP|Lonesome Pine Restaurant|Fran Wilson|Sales Manager|89 Chiaroscuro Rd.|Portland|North America|97219|USA|(503) 555-9573|(503) 555-9646
  195. MAGAA|Magazzini Alimentari Riuniti|Giovanni Rovelli|Marketing Manager|Via Ludovico il Moro 22|Bergamo|Southern Europe|24100|Italy|035-640230|035-640231
  196. MAISD|Maison Dewey|Catherine Dewey|Sales Agent|Rue Joseph-Bens 532|Bruxelles|Western Europe|B-1180|Belgium|(02) 201 24 67|(02) 201 24 68
  197. MEREP|Mère Paillarde|Jean Fresnière|Marketing Assistant|43 rue St. Laurent|Montréal|North America|H1J 1C3|Canada|(514) 555-8054|(514) 555-8055
  198. MORGK|Morgenstern Gesundkost|Alexander Feuer|Marketing Assistant|Heerstr. 22|Leipzig|Western Europe|04179|Germany|0342-023176|
  199. NORTS|North/South|Simon Crowther|Sales Associate|South House 300 Queensbridge|London|British Isles|SW7 1RZ|UK|(171) 555-7733|(171) 555-2530
  200. OCEAN|Océano Atlántico Ltda.|Yvonne Moncada|Sales Agent|Ing. Gustavo Moncada 8585 Piso 20-A|Buenos Aires|South America|1010|Argentina|(1) 135-5333|(1) 135-5535
  201. OLDWO|Old World Delicatessen|Rene Phillips|Sales Representative|2743 Bering St.|Anchorage|North America|99508|USA|(907) 555-7584|(907) 555-2880
  202. OTTIK|Ottilies Käseladen|Henriette Pfalzheim|Owner|Mehrheimerstr. 369|Köln|Western Europe|50739|Germany|0221-0644327|0221-0765721
  203. PARIS|Paris spécialités|Marie Bertrand|Owner|265, boulevard Charonne|Paris|Western Europe|75012|France|(1) 42.34.22.66|(1) 42.34.22.77
  204. PERIC|Pericles Comidas clásicas|Guillermo Fernández|Sales Representative|Calle Dr. Jorge Cash 321|México D.F.|Central America|05033|Mexico|(5) 552-3745|(5) 545-3745
  205. PICCO|Piccolo und mehr|Georg Pipps|Sales Manager|Geislweg 14|Salzburg|Western Europe|5020|Austria|6562-9722|6562-9723
  206. PRINI|Princesa Isabel Vinhos|Isabel de Castro|Sales Representative|Estrada da saúde n. 58|Lisboa|Southern Europe|1756|Portugal|(1) 356-5634|
  207. QUEDE|Que Delícia|Bernardo Batista|Accounting Manager|Rua da Panificadora, 12|Rio de Janeiro|South America|02389-673|Brazil|(21) 555-4252|(21) 555-4545
  208. QUEEN|Queen Cozinha|Lúcia Carvalho|Marketing Assistant|Alameda dos Canàrios, 891|Sao Paulo|South America|05487-020|Brazil|(11) 555-1189|
  209. QUICK|QUICK-Stop|Horst Kloss|Accounting Manager|Taucherstraße 10|Cunewalde|Western Europe|01307|Germany|0372-035188|
  210. RANCH|Rancho grande|Sergio Gutiérrez|Sales Representative|Av. del Libertador 900|Buenos Aires|South America|1010|Argentina|(1) 123-5555|(1) 123-5556
  211. RATTC|Rattlesnake Canyon Grocery|Paula Wilson|Assistant Sales Representative|2817 Milton Dr.|Albuquerque|North America|87110|USA|(505) 555-5939|(505) 555-3620
  212. REGGC|Reggiani Caseifici|Maurizio Moroni|Sales Associate|Strada Provinciale 124|Reggio Emilia|Southern Europe|42100|Italy|0522-556721|0522-556722
  213. RICAR|Ricardo Adocicados|Janete Limeira|Assistant Sales Agent|Av. Copacabana, 267|Rio de Janeiro|South America|02389-890|Brazil|(21) 555-3412|
  214. RICSU|Richter Supermarkt|Michael Holz|Sales Manager|Grenzacherweg 237|Genève|Western Europe|1203|Switzerland|0897-034214|
  215. ROMEY|Romero y tomillo|Alejandra Camino|Accounting Manager|Gran Vía, 1|Madrid|Southern Europe|28001|Spain|(91) 745 6200|(91) 745 6210
  216. SANTG|Santé Gourmet|Jonas Bergulfsen|Owner|Erling Skakkes gate 78|Stavern|Scandinavia|4110|Norway|07-98 92 35|07-98 92 47
  217. SAVEA|Save-a-lot Markets|Jose Pavarotti|Sales Representative|187 Suffolk Ln.|Boise|North America|83720|USA|(208) 555-8097|
  218. SEVES|Seven Seas Imports|Hari Kumar|Sales Manager|90 Wadhurst Rd.|London|British Isles|OX15 4NB|UK|(171) 555-1717|(171) 555-5646
  219. SIMOB|Simons bistro|Jytte Petersen|Owner|Vinbæltet 34|Kobenhavn|Northern Europe|1734|Denmark|31 12 34 56|31 13 35 57
  220. SPECD|Spécialités du monde|Dominique Perrier|Marketing Manager|25, rue Lauriston|Paris|Western Europe|75016|France|(1) 47.55.60.10|(1) 47.55.60.20
  221. SPLIR|Split Rail Beer & Ale|Art Braunschweiger|Sales Manager|P.O. Box 555|Lander|North America|82520|USA|(307) 555-4680|(307) 555-6525
  222. SUPRD|Suprêmes délices|Pascale Cartrain|Accounting Manager|Boulevard Tirou, 255|Charleroi|Western Europe|B-6000|Belgium|(071) 23 67 22 20|(071) 23 67 22 21
  223. THEBI|The Big Cheese|Liz Nixon|Marketing Manager|89 Jefferson Way Suite 2|Portland|North America|97201|USA|(503) 555-3612|
  224. THECR|The Cracker Box|Liu Wong|Marketing Assistant|55 Grizzly Peak Rd.|Butte|North America|59801|USA|(406) 555-5834|(406) 555-8083
  225. TOMSP|Toms Spezialitäten|Karin Josephs|Marketing Manager|Luisenstr. 48|Münster|Western Europe|44087|Germany|0251-031259|0251-035695
  226. TORTU|Tortuga Restaurante|Miguel Angel Paolino|Owner|Avda. Azteca 123|México D.F.|Central America|05033|Mexico|(5) 555-2933|
  227. TRADH|Tradiçao Hipermercados|Anabela Domingues|Sales Representative|Av. Inês de Castro, 414|Sao Paulo|South America|05634-030|Brazil|(11) 555-2167|(11) 555-2168
  228. TRAIH|Trail's Head Gourmet Provisioners|Helvetius Nagy|Sales Associate|722 DaVinci Blvd.|Kirkland|North America|98034|USA|(206) 555-8257|(206) 555-2174
  229. VAFFE|Vaffeljernet|Palle Ibsen|Sales Manager|Smagsloget 45|Århus|Northern Europe|8200|Denmark|86 21 32 43|86 22 33 44
  230. VICTE|Victuailles en stock|Mary Saveley|Sales Agent|2, rue du Commerce|Lyon|Western Europe|69004|France|78.32.54.86|78.32.54.87
  231. VINET|Vins et alcools Chevalier|Paul Henriot|Accounting Manager|59 rue de l'Abbaye|Reims|Western Europe|51100|France|26.47.15.10|26.47.15.11
  232. WANDK|Die Wandernde Kuh|Rita Müller|Sales Representative|Adenauerallee 900|Stuttgart|Western Europe|70563|Germany|0711-020361|0711-035428
  233. WARTH|Wartian Herkku|Pirkko Koskitalo|Accounting Manager|Torikatu 38|Oulu|Scandinavia|90110|Finland|981-443655|981-443655
  234. WELLI|Wellington Importadora|Paula Parente|Sales Manager|Rua do Mercado, 12|Resende|South America|08737-363|Brazil|(14) 555-8122|
  235. WHITC|White Clover Markets|Karl Jablonski|Owner|305 - 14th Ave. S. Suite 3B|Seattle|North America|98128|USA|(206) 555-4112|(206) 555-4115
  236. WILMK|Wilman Kala|Matti Karttunen|Owner/Marketing Assistant|Keskuskatu 45|Helsinki|Scandinavia|21240|Finland|90-224 8858|90-224 8858
  237. WOLZA|Wolski Zajazd|Zbyszek Piestrzeniewicz|Owner|ul. Filtrowa 68|Warszawa|Eastern Europe|01-012|Poland|(26) 642-7012|(26) 642-7012
  238. sqlite> SELECT Id, ContactName FROM Customer;
  239. ALFKI|Maria Anders
  240. ANATR|Ana Trujillo
  241. ANTON|Antonio Moreno
  242. AROUT|Thomas Hardy
  243. BERGS|Christina Berglund
  244. BLAUS|Hanna Moos
  245. BLONP|Frédérique Citeaux
  246. BOLID|Martín Sommer
  247. BONAP|Laurence Lebihan
  248. BOTTM|Elizabeth Lincoln
  249. BSBEV|Victoria Ashworth
  250. CACTU|Patricio Simpson
  251. CENTC|Francisco Chang
  252. CHOPS|Yang Wang
  253. COMMI|Pedro Afonso
  254. CONSH|Elizabeth Brown
  255. DRACD|Sven Ottlieb
  256. DUMON|Janine Labrune
  257. EASTC|Ann Devon
  258. ERNSH|Roland Mendel
  259. FAMIA|Aria Cruz
  260. FISSA|Diego Roel
  261. FOLIG|Martine Rancé
  262. FOLKO|Maria Larsson
  263. FRANK|Peter Franken
  264. FRANR|Carine Schmitt
  265. FRANS|Paolo Accorti
  266. FURIB|Lino Rodriguez
  267. GALED|Eduardo Saavedra
  268. GODOS|José Pedro Freyre
  269. GOURL|André Fonseca
  270. GREAL|Howard Snyder
  271. GROSR|Manuel Pereira
  272. HANAR|Mario Pontes
  273. HILAA|Carlos Hernández
  274. HUNGC|Yoshi Latimer
  275. HUNGO|Patricia McKenna
  276. ISLAT|Helen Bennett
  277. KOENE|Philip Cramer
  278. LACOR|Daniel Tonini
  279. LAMAI|Annette Roulet
  280. LAUGB|Yoshi Tannamuri
  281. LAZYK|John Steel
  282. LEHMS|Renate Messner
  283. LETSS|Jaime Yorres
  284. LILAS|Carlos González
  285. LINOD|Felipe Izquierdo
  286. LONEP|Fran Wilson
  287. MAGAA|Giovanni Rovelli
  288. MAISD|Catherine Dewey
  289. MEREP|Jean Fresnière
  290. MORGK|Alexander Feuer
  291. NORTS|Simon Crowther
  292. OCEAN|Yvonne Moncada
  293. OLDWO|Rene Phillips
  294. OTTIK|Henriette Pfalzheim
  295. PARIS|Marie Bertrand
  296. PERIC|Guillermo Fernández
  297. PICCO|Georg Pipps
  298. PRINI|Isabel de Castro
  299. QUEDE|Bernardo Batista
  300. QUEEN|Lúcia Carvalho
  301. QUICK|Horst Kloss
  302. RANCH|Sergio Gutiérrez
  303. RATTC|Paula Wilson
  304. REGGC|Maurizio Moroni
  305. RICAR|Janete Limeira
  306. RICSU|Michael Holz
  307. ROMEY|Alejandra Camino
  308. SANTG|Jonas Bergulfsen
  309. SAVEA|Jose Pavarotti
  310. SEVES|Hari Kumar
  311. SIMOB|Jytte Petersen
  312. SPECD|Dominique Perrier
  313. SPLIR|Art Braunschweiger
  314. SUPRD|Pascale Cartrain
  315. THEBI|Liz Nixon
  316. THECR|Liu Wong
  317. TOMSP|Karin Josephs
  318. TORTU|Miguel Angel Paolino
  319. TRADH|Anabela Domingues
  320. TRAIH|Helvetius Nagy
  321. VAFFE|Palle Ibsen
  322. VICTE|Mary Saveley
  323. VINET|Paul Henriot
  324. WANDK|Rita Müller
  325. WARTH|Pirkko Koskitalo
  326. WELLI|Paula Parente
  327. WHITC|Karl Jablonski
  328. WILMK|Matti Karttunen
  329. WOLZA|Zbyszek Piestrzeniewicz
  330. sqlite> SELECT Id, ContactName FROM Customer ORDER BY ContactName;
  331. ROMEY|Alejandra Camino
  332. MORGK|Alexander Feuer
  333. ANATR|Ana Trujillo
  334. TRADH|Anabela Domingues
  335. GOURL|André Fonseca
  336. EASTC|Ann Devon
  337. LAMAI|Annette Roulet
  338. ANTON|Antonio Moreno
  339. FAMIA|Aria Cruz
  340. SPLIR|Art Braunschweiger
  341. QUEDE|Bernardo Batista
  342. FRANR|Carine Schmitt
  343. LILAS|Carlos González
  344. HILAA|Carlos Hernández
  345. MAISD|Catherine Dewey
  346. BERGS|Christina Berglund
  347. LACOR|Daniel Tonini
  348. FISSA|Diego Roel
  349. SPECD|Dominique Perrier
  350. GALED|Eduardo Saavedra
  351. CONSH|Elizabeth Brown
  352. BOTTM|Elizabeth Lincoln
  353. LINOD|Felipe Izquierdo
  354. LONEP|Fran Wilson
  355. CENTC|Francisco Chang
  356. BLONP|Frédérique Citeaux
  357. PICCO|Georg Pipps
  358. MAGAA|Giovanni Rovelli
  359. PERIC|Guillermo Fernández
  360. BLAUS|Hanna Moos
  361. SEVES|Hari Kumar
  362. ISLAT|Helen Bennett
  363. TRAIH|Helvetius Nagy
  364. OTTIK|Henriette Pfalzheim
  365. QUICK|Horst Kloss
  366. GREAL|Howard Snyder
  367. PRINI|Isabel de Castro
  368. LETSS|Jaime Yorres
  369. RICAR|Janete Limeira
  370. DUMON|Janine Labrune
  371. MEREP|Jean Fresnière
  372. LAZYK|John Steel
  373. SANTG|Jonas Bergulfsen
  374. SAVEA|Jose Pavarotti
  375. GODOS|José Pedro Freyre
  376. SIMOB|Jytte Petersen
  377. TOMSP|Karin Josephs
  378. WHITC|Karl Jablonski
  379. BONAP|Laurence Lebihan
  380. FURIB|Lino Rodriguez
  381. THECR|Liu Wong
  382. THEBI|Liz Nixon
  383. QUEEN|Lúcia Carvalho
  384. GROSR|Manuel Pereira
  385. ALFKI|Maria Anders
  386. FOLKO|Maria Larsson
  387. PARIS|Marie Bertrand
  388. HANAR|Mario Pontes
  389. FOLIG|Martine Rancé
  390. BOLID|Martín Sommer
  391. VICTE|Mary Saveley
  392. WILMK|Matti Karttunen
  393. REGGC|Maurizio Moroni
  394. RICSU|Michael Holz
  395. TORTU|Miguel Angel Paolino
  396. VAFFE|Palle Ibsen
  397. FRANS|Paolo Accorti
  398. SUPRD|Pascale Cartrain
  399. HUNGO|Patricia McKenna
  400. CACTU|Patricio Simpson
  401. VINET|Paul Henriot
  402. WELLI|Paula Parente
  403. RATTC|Paula Wilson
  404. COMMI|Pedro Afonso
  405. FRANK|Peter Franken
  406. KOENE|Philip Cramer
  407. WARTH|Pirkko Koskitalo
  408. LEHMS|Renate Messner
  409. OLDWO|Rene Phillips
  410. WANDK|Rita Müller
  411. ERNSH|Roland Mendel
  412. RANCH|Sergio Gutiérrez
  413. NORTS|Simon Crowther
  414. DRACD|Sven Ottlieb
  415. AROUT|Thomas Hardy
  416. BSBEV|Victoria Ashworth
  417. CHOPS|Yang Wang
  418. HUNGC|Yoshi Latimer
  419. LAUGB|Yoshi Tannamuri
  420. OCEAN|Yvonne Moncada
  421. WOLZA|Zbyszek Piestrzeniewicz
  422. sqlite> SELECT Id, ContactName FROM Customer ORDER BY ContactName ASC;
  423. ROMEY|Alejandra Camino
  424. MORGK|Alexander Feuer
  425. ANATR|Ana Trujillo
  426. TRADH|Anabela Domingues
  427. GOURL|André Fonseca
  428. EASTC|Ann Devon
  429. LAMAI|Annette Roulet
  430. ANTON|Antonio Moreno
  431. FAMIA|Aria Cruz
  432. SPLIR|Art Braunschweiger
  433. QUEDE|Bernardo Batista
  434. FRANR|Carine Schmitt
  435. LILAS|Carlos González
  436. HILAA|Carlos Hernández
  437. MAISD|Catherine Dewey
  438. BERGS|Christina Berglund
  439. LACOR|Daniel Tonini
  440. FISSA|Diego Roel
  441. SPECD|Dominique Perrier
  442. GALED|Eduardo Saavedra
  443. CONSH|Elizabeth Brown
  444. BOTTM|Elizabeth Lincoln
  445. LINOD|Felipe Izquierdo
  446. LONEP|Fran Wilson
  447. CENTC|Francisco Chang
  448. BLONP|Frédérique Citeaux
  449. PICCO|Georg Pipps
  450. MAGAA|Giovanni Rovelli
  451. PERIC|Guillermo Fernández
  452. BLAUS|Hanna Moos
  453. SEVES|Hari Kumar
  454. ISLAT|Helen Bennett
  455. TRAIH|Helvetius Nagy
  456. OTTIK|Henriette Pfalzheim
  457. QUICK|Horst Kloss
  458. GREAL|Howard Snyder
  459. PRINI|Isabel de Castro
  460. LETSS|Jaime Yorres
  461. RICAR|Janete Limeira
  462. DUMON|Janine Labrune
  463. MEREP|Jean Fresnière
  464. LAZYK|John Steel
  465. SANTG|Jonas Bergulfsen
  466. SAVEA|Jose Pavarotti
  467. GODOS|José Pedro Freyre
  468. SIMOB|Jytte Petersen
  469. TOMSP|Karin Josephs
  470. WHITC|Karl Jablonski
  471. BONAP|Laurence Lebihan
  472. FURIB|Lino Rodriguez
  473. THECR|Liu Wong
  474. THEBI|Liz Nixon
  475. QUEEN|Lúcia Carvalho
  476. GROSR|Manuel Pereira
  477. ALFKI|Maria Anders
  478. FOLKO|Maria Larsson
  479. PARIS|Marie Bertrand
  480. HANAR|Mario Pontes
  481. FOLIG|Martine Rancé
  482. BOLID|Martín Sommer
  483. VICTE|Mary Saveley
  484. WILMK|Matti Karttunen
  485. REGGC|Maurizio Moroni
  486. RICSU|Michael Holz
  487. TORTU|Miguel Angel Paolino
  488. VAFFE|Palle Ibsen
  489. FRANS|Paolo Accorti
  490. SUPRD|Pascale Cartrain
  491. HUNGO|Patricia McKenna
  492. CACTU|Patricio Simpson
  493. VINET|Paul Henriot
  494. WELLI|Paula Parente
  495. RATTC|Paula Wilson
  496. COMMI|Pedro Afonso
  497. FRANK|Peter Franken
  498. KOENE|Philip Cramer
  499. WARTH|Pirkko Koskitalo
  500. LEHMS|Renate Messner
  501. OLDWO|Rene Phillips
  502. WANDK|Rita Müller
  503. ERNSH|Roland Mendel
  504. RANCH|Sergio Gutiérrez
  505. NORTS|Simon Crowther
  506. DRACD|Sven Ottlieb
  507. AROUT|Thomas Hardy
  508. BSBEV|Victoria Ashworth
  509. CHOPS|Yang Wang
  510. HUNGC|Yoshi Latimer
  511. LAUGB|Yoshi Tannamuri
  512. OCEAN|Yvonne Moncada
  513. WOLZA|Zbyszek Piestrzeniewicz
  514. sqlite> SELECT Id, ContactName FROM Customer ORDER BY ContactName DESC;
  515. WOLZA|Zbyszek Piestrzeniewicz
  516. OCEAN|Yvonne Moncada
  517. LAUGB|Yoshi Tannamuri
  518. HUNGC|Yoshi Latimer
  519. CHOPS|Yang Wang
  520. BSBEV|Victoria Ashworth
  521. AROUT|Thomas Hardy
  522. DRACD|Sven Ottlieb
  523. NORTS|Simon Crowther
  524. RANCH|Sergio Gutiérrez
  525. ERNSH|Roland Mendel
  526. WANDK|Rita Müller
  527. OLDWO|Rene Phillips
  528. LEHMS|Renate Messner
  529. WARTH|Pirkko Koskitalo
  530. KOENE|Philip Cramer
  531. FRANK|Peter Franken
  532. COMMI|Pedro Afonso
  533. RATTC|Paula Wilson
  534. WELLI|Paula Parente
  535. VINET|Paul Henriot
  536. CACTU|Patricio Simpson
  537. HUNGO|Patricia McKenna
  538. SUPRD|Pascale Cartrain
  539. FRANS|Paolo Accorti
  540. VAFFE|Palle Ibsen
  541. TORTU|Miguel Angel Paolino
  542. RICSU|Michael Holz
  543. REGGC|Maurizio Moroni
  544. WILMK|Matti Karttunen
  545. VICTE|Mary Saveley
  546. BOLID|Martín Sommer
  547. FOLIG|Martine Rancé
  548. HANAR|Mario Pontes
  549. PARIS|Marie Bertrand
  550. FOLKO|Maria Larsson
  551. ALFKI|Maria Anders
  552. GROSR|Manuel Pereira
  553. QUEEN|Lúcia Carvalho
  554. THEBI|Liz Nixon
  555. THECR|Liu Wong
  556. FURIB|Lino Rodriguez
  557. BONAP|Laurence Lebihan
  558. WHITC|Karl Jablonski
  559. TOMSP|Karin Josephs
  560. SIMOB|Jytte Petersen
  561. GODOS|José Pedro Freyre
  562. SAVEA|Jose Pavarotti
  563. SANTG|Jonas Bergulfsen
  564. LAZYK|John Steel
  565. MEREP|Jean Fresnière
  566. DUMON|Janine Labrune
  567. RICAR|Janete Limeira
  568. LETSS|Jaime Yorres
  569. PRINI|Isabel de Castro
  570. GREAL|Howard Snyder
  571. QUICK|Horst Kloss
  572. OTTIK|Henriette Pfalzheim
  573. TRAIH|Helvetius Nagy
  574. ISLAT|Helen Bennett
  575. SEVES|Hari Kumar
  576. BLAUS|Hanna Moos
  577. PERIC|Guillermo Fernández
  578. MAGAA|Giovanni Rovelli
  579. PICCO|Georg Pipps
  580. BLONP|Frédérique Citeaux
  581. CENTC|Francisco Chang
  582. LONEP|Fran Wilson
  583. LINOD|Felipe Izquierdo
  584. BOTTM|Elizabeth Lincoln
  585. CONSH|Elizabeth Brown
  586. GALED|Eduardo Saavedra
  587. SPECD|Dominique Perrier
  588. FISSA|Diego Roel
  589. LACOR|Daniel Tonini
  590. BERGS|Christina Berglund
  591. MAISD|Catherine Dewey
  592. HILAA|Carlos Hernández
  593. LILAS|Carlos González
  594. FRANR|Carine Schmitt
  595. QUEDE|Bernardo Batista
  596. SPLIR|Art Braunschweiger
  597. FAMIA|Aria Cruz
  598. ANTON|Antonio Moreno
  599. LAMAI|Annette Roulet
  600. EASTC|Ann Devon
  601. GOURL|André Fonseca
  602. TRADH|Anabela Domingues
  603. ANATR|Ana Trujillo
  604. MORGK|Alexander Feuer
  605. ROMEY|Alejandra Camino
  606. sqlite> SELECT Id, ContactName, City FROM Customer WHERE City = 'London' ORDER BY ContactName DESC;
  607. BSBEV|Victoria Ashworth|London
  608. AROUT|Thomas Hardy|London
  609. NORTS|Simon Crowther|London
  610. SEVES|Hari Kumar|London
  611. CONSH|Elizabeth Brown|London
  612. EASTC|Ann Devon|London
  613. sqlite> SELECT Id, ContactName FROM Customer WHERE City = 'London' ORDER BY ContactName DESC;
  614. BSBEV|Victoria Ashworth
  615. AROUT|Thomas Hardy
  616. NORTS|Simon Crowther
  617. SEVES|Hari Kumar
  618. CONSH|Elizabeth Brown
  619. EASTC|Ann Devon
  620. sqlite> SELECT Id, ContactName, City, ContactTitle FROM Customer WHERE City = 'London' AND ContactTitle = 'Owner' ORDER BY ContactName DESC;
  621. sqlite> SELECT Id, ContactName, City, ContactTitle FROM Customer WHERE City = 'London' AND ContactTitle = 'Sales Representative' ORDER BY ContactName DESC;
  622. BSBEV|Victoria Ashworth|London|Sales Representative
  623. AROUT|Thomas Hardy|London|Sales Representative
  624. CONSH|Elizabeth Brown|London|Sales Representative
  625. sqlite> SELECT Id, ContactName, City, ContactTitle FROM Customer WHERE City = 'London' AND ContactTitle = 'Sales Representative' ORDER BY ContactName DESC;
  626. BSBEV|Victoria Ashworth|London|Sales Representative
  627. AROUT|Thomas Hardy|London|Sales Representative
  628. CONSH|Elizabeth Brown|London|Sales Representative
  629. sqlite> UPDATE ContactTitle = 'Owner', Address = 'Haupt Str. 66', PostalCode = 12208 WHERE Id = 'ALFKI';
  630. Error: near "=": syntax error
  631. sqlite> UPDATE Customer SET ContactTitle = 'Owner', Address = 'Haupt Str. 66', PostalCode = 12208 WHERE Id = 'ALFKI';
  632. sqlite> DELETE FROM Customer WHERE Country = 'France';
  633. sqlite> ALTER TABLE shipper RENAME TO distributor;
  634. sqlite> ALTER TABLE distributor ADD COLUMN created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'));
  635. Error: Cannot add a column with non-constant default
  636. sqlite> ALTER TABLE distributor ADD COLUMN created_at INTEGER NOT NULL DEFAULT 0;
  637. sqlite>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement