-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQL_HOME
More file actions
40 lines (40 loc) · 1.48 KB
/
Copy pathSQL_HOME
File metadata and controls
40 lines (40 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SQLite version 3.35.5 2021-04-19 18:32:05
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open 'c:\\dd\\mydb
sqlite> .mo co
sqlite> .he on
sqlite> create table movie(title, director, actor, audience);
sqlite> .import 'c:\\dd\\movie.txt' movie
Error: cannot open "c:\\dd\\movie.txt"
sqlite> .ta
movie
sqlite> create table movie(title, director, actor, audience);
Error: table movie already exists
sqlite> select * from movie;
sqlite> .import 'c:\\dd\\m.txt' m
sqlite> select * from movie;
sqlite> .ta
m movie
sqlite> .import 'c:\\dd\\m.txt' movie
sqlite> select * from movie;
title director actor audience
----- -------- ----- --------
해운대 윤제균 설경구 1139
광해 추창민 이병헌 1232
국제시장 윤재균 황정민 1318
도둑들 최동훈 전지현 1302
변호인 양우석 송강호 1137
sqlite> insert into movie values('명량','김한식','최민식',1761);
sqlite> select * from movie;
title director actor audience
----- -------- ----- --------
해운대 윤제균 설경구 1139
광해 추창민 이병헌 1232
국제시장 윤재균 황정민 1318
도둑들 최동훈 전지현 1302
변호인 양우석 송강호 1137
명량 김한식 최민식 1761
sqlite> update movie set '김혜수' where actor '전지현';
Error: near "where": syntax error