DDL
DML
php 책 빌려 놓고 sql만 공부하는 센스? ㅋㅋ
---
[링크 : http://www.w3schools.com/sql/sql_alter.asp ]
create database dbname; create table tablename ( fieldname type option, PRIMARY KEY(fieldname) ); drop database dbname; drop table tablename; desc tablename; use dbname; show databases; show tables; alter table tablename add fieldname type after fieldname; alter table tablename add fieldname type first; alter table tablename drop fieldname, fieldname, fieldname; alter table tablename modify fieldname type; alter table tablename change fieldname new_fieldname new_type; alter table tablename rename tablename; |
DML
insert into table (fieldname, fieldname, fieldname) values (value, value, value); select fieldname from tablename where condition; select fieldname,fieldname,fieldname from tablename where condition; select * from tablename where condition; select fieldname from tablename where condition order by fieldname; select fieldname from tablename where condition order by fieldname desc; update tablename set fieldname=value where condition; delete from tablename where condition; condition = 같다 'a' 문자 a 'abc' 문자열 'abc' 'a%' a로 시작하는 모든 내용, a*과 같은 의미 '_a' 첫글짜는 상관없으나 그 다음에 1개가 a, ?a 와 같은 의미 and &&와 같은 의미 or ||와 같은 의미 |
php 책 빌려 놓고 sql만 공부하는 센스? ㅋㅋ
---
[링크 : http://www.w3schools.com/sql/sql_alter.asp ]
'프로그램 사용 > mysql & mariaDB' 카테고리의 다른 글
mysql / mariaDB (1) | 2014.04.16 |
---|---|
mysql transaction (0) | 2014.04.08 |
mysql grant 문 (0) | 2014.04.01 |
mysql 암호변경하기 (0) | 2013.02.21 |
mysql 사용법(SQL) (4) | 2010.04.03 |