일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- items()
- Database
- 오버라이딩
- remove()
- shutil
- randrange()
- __sub__
- locals()
- MySQL
- __getitem__
- decode()
- 파이썬
- JS
- zipfile
- __annotations__
- discard()
- HTML
- View
- MySqlDB
- __len__
- node.js
- fileinput
- shuffle()
- fnmatch
- choice()
- count()
- mro()
- glob
- inplace()
- CSS
- Today
- Total
목록MySQL (14)
흰둥이는 코드를 짤 때 짖어 (왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!)

auto_increment (필드의 identity한 숫자를 자동으로 부여) create table tel( idx int auto_increment, name varchar(20) not null, hp varchar(20) not null, job varchar(20), regdate datetime default now() ); # Error Code: 1075. Incorrect table definition; there can be only one auto column and it must be defined as a key auto_increment속성을 갖는 칼럼은 primary key를 반드시 같이 선언 해주어야 한다. create table tel( idx int auto_incremen..

데이터 정규화 데이터 베이스를 설계할 때 중복을 최소화하는 것 크고 조직화되아 있지 않은 테이블과 관계들을 조직화 된 테이블과 관계들로 나누는 것 데이터 정규화가 필요한 경우 데이터를 갱신, 삽입, 삭제하는 등 테이블을 수정할 때 원하지 않게 데이터가 삭제되거나 가공되는 일이 발생하는데 이를 '이상 현상'이라고 함 이상 현상이 발생하는 경우 데이터 정규화가 반드시 필요 정규화의 종류 1NF(제 1정규화) 테이블 안의 모든 값들은 단일 값이어야 함 로우에서 한 컬럼안에 값을 복수로 넣지 않고 로우를 나눈다. 2NF(제 2정규화) 1NF를 만족하면서, 완전 함수 종속성을 가진 관계들로만 테이블을 생성하는 것 종속성들 중 종속 관계에 있는 열들끼리 테이블을 구분해주는 것 ✅ 함수 종속성 x값에 따라서 y값이 ..

member 테이블 select * from member; profile 테이블 생성 create table profile( userid varchar(20) not null, height double, weight double, blood varchar(10), mbti varchar(10), foreign key(userid) references member(userid) ); profile의 userid를 member의 userid와 외래키로 묶었다. insert into profile values('ryuzy', 180, 70, 'AAA', 'ISTP'); # Error Code: 1452. Cannot add or update a child row: a foreign key constraint ..

SQL 연산자 산술 연산자 +, -, *, /, mod(나머지 연산), div(몫) 비교 연산자 =(같다, 조건절), , >=, = 300; 로그인 select userid, username, hp, email from member where userid='apple' and userpw='apple1'; select userid, username, hp, email from member where userid='apple' and userpw='apple2'; is - 옳바르지 않은 코드 select userid, username, hp from member where address1 = 'null'; -- X select userid, username, hp from member where addre..

데이터베이스 확인하기 show databases; 데이터베이스 생성하기 # create database 데이터베이스명; create database kdt; 데이터베이스 삭제하기 # drop database 데이터베이스명; drop database kdt; 테이블(table) 데이터를 행과 열로 스키마에 따라 저장할 수 있는 구조 ✅ 스키마 데이터베이스의 구조와 제약조건에 관한 명세를 기술한 집합의 의미 create table 테이블명 ( 필드명1 데이터타입 제약조건, 필드명2 데이터타입 제약조건, 필드명3 데이터타입 제약조건, ... 필드명n 데이터타입 제약조건 ) 데이터 타입(Data Type) 1. 숫자형 타입 tinyint: 정수형 데이터 타입(1byte), -128 ~ 127 표현 smallin..

DataBase (데이터 베이스) Data: 자료 DataBase: 자료를 통합하여 관리하는 집합체, 저장소 DBMS(Database Management System, 데이터베이스 관리 시스템) 데이터베이스를 관리해주는 소프트웨어 DBMS를 사용하는 이유 중복된 데이터를 제거 또는 관리 효율적인 데이터를 처리 자료를 구조화시킬 수 있음 다양한 프로그램을 사용하는 사용자들과 데이터를 공유 MySQL 서버 다운로드(8.0.32) https://dev.mysql.com/downloads/installer/ (MySQL Community Downloads) Windows (x86, 32-bit), MySQL Installer MSI 클릭 Windows (x86, 32-bit), MSI Installer Down..