
예제 엑셀 파일 DB 엑셀 자료입력.xlsx drop database if exists jointestdb;create database jointestdb;use jointestdb;-- drop table customertbl;create table customertbl( -- 부모1, pordertbl테이블에서 참고할 것이라서 custid char(5) not null primary key, cname varchar(100) not null, gender char(4), address varchar(100), phone varchar(20));select * from customertbl;insert into customertbl(custid, cname,gende..
use madang; -- madang db사용-- 1. 모든 도서의 이름과 가격을 검색select bookname, price from book;select bookname as 도서명, price 책가격from book;-- 2.select bookid, bookname, publisher, pricefrom book;select * from book;-- 3. select publisher from book;-- 4. 가격이 20000미만인 도서 검색select *from bookwhere price =10000 and price = 20000;-- 11. 도서명에 맞춰 오름차순 정렬select * from book; -- pk인 bookid를 기준으로 오름차순select *from book--..
-- 한 줄 주석/* 여러 줄 주석*/-- madang db가 이미 존재하면 삭제하기drop database if exists madang; -- orders 테이블이 존재하면 삭제drop table if exists orders; -- book 테이블이 존재하면 삭제drop table if exists book; -- Ctrl + Enter 실행-- customer 테이블이 존재하면 삭제drop table if exists customer; -- 1 ~ 3 : DDL(데이터정의어) - create(생성), alter(변경), drop(삭제)-- 1. db부터 만들기-- drop 개체 객체명;-- db가 이미 존재하면 삭제하기drop database if exists madang; -- Ctrl ..

DDL/DML 1 □ SQL(Structured Query Language, 구조적 질의어) 1. DDL(데이터 정의어, Data Definition Language) create(생성,만들기), alter(변경,변형), drop(삭제,완전삭제),truncate(삭제,구조 남김) 2. DML(데이터 조작어, Data Manipulation Language) select(검색),inset(삽입),delete(삭제),update(변경) 3. DCL(데이터 제어어,Data Control Language) grant(권한 설정), revoke(권한 회수) commit(트랜잭션 완료),rollback(트랜잭션 되돌리기) => TCL(Transaction Control Language) -..

맛보기 설명2 ● 명령 프롬프트 창에서 mysql 사용하기 □ 데이터베이스 생성 및 테이블 생성 1. db명 : shop-- Ctrl + Enter : 현재 위치의 sql문 실행-- Ctrl + Shift + Enter : 전체 또는 범위 설정 모두 실행-- 주석/* 여러 줄 주석*/-- 저장 : File - Save Script-- 새로운 탭 : File - New Query Tab-- 열기 : File - Open SQL Script.../* DB 만들기 -> DB 안으로 들어가기 -> 테이블 만들기 -> 자료 삽입 -> 자료 조회/수정/삭제 DB 안으로 들어가기 -> 자료를 조회/수정/삭제-- drop 삭제할_객체 삭제할_객체명;drop database if exists s..