Database

[SQLite] CRUD 구문

Bonita SY 2020. 10. 12. 18:28
728x90
반응형

왜 이렇게 헷갈리는지 모르겠다;

 

create

CREATE TABLE [IF NOT EXISTS] [schema_name].table_name (
	column_1 data_type PRIMARY KEY,
   	column_2 data_type NOT NULL,
	column_3 data_type DEFAULT 0,
	table_constraints
) [WITHOUT ROWID];

 

update

UPDATE table
SET column_1 = new_value_1,
    column_2 = new_value_2
WHERE
    search_condition 
ORDER column_or_expression
LIMIT row_count OFFSET offset;

 

drop

DROP table

 

select

SELECT DISTINCT column_list
FROM table_list
  JOIN table ON join_condition
WHERE row_filter
ORDER BY column
LIMIT count OFFSET offset
GROUP BY column
HAVING group_filter;

 

insert

INSERT INTO table (column1,column2 ,..)
VALUES( value1,	value2 ,...);

 

delete

DELETE FROM table
WHERE search_condition;

 

출처

https://www.sqlitetutorial.net/

 

728x90
반응형