관계형 데이터베이스: 키와 관계
도입됨| English | 의미 |
|---|---|
| primary key/ˈpraɪməri kiː/ | 주키 |
| foreign key/ˈfɒrən kiː/ | 외부 키 |
What would explain this observation?
- Duplicating a user address in every order can produce conflicting records when the address changes.
- Start with a prediction. State the quantities or features you would compare, then decide what evidence could distinguish two explanations.
Build the model
- A relational table contains rows and attributes. A primary key 主键 identifies a row; a foreign key 外键 links to a referenced key in another table. Normalization can reduce avoidable duplication and update anomalies while preserving meaningful relationships.
- primary key: Attribute set uniquely identifying a table row; foreign key: Attribute set referencing a key in another table.
어떤 설계가 중복 고객 주소 업데이트를 방지하는 데 도움이 됩니까?
난이도 1/5 · 100 코인 + 오늘 첫 완료 시 소액 보너스
고객 표에 주소를 한 번만 저장하고 외래 키(foreign key)로 주문을 연결하면 각 사실은 단일 위치에서 업데이트됩니다. 모든 주문에 주소를 반복해서 입력하면 일관성 없는 복사본이 발생할 수 있으며, 이름은 반드시 고유하다고 보장되지 않습니다.
각 전문 용어에 대한 정확한 의미를 매칭하시오.
난이도 2/5 · 140 코인 + 오늘 첫 완료 시 소액 보너스
정의를 사용하여 유사한 양과 과정을 구분하시오.
Choose evidence that can test it
- A join combines rows according to a specified condition. The result count depends on relationship cardinality and filters. A foreign key constraint enforces a relationship rule; it does not automatically encrypt personal data.
- Design a small synthetic user-order dataset with no real personal information. Declare keys, test duplicate and missing-reference inserts, then check a query result against a hand-worked expected table.
이 경우 조사 또는 모델이 더 타당하게 만들 수 있는 두 가지 습관은 무엇인가?
난이도 2/5 · 140 코인 + 오늘 첫 완료 시 소액 보너스
조건과 가정을 명시하면 다른 사람이 정확히 작업을 재현할 수 있으며, 근거 증거를 기록하면 결론을 검증할 수 있습니다. 반대되는 결과를 숨기는 것은 잘못된 결론을 반박할 수 있는 증거를 제거하는 것이며, 한 번의 측정으로는 더 넓은 주장을 입증할 수 없습니다.
Work from known quantities
- State the known values and their units. Choose the relation because its assumptions fit this case, then rearrange before substitution.
- Known: four customers have respectively 2, 0, 3 and 1 orders. An inner join of customer to order returns 2+0+3+1 = 6 rows. A left join also retains the customer with no order as one null-matched row, giving 7 here.
Three customers have 1, 3 and 2 orders. How many rows does the customer-order inner join return? Use the same sequence: known quantities → model → relation → substitution → unit and interpretation.
세 명의 고객이 각각 1, 3 및 2 건의 주문을 가지고 있을 때, 고객-주문 내부 조인(Inner Join)은 몇 개의 행을 반환하는가?
난이도 2/5 · 140 코인 + 오늘 첫 완료 시 소액 보너스
결과는 6 행입니다.已知: 세 명의 고객이 각각 1, 3, 2 건의 주문을 가짐. 내부 조인(inner join)은 고객-주문 쌍마다 하나의 행을 반환하므로: 1 + 3 + 2 = 6 행. 주문이 없는 고객은 내부 조인에 영향을 주지 않습니다.
Check the conclusion and its limits
- A primary key need not be a person name. A join is not a simple concatenation of tables. Use parameterized queries for untrusted input rather than building SQL from raw strings.
- Return to the original observation. Explain what the result supports, which conditions it assumes, and one way to test a competing explanation.
A foreign key automatically encrypts every row. This claim is false: A foreign key is a referential link between tables - it enforces that the referenced row exists. It performs no encryption; protecting row content is a separate security mechanism.
Relational databases: a key and a relationship: A join combines rows according to a specified condition. The result count depends on relationship cardinality and filters. A foreign key constraint enforces a relationship rule; it does not automatically encrypt personal data.
외부 키(foreign key)는 모든 행을 자동으로 암호화합니다.
난이도 1/5 · 100 코인 + 오늘 첫 완료 시 소액 보너스
외래 키는 테이블 간의 참조 link로, 참조되는 행이 존재함을 강제합니다. 암호화를 수행하지 않으며, 행 내용 보호는 별도의 보안 메커니즘입니다.
테이블 행을 고유하게 식별하는 속성 집합: 기술 용어를 작성하십시오.
난이도 1/5 · 100 코인 + 오늘 첫 완료 시 소액 보너스
주키(primary key)는 테이블 행을 고유하게 식별하는 속성 집합을 의미합니다.