전체 글

* replace a.replace("a를":"b로":"n번") a = 'xoxoxoxoxoxoxo' a.replace('xo', '#', 1) print(a) >>> #xoxoxoxoxoxo * 정렬 : sort() a = [2, 1, 3, 4, 5] a.sort() print(a) >>> [1, 2, 3, 4, 5] 내림차순 하는 법 1) a.sort() a.reverse() 2) a.sort(reverse = True)
https://youtu.be/LeTeb3ImxI0 1. RENAME : 기존 테이블(topic) 이름을 topic_backup으로 변경 RENAME TABLE topic TO topic_backup; SHOW TABLES; +-------------------------+ | Tables_in_opentutorials | +-------------------------+ | topic_backup | +-------------------------+ 2. 테이블 topic, author을 신규 생성 - topic 테이블의 author_id와 author 테이블의 id로 연결할 예정 2-1. topic 테이블 생성 CREATE TABLE topic( -> id INT(11) NOT NULL AUTO_IN..
https://youtu.be/pNINXzXaWWM * 공통점 : WHERE 꼭 해줘야한다 .. 안하면 전체가 U, D 됨 UPDATE ... SET ... WHERE ... ; UPDATE topic SET description = 'Oracle is ...', title='Oracle' WHERE id=2; - topic을 수정(UPDATE) - 컬럼명 description을 Oracle is ... 로, title을 Oracle로 변경(SET) - (중요!!!!!) 조건(WHERE) : id가 2인 행을 └ WHERE 안하면 모든 행이 바뀜 ... 결과 SELECT * FROM topic; +----+------------+-------------------+---------------------+..
https://youtu.be/FCnJH6fLc64 SELECT FROM - SELECT ___ FROM ; 사이에 Read 하고 싶은 컬럼명만 입력 SELECT id, title, created, author FROM topic; +----+------------+---------------------+--------+ | id | title | created | author | +----+------------+---------------------+--------+ | 1 | MySQL | 2022-04-17 19:27:40 | egoing | | 2 | ORACLEL | 2022-04-17 19:29:30 | egoing | | 3 | SQL Server | 2022-04-17 19:43:49 |..
https://youtu.be/75LHpeOQiOs CRUD - Create, Read, Update, Delete - Create, Read는 다 됨. Update, Delete는 안되는 경우도 있음 Read SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | opentutorials | | performance_schema | | test | +--------------------+ db 보여줌 SHOW TABLES IN opentutorials; +-------------------------+ | Tables_in_opentutorials | +-----..
https://www.youtube.com/watch?v=d3ye07XRexs SQL? : Structured Query Language - structured : 관계형 DB는 주로 표로 정리. 이걸 보통 '구조화되었다'고 함 - query : DB에 ~해달라고 '질의'함 - language : 언어 .. 명칭 id title description created 1 MySQL MySQL is... 2018-1-1 2 Query Query is ... 2019-1-1 - table, 표 - row, record, 행 └ 이 표는 행 2개. data 하나하나 - column, 열 └ 이 표는 열 4개. data의 type, 구조 테이블 생성 OPEN opentutorials; CREATE TABLE top..
https://youtu.be/bzhFcbin8_g mysql 실행 1. C > Bitnami > wampstack 폴더 > manager-windows.exe 실행 > Manage Servers 메뉴에서 MariaDB Database (=MySQL) Running 인지 확인 2. Window + R > 실행 창 뜨면 cmd 입력 3. cd C:\Bitnami\wampstack-8.1.4-0\mariadb\bin : mysql이 있는 디렉토리를 불러옴 4. mysql -uroot -p : mysql을 root(관리자)라는 사용자가 이용하려고 p 입력할 것임 참고) -p 뒤에 pw 입력할 수도 있지만 pw가 눈에 보여서 보안에 취약 5. 설치시에 설정한 pw 입력하면 Welcome to ~ 뜸 -> 성공 ..
zeomzzz
zeom blog