일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Artificial Intelligence
- 빅 데이터
- Deep learning
- MongoDB
- 데이터 과학
- 김양재 목사님
- Big Data
- nodeJS
- 딥러닝
- data science
- 빅데이타
- 빅데이터
- 빅 데이타
- 김양재
- 몽고디비
- No SQL
- WebGL
- 통계
- probability
- openCV
- node.js
- 인공지능
- 주일설교
- Machine Learning
- 우리들교회
- c++
- R
- 김양재 목사
- Statistics
- 확률
- Today
- Total
Scientific Computing & Data Science
Frequently Used MySQL Quries 본문
SHOW DATABASES;
// print the current list of database
USE test;
// select the database "test"
CREATE DATABASE test;
// create a database named "test"
CREATE TABLE mytable(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(25) NOT NULL,
content VARCHAR(255) NOT NULL
);
// create a table named "mytable" with the fields of id, name and content
DESC mytable;
// print out the structure of mytable
INSERT INTO mytable (name, content) VALUES( 'gchoi', 'MySQL' );
// add 'gchoi' into name field and 'MySQL' into content field of mytable
SELECT * FROM mytable;
// inquiry data from mytable
SELECT id, name FROM mytable;
// inquiry only id and name field from mytable
SELECT * FROM mytable WHERE name='gchoi';
// inquiry data of name with 'gchoi'
SELECT * FROM mytable WHERE name LIKE 'gc%';
// inquiry all data from mytable
SELECT * FROM mytable WHERE name LIKE 'gc__';
// inquiry all data from mytable
SELECT * FROM mytable ORDER BY id;
// print the current list of database
SELECT * FROM mytable ORDER BY id ASC;
// print the current list of database
SELECT * FROM mytable ORDER BY id DESC;
// print the current list of database
SELECT * FROM mytable LIMIT 2;
// print the current list of database
SELECT * FROM mytable LIMIT 2, 2;
// print the current list of database
SELECT * FROM mytalbe WHERE (id < 3) AND (name LIKE 'gc%') ORDER BY id ASC LIMIT 4;
// print the current list of database
UPDATE mytable SET name = 'cinema4d' WHERE id = 5;
// update table content of id 5: name 'cinema4d'
UPDATE mytable SET name = 'cinema4d', content = 'Node.js' WHERE id = 5;
// update table content of id 5: name 'cinema4d' / content 'Node.js'
DELETE FROM mytable WHERE id = 5;
// delete id number 5 from mytable
DROP TABLE mytable;
// delete a table of the name 'mytable'
DROP DATABASE test;
// delete a database of the name 'test'
'Data Science > MySQL' 카테고리의 다른 글
Execute MySQL Console on Mac (0) | 2014.01.05 |
---|