0% found this document useful (0 votes)
3 views1 page

Worksheet2 Database Answers

An entity in databases represents a real-world object or concept, such as a customer or product. Relationships between entities can be categorized as one-to-one, one-to-many, or many-to-many. Key fields for entities include CustomerID for customers, ProductCode for products, OrderNumber for orders, and OrderLineID for order lines.

Uploaded by

filipion451
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Worksheet2 Database Answers

An entity in databases represents a real-world object or concept, such as a customer or product. Relationships between entities can be categorized as one-to-one, one-to-many, or many-to-many. Key fields for entities include CustomerID for customers, ProductCode for products, OrderNumber for orders, and OrderLineID for order lines.

Uploaded by

filipion451
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. What is an entity in the context of databases?

An entity is a real-world object or concept about which data is stored in a database, such as a
customer, product, or order.

2. What are the three degrees of relationship between entities?


One-to-one (1:1), one-to-many (1:M), and many-to-many (M:N).

3(a) Dentist and patient


One dentist can treat many patients, and a patient can be treated by many dentists
(many-to-many).

3(b) Student and teacher


A teacher teaches many students, and a student may be taught by many teachers (many-to-many).

3(c) UK citizen and UK Passport


One UK citizen has one UK passport, and one passport belongs to one citizen (one-to-one).

3(d) Product and component


A product is made of many components, and a component can be used in many products
(many-to-many).

4. Relationships between Customer, Product, Order, and OrderLine


A customer places many orders (1:M). An order contains many order lines (1:M). Each order line
refers to one product, and a product can appear on many order lines (1:M).

5. Primary key fields of the entities


Customer: CustomerID. Product: ProductCode or ProductID. Order: OrderNumber. OrderLine:
OrderLineID or a composite key of OrderNumber and LineNumber.

You might also like