๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ฐ˜์‘ํ˜•

์ „์ฒด ๊ธ€

MongoDB: ์ค‘๊ธ‰ ์ฟผ๋ฆฌ (Manipulating Data - Intermediate Query) Query embedded document {field : document} ์ˆœ์„œ๊ฐ€ ๋‹ค๋ฅผ ๊ฒฝ์šฐ ๊ฒ€์ƒ‰์ด ์•ˆ๋จ ๋ชจ๋“  embedded document์˜ ํ•„๋“œ๊ฐ€ ์—†์œผ๋ฉด ๊ฒ€์ƒ‰์ด ์•ˆ๋จ // ์•Œ๋งž์€ ์ฟผ๋ฆฌ db.inventory.find({size: {h:14, w:21, uom: "cm"}}) // ํ‹€๋ฆฐ ์ฟผ๋ฆฌ // ์ˆœ์„œ๊ฐ€ ๋‹ค๋ฅด๋ฉด ๊ฒ€์ƒ‰์ด ์•ˆ๋œ๋‹ค. db.inventory.find({size: {w:21, h:14, uom:"cm"}}) // ๋ชจ๋‘ ๋งค์น˜๋˜์ง€ ์•Š์œผ๋ฉด, ๊ฒ€์ƒ‰์ด ์•ˆ๋œ๋‹ค. db.inventory.find({size: {h:14, w:21}}) (”field.nestedField”) // size.uom์ด "in"์ธ ๊ฐ’๋“ค์„ ์ฐพ๋Š”๋‹ค. db.inventory.find({"size.uom": "in"}) // size... ๋”๋ณด๊ธฐ
MongoDB: ๊ธฐ๋ณธ ์ฟผ๋ฆฌ(Basic Quries) ์ด ๊ธ€์€ ์ „๊ณต "๋น…๋ฐ์ดํ„ฐ์‹œ์Šคํ…œ" ๊ฐ•์˜ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. Query Document The find() method db.COLLECTION_NAME.find(query, projection) collection๋‚ด์— ๋ชจ๋“  document๋ฅผ select db.inventory.find() db.inventory.find().pretty()SELECT * FROM inventoryQuery operator Comparison operators $eq { field : {$eq: value}} SELECT * FROM inventory WHERE qty = 25 db.inventory.find({qty:{$eq:25}}) db.inventory.find({qty:25}) $gt, $gte, $lt, $l.. ๋”๋ณด๊ธฐ
MongoDB Overview ์ด ๊ธ€์€ ์ „๊ณต "๋น…๋ฐ์ดํ„ฐ์‹œ์Šคํ…œ" ๊ฐ•์˜ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. MongoDB ํ•˜๋‚˜์˜ Collection์ด ์—ฌ๋Ÿฌ document๋ฅผ ๋ณด๊ด€ํ•  ์ˆ˜ ์žˆ๋Š” Document Database Relationship of RDBMS terminology with MongoDB RDBMS MongoDB Database Database Table Collection Tuple/Row Document column field Table Join Embedded Documents Primary Key Primary Key(Defalut Ket _id provded by mongodb it self) Mysqld/Oracle mongod mysql/sqlplus mongo RDBMS์—์„œ๋Š” 3๊ฐœ์˜ ํ…Œ์ด๋ธ”์ด ํ•„์š”ํ•˜์ง€๋งŒ, MongoDB.. ๋”๋ณด๊ธฐ
Big Data Storage ์ด ๊ธ€์€ ์ „๊ณต "๋น…๋ฐ์ดํ„ฐ์‹œ์Šคํ…œ" ๊ฐ•์˜ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. Centralized Storage Data is stored on the database of one single machine Relational databases Allows related data to be stored across multiple tables, and linked by establishing a relationship between the tables ⇒ ๋‹ค์ˆ˜์˜ ํ…Œ์ด๋ธ”์— ์—ฐ๊ด€๋œ data๋ฅผ ์ €์žฅํ•˜๊ณ , ํ…Œ์ด๋ธ”๋“ค๊ฐ„์˜ ๊ด€๊ณ„๋ฅผ ์„ค์ •ํ•˜์—ฌ ์—ฐ๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค. Inflexible - ์ฃผ๋กœ structured data์— ์ ํ•ฉํ•˜๊ณ  ๋‹ค๋ฅธ ํƒ€์ž…์— ๋Œ€ํ•ด ์œ ์—ฐ์„ฑ์ด ์—†๋‹ค. Velocity - ๋น ๋ฅด๊ฒŒ ์ฆ๊ฐ€ํ•˜๋Š” ๋ฐ์ดํ„ฐ๋ณด๋‹จ ์ •์ ์ธ ๋ฐ์ดํ„ฐ๋ฅผ ์œ„ํ•ด ์„ค๊ณ„๋˜.. ๋”๋ณด๊ธฐ
Introduction to Big Data ์ด ๊ธ€์€ ์ „๊ณต "๋น…๋ฐ์ดํ„ฐ์‹œ์Šคํ…œ" ๊ฐ•์˜ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ์˜ ์œ ํ˜•(Types of data) Structured Data Unstructured Data Can be displayed in rows, columns and relational databases Can not be displayed in rows, columns and relational databases Numbers, dates, and strings Images, audio, video, word processing files, e-mails, spreadsheets Requires less storage Requires more storage Estimated 20% of enterprise data Estimated 80.. ๋”๋ณด๊ธฐ
์ •๋ณด์ฒ˜๋ฆฌ๊ธฐ์‚ฌ ํ•„๊ธฐ ์ •๋ฆฌ ๋…ธ์…˜ ๊ณต์œ  ์ •๋ณด์ฒ˜๋ฆฌ ๊ธฐ์‚ฌ ํ•„๊ธฐ ์ •๋ฆฌ ์œ„ ๋งํฌ์— ์ •๋ณด์ฒ˜๋ฆฌ๊ธฐ์‚ฌ ํ•„๊ธฐ๋ฅผ ์ •๋ฆฌํ•˜์˜€๋‹ค. ํ•˜๋‚˜์”ฉ ์˜ฌ๋ฆฌ๋ ค๋‹ค๊ฐ€ ๊ท€์ฐฎ์•„์„œ ๊ทธ๋ƒฅ ๋งํฌ๋กœ ๊ณต์œ ํ•ฉ๋‹ˆ๋‹ค. ๋ชจ๋ฅด๋Š”๊ฑฐ๋ž‘ ์ค‘์š”ํ•ด ๋ณด์ด๋Š” ๊ฑฐ ์œ„์ฃผ๋กœ ์ •๋ฆฌํ•˜์—ฟ์Šต๋‹ˆ๋‹ค. 2022 ์ •๋ณด์ฒ˜๋ฆฌ๊ธฐ์‚ฌ ํ•„๊ธฐ ์‹œ๋‚˜๊ณต ๊ธฐ๋ณธ์„œ๋ฅผ ์ •๋ฆฌํ•œ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค. 2022 ์ •๋ณด์ฒ˜๋ฆฌ๊ธฐ์‚ฌ ํ•„๊ธฐ ๊ธฐ๋ณธ์„œ / ์‹œ๋‚˜๊ณต ๋”๋ณด๊ธฐ
[Algortihm/Java][ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] ์˜คํ”ˆ์ฑ„ํŒ…๋ฐฉ [ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] ์˜คํ”ˆ์ฑ„ํŒ…๋ฐฉ https://programmers.co.kr/learn/courses/30/lessons/42888 ๋ฌธ์ œ ์ ‘๊ทผ HashMap์„ ์ด์šฉํ•ด์„œ ์œ ์ €์•„์ด๋””์™€ ๋‹‰๋„ค์ž„์„ ์ €์žฅํ•˜๊ณ  list์— ์œ ์ € ์•„์ด๋””์™€ Enter or Leave๋ฅผ ์ €์žฅํ•œ ํ›„์— ๋ฉ”์„ธ์ง€๋ฅผ ์ถœ๋ ฅํ•  ๋•Œ ์œ ์ € ์•„์ด๋””์™€ ๋‹‰๋„ค์ž„์„ ๋งค์นญํ•ด์„œ ๋ฉ”์„ธ์ง€๋ฅผ ์ƒ์„ฑํ•˜์˜€๋‹ค. Code import java.util.HashMap; import java.util.ArrayList; class Solution { public String[] solution(String[] records) { String[] answer; HashMap users = new HashMap(); ArrayList messages = new ArrayList(); for(.. ๋”๋ณด๊ธฐ
[Algorithm/Java][๋ฐฑ์ค€] 2263 ํŠธ๋ฆฌ์˜ ์ˆœํšŒ [BOJ] 2263 ํŠธ๋ฆฌ์˜ ์ˆœํšŒ https://www.acmicpc.net/problem/2263 ๋ฌธ์ œ ์ ‘๊ทผ ์ธ์˜ค๋”์™€ ํฌ์ŠคํŠธ์˜ค๋” ์ˆœํšŒ๊ฐ€ ์ฃผ์–ด์กŒ์„ ๋•Œ ํ”„๋ฆฌ์˜ค๋” ์ˆœํšŒ๋ฅผ ๊ตฌํ•˜๋Š” ๋ฌธ์ œ์ด๋‹ค. ํฌ์ŠคํŠธ์˜ค๋”์—์„œ๋Š” ํŠธ๋ฆฌ์™€ ์„œ๋ธŒํŠธ๋ฆฌ์˜ ๋ฃจํŠธ๋ฅผ ๊ตฌํ•  ์ˆ˜ ์žˆ๊ณ , ์ธ์˜ค๋”์—์„œ๋Š” ํฌ์ŠคํŠธ์˜ค๋”์—์„œ ๊ตฌํ•œ ๋ฃจํŠธ๋ฅผ ์ด์šฉํ•˜์—ฌ ์™ผ์ชฝ ์„œ๋ธŒํŠธ๋ฆฌ์™€ ์˜ค๋ฅธ์ชฝ ์„œ๋ธŒํŠธ๋ฆฌ๋ฅผ ๊ตฌํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๋ฅผ ์ด์šฉํ•ด์„œ ํ”„๋ฆฌ์˜ค๋” ์ˆœํšŒ๋ฅผ ๊ตฌํ•˜์˜€๋‹ค. Code import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BOJ2263 { static int n,idx = 0; static int[] inorder, preorder, postorder; .. ๋”๋ณด๊ธฐ