Database12 [CS Study] JOIN 2: 외부 조인과 기타 조인 (김영한의 실전 데이터베이스 기본편) OUTER JOINLEFT OUTER JOIN == LEFT JOINRIGHT OUTER JOIN == RIGHT JOIN조인의 특징자식에서 부모 조인 : 행의 개수가 그대로 유지가 됨.FK → PK주문은 반드시 한 명의 고객에게 속한다.부모에서 자식 : 행의 개수가 늘어남PK → FK부모 테이블의 한 행은 자식 테이블의 여러 행과 매칭될 수 있다.한 명의 고객이 여러 번 주문할 수 있다.-- 부모에서 자식 (1행 -> 2행)select o.order_id, o.product_id, o.user_id as orders_user_id, u.user_id as users_user_id, u.name, u.emailfrom users ujoin orders o on u.user_id = .. 2025. 11. 21. Django 프로젝트에서 데이터베이스는 어떻게 선택해야 할까? 🧠 Django를 이용한 웹 개발을 하다 보면 “어떤 데이터베이스를 사용해야 하지?” 하는 고민에 부딪히게 됩니다. 지금까지는 대부분 기본 설정대로 SQLite를 사용했을 텐데요, 과연 이것으로 충분할까요?이 글에서는 Django와 데이터베이스 선택에 대해 꼭 알아야 할 내용을 정리합니다.💾 지금까지 우리는 SQLite를 사용했다!Django는 기본적으로 SQLite를 사용합니다.특별한 설정이나 설치 없이 바로 사용 가능하고, 하나의 .sqlite3 파일 안에 모든 데이터가 저장됩니다.Python에 내장된 DB 엔진이라 개발 초기에는 매우 편리합니다.✅ "별다른 설치 없이 바로 시작할 수 있는 것" = 개발자에게는 큰 장점!❗ 그런데 SQLite는 문제없을까?SQLite는 단일 파일 기반이라:대용량 트래픽.. 2025. 7. 30. [Django] Form을 통해 사용자 리뷰 저장하기 (feat. Model 연결) 장고에서는 사용자의 입력을 받아서 데이터베이스에 저장하는 과정을 간단하게 처리할 수 있습니다.이번 포스팅에서는 Form과 Model을 연결해서 사용자 리뷰를 저장하는 과정을 하나씩 살펴보겠습니다.✅ 목표사용자로부터 이름, 리뷰 내용, 평점을 입력받는다유효성 검사를 한다models.py의 Review 모델에 데이터를 저장한다성공하면 /thank-you 페이지로 리디렉션한다📌 1. 모델 만들기 (models.py)from django.db import modelsclass Review(models.Model): user_name = models.CharField(max_length=100) review_text = models.TextField() rating = models.Integer.. 2025. 7. 24. [Python Django] The Practical Guide - Data & Models 재시작 될 때 마다 모든 데이터가 날아간다. data query functionality가 없다. 현실적이지 않다. 영원히 저장되는 데이터가 필요하다 ! database- What is "Data" and a "Database" ?- Exploring SQL & Models- Django, Models. & Database Queries Different Kinds of Data- Temporary Data: User Input, Selected Blog PostData is used immediately and lost thereafterStore in Memory (Variables)- Semi-Persistent Data: User authentication statusData is stored f.. 2025. 7. 22. E-R model Designing a database → 전체적인 디자인 과정을 이해해보자. (교과서 읽으세염...) Initial phase characterize fully the data needs of the prospective database users Second phase choose a data model Apply the concepts of the chosen data model Translate the requirements into a conceptual schema of the database A fully developed conceptual schema indicated the functional requirements of the enterprise Describe the kinds of .. 2023. 10. 27. Structured Query Language SQL data manipulation language (DML) SELECT, FROM, WHERE NULL values Set operations String operations, ordering Aggregate functions, aggregation → querying && modifying the databases Aggregate Functions - Having Clause groups뒤에 오는 HAVING과 groups 앞에 있는 HAVING이 다름. 두 개는 다른 쿼리이다. 왼쪽에 있는 것은 GROUP BY 를 한 instructor중에서 65000이 넘는 교수 오른쪽은 65000이 넘는 instructor를 찾아서 평균을 낸 것. 따라서 더 높음. More SQL Nested subq.. 2023. 10. 27. 이전 1 2 다음