MySQL ID/PW : root / autoset


use TEST;

SELECT database();


CREATE TABLE shop(

no INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,

name VARCHAR(50),

nametext TEXT,

tag VARCHAR(200),

map VARCHAR(200),

date DATE,

date2 DATE,

password VARCHAR(20),

image1 MEDIUMBLOB,

image1text TEXT,

image2 MEDIUMBLOB,

image2text TEXT,

image3 MEDIUMBLOB,

image3text TEXT

)

\G


\C 는 취소


ALTER TABLE test

ADD CONSTRAINT no_pk

PRIMARY KEY (a);


show tables

show columns from test


ALTER TABLE test DROP COLUMN a;

ALTER TABLE test ADD COLUMN a INT NOT NULL AUTO_INCREMENT PRIMARY KEY


INSERT INTO shop VALUES(1, 'HUGA', 'good shop', 'https://www.naver.com', CURRENT_TIMESTAMP, NULL, 'abc', NULL, NULL, NULL, NULL, NULL, NULL);


SELECT * from shop;




'개발 > DataBase,PHP' 카테고리의 다른 글

mysql C# connector  (0) 2019.03.02
PHP  (0) 2018.05.26

+ Recent posts