[10일차] MongoDB
db.movies.insertMany([ {"title" : "Ghostbusters"}, {"title" : "E.T"}, {"title" : "Blade Runner"} ], {"ordered": true}) // 디폴트로 있는 것 그래서 기본 순서대로 들어감 db.movies.find() db.movies.drop() db.movies.insertMany([ {"_id" : NumberInt(0), "title" : "Top Gun"}, {"_id" : NumberInt(1), "title" : "Back to the Future"}, {"_id" : NumberInt(1), "title" : "Gremlins"}, // pk 중복 일부러 지정 {"_id" : NumberInt(2), "title"..
2022. 7. 1.
[6일차] 쿼리 작성
use scott_db; show tables; desc scott_emp; select * from scott_emp; select ename, job, sal from scott_emp; select ename, job, sal from scott_emp where sal >= 1200; # sal 1200이상 조건 select ename,job,sal from scott_emp where job != 'CLERK'; # 데이터는 대문자로 쓰자 select distinct job # 중복제거 from scott_emp; select ename,job,sal from scott_emp where job = 'CLERK'; select ename,job,sal from scott_emp where job..
2022. 6. 27.