1 id=name,adresse+order or no order
2 name and address
3 the customers id functions like a key that only this customer can have like 101
4 like writing reviews on trustpilot for your academy you or mother and children
5 in a football game 11 players and the ball, fouls, outs, goals or statistics against the other 11 players
6 write what got ordert from the costumer_id
-
What kinds of relationships can we represent in a database?
One to One Relationships
One to Many and Many to One Relationships
Many to Many Relationships
Self-Referencing Relationships -
When do we use “One to One” relationships? Give an example from the real world.
When the entry is use for only one customer.Than can be personal information about one person. -
In the article in the “One to One”-section, the author of the article has a column called customer_id in the customers table. Why? How is it used in order to connect customers to addresses?
This is called a “Foreign key” And, yes, Is to refers to the matching record in the Address table. -
Give an example from the real world when would need to use a “Many to One/One to Many” relationship.
Customers can make many orders.
Orders can contain many items.
Items can have descriptions in many languages. -
Give an example from the real world when would need to use a “Many to Many” relationship.
Some cases we need multiple instances on both sides of the relationships, that contain multiple items. -
What does items_orders table do?
The Items_Orders table has only one purpose, and that is to create a “Many to Many” relationship between the items and the orders.
1. What kinds of relationships can we represent in a database?
Hello sir. those are not a relationship for a database, maybe you want to redesign your answer
If you have any more questions, please let us know so we can help you!
Carlos Z.
one to one, one to many, many to many and self referencing relationships.
2.
when a single piece of information has a unique relationship with another piece of information. An example could be all dieren colors of balloons picked by different children at a birthday party.
3.
this is the foreign key used in database relationships identifying a record in a table.
4.
an example of a one to many relationship is a person and his socks. one person can have multi pairs of socks, while the socks only have one user.
5.
a person can do his shopping soon at multiple stores, but these stores also have multiple customers.
6.
The Items_Orders table has only one purpose, and that is to create a “Many to Many” relationship between the items and the orders.
-
What kinds of relationships can we represent in a database?
1 to 1, 1 to many, many to many and relationship -
When do we use “One to One” relationships? Give an example from the real world.
To find a customer birthdate to send discount code or promotion. -
In the article in the “One to One”-section, the author of the article has a column called ‘customer_id’ in the ‘customers’ table. Why? How is it used in order to connect customers to addresses?
“Customer id” is the numerical value given to a user name, and it can be quarried to produces information about that customer. -
Give an example from the real world when would need to use a “Many to One/One to Many” relationship.
A customer ordering off Amazon. -
Give an example from the real world when would need to use a “Many to Many” relationship.
A referral code for Robinhood -
What does “items_orders” table do?
“Items_orders” show items purchased by a customer and the amount of that purchases. It creates a may to many table of item’s relationship to orders.
-
Database can represent following relations:
one to one
one to many or many to one
Many to Many
Self-referencing -
One to one relationships when only one field can belong to one record
ex. Employee and TAX ID number -
The customer ID is a"foreign key". It is used for reference purposes of all data
-
One account number (customer number) can have many different orders or
an Order have many items -
Many students take many courses or many courses have many instructors
-
It shows relation between orders and items (many to many relation).
- What kinds of relationships can we represent in a database?
- One to One Relationships
- One to Many and Many to One Relationships
- Many to Many Relationships
- Self Referencing Relationships
- **When do we use “One to One” relationships?
When one data set have to be unique.
Give an example from the real world.**
Customer name with an address
3. In the article in the “One to One”-section, the author of the article has a column called customer_id in the customers table. Why? How is it used in order to connect customers to addresses?
4. Give an example from the real world when would need to use a “Many to One/One to Many” relationship.
5. Give an example from the real world when would need to use a “Many to Many” relationship.
6. What does items_orders table do?
Following is the kind/type of relationship represented in SQL DB.
One to One Relationships
One to Many and Many to One Relationships
Many to Many Relationships
Self Referencing Relationships
Whenever we have a situation where one set of info will result one set of info would be “one to one” relation. My name and my SSN is a 1to1 relation.
By giving each customer a unique identification number or customer ID one can organize data in more efficient manner. Customer address can now be looked up using customer ID number.
When I send an email to company group by selecting a single email address it goes to all company employees, would be a one to many relation.
The item_order create a “Many to Many” relationship between the items and the orders.
- What kinds of relationships can we represent in a database?
Answer:
-One to One Relationships
-One to Many and Many to One Relationships
-Many to Many Relationships
-Self Referencing Relationships
- When do we use “One to One” relationships? Give an example from the real world.
Answer: Usually when we marry.
- In the article in the “One to One”-section, the author of the article
has a column called customer_id in the customers table. Why?
How is it used in order to connect customers to addresses?
Answer: The customer_id is unique, therefore; only one address per customer_id.
- Give an example from the real world when you would need to use a “Many to One/One to Many” relationship.
Answer: You use “Many to One/One to Many” relationships regarding orders from Amazon.
- Give an example from the real world when you would need to use a “Many to Many” relationship.
What does items_orders table do?
Answer: All the families ordering at a restaurant any given time. It seperates and distinguishes between order_id and item_id.
Hello sir, did you forgot to answer those questions?
If you have any more questions, please let us know so we can help you!
Carlos Z.
- Types of Database relationships; One to One Relationships, One to many to one Relationships, Many to Many Relationships, Self Referencing Relationships
- An example is address in the database that represents the customer, since only ONE address belongs to a customer that creates a “One to One” relationship.
- This is called a “Foreign Key” and it is used for all kinds of database relationships. It will duplicate an attribute from the table.
- A One to Many and Many to One Relationship, example could be a person buying several items, 1 order can contain many items, and items can come from several different vendors.
- For instance the same order going to several customers in the database.
- The items_orders table has only one purpose and that is to create a “Many to Many” relationship between the item and the orders
- one to one relationships, one to many and many to one relationships, many to many relationships and self referencing relationships
- When an entry/field can belong to only one customer.
Example: A persons passport number. - It is a foreign key used for all kinds of database relationships.
- Ordering food on Uber Eats. Each user can order multiple Uber Eats orders. The Uber Eats orders can contain many items. But this order can only belong to one customer.
- University classes. Each person can take many classes. Each classes can be taken by many people.
- It is used to create a ‘Many to Many’ relationship between the items and orders
-
What kinds of relationships can we represent in a database?
We can represent One to One Relationships, One to Many and Many to One Relationships, and Many to Many Relationships. -
When do we use “One to One” relationships? Give an example from the real world.
We use a One to One relationship when one item and be connected to only one item. An example of this can be in a table that lists people and their Social Security Number (SSN), as is in the United States. There could only be a One to One relationship in this case because everyone has their own SSN. -
In the article in the “One to One”-section, the author of the article has a column called customer_id in the customers table. Why? How is it used in order to connect customers to addresses?
The customer_id refers to the matching record in the customers table. In the article, the author refers to it as a foreign key and it is used for all kinds of database relationships. -
Give an example from the real world when would need to use a “Many to One/One to Many” relationship.
An example of a Many to One/One to Many relationship would be in Ivan On Tech Academy, how many courses did Student A complete in the Academy/how many students completed the course titled Blockchain Business Masterclass. -
Give an example from the real world when would need to use a “Many to Many” relationship.
Keeping in the context of Ivan On Tech Academy, the number of students enrolled in the Academy compared to the number of courses available in the Academy. You can further establish how many of those enrolled students participate in the Altcoin Secret Newsletter as well as how many of those go on to careers in web development as a result of being in the Academy. -
What does items_orders table do?
The Items_Orders table creates a “Many to Many” relationship between the items and the orders.
-
What kinds of relationships can we represent in a database?
One on one, one to many and many to one, self referencing, many to many -
When do we use “One to One” relationships?
Give an example from the real world.
For example when sending an email to one person.
From my mailaddress to another persons mailaddress. -
In the article in the “One to One”-section,
the author of the article has a column called customer_id
in the customers table. Why?
How is it used in order to connect customers to addresses?
It’s called foreign key. It’s role is to enforce
referential integrity between data in two tables. -
Give an example from the real world when would
need to use a “Many to One/One to Many” relationship.
For example when many people order the same kind of product or
like when many clients make a lot of orders -
Give an example from the real world when would
need to use a “Many to Many” relationship.
Might be like this academy? Many people can attend to many
of your different courses and each of your course can have many students. -
What does items_orders table do?
It shows which types of items that are connected to the order.
The goal is to create many-to-many relationships in between like;
customer, customer_id and order-id.
-
One to One
One to Many/Many to One
Many to Many
Self Referencing -
Each email address can only belong to one person.
-
Each customer in the CUSTOMERS table is assigned a unique customer ID, which is listed in the customer_id column. Each address is also assigned a unique ID and is listed in the address_id column in the CUSTOMERS table and refers back to the addresses on the ADDRESSES table - this is called a foreign key. The customer_id and the address_id form a One to One relationship between the customer and their address.
-
A restaurant can have many customers, each customer can order many dishes and each dish can have many ingredients.
-
Each dish on the restaurant’s menu contains many ingredients and each ingredient can be used in many different dishes on the menu.
-
Creates a Many to Many relationship between the items and the orders.
- What kinds of relationships can we represent in a database?
- One to One Relationships
- One to Many and Many to One Relationships
- Many to Many Relationships
- Self Referencing Relationships
-
When do we use “One to One” relationships? Give an example from the real world.
1 house has 1 roof -
In the article in the “One to One”-section, the author of the article has a column called customer_id in the customers table. Why? How is it used in order to connect customers to addresses?
customer ID’s are joined with adress ID’s to form a new table -
Give an example from the real world when would need to use a “Many to One/One to Many” relationship.
1 rainbow has many colors
1000 people at 1 party -
Give an example from the real world when would need to use a “Many to Many” relationship.
many orders have many items
and vice versa -
What does items_orders table do?
create a many to many relationship between items and orders
- one-to-one / one-to-many / many-to-many
- When their can only be one relationship between two items. For example a user ID linked to a social security number
- A FOREIGN KEY is a key used to link two tables together. Through this link items can be changed in separate tables without having to change them in all tables.
Customer details like addresses are stored in a second table. In the orders table the customer ID is used linking them with a foreign ket to the customer details table. - For a webshop situation. Many customers register in order to buy items in the shop. One item in the store can be linked to many customers.
- When multiple orders in the webshop from multiple customers consists of multiple items.
6.The Items_Orders table has only one purpose, and that is to create a “Many to Many” relationship between the items and the orders.
- What kinds of relationships can we represent in a database?
One to One
One to Many
Many to One
Many to Many - When do we use “One to One” relationships? Give an example from the real world.
Each transaction at a store has only one customer. One transaction is tied to One customer. - In the article in the “One to One”-section, the author of the article has a column called customer_id in the customers table. Why? How is it used in order to connect customers to addresses?
This creates a new “Foreign Key” and used to manage and identify relationships that are not naturally created in a data set. - Give an example from the real world when would need to use a “Many to One/One to Many” relationship.
One person may have many siblings, while many siblings will have only one mother. - Give an example from the real world when would need to use a “Many to Many” relationship.
A car maker may have Many models of cars and Many parts that are used in the Many cars. - What does items_orders table do?
The “items_orders” is used to create relationships of Many items in individual orders to the Many orders in which they occur.
- The types of relationships we can represent in a database include:
- One-to-one
- One-to-Many
- Many-to-Many
- Self-Referencing
-
One-to-one relationships are mainly found when dealing with addresses. One person (typically) has only one address, and that one address (sometimes) has only one person.
-
The customer_id column in the table is used as a foreign key, to allow other databases to access data.
-
One-to-many relationships are common in the world of online shopping. One customer can have many orders.
Similarly, Many-to-one relationships are common in this industry. Many customers may order the same type of one item.
-
Many-to-many relationships are again found whilst internet shopping. Many orders contain many items, whilst many (of the same type of) items can be found in many (different) orders.
-
The items_orders table “has only one purpose”: to create the many-to-many relationships needed between items and orders. Then our “Orders” table need only include:
- Order ID
- Customer ID
- Order Date
- Total Price
a) One to One
b) One to Many
c) Many to Many
d) Self Referencing
-
One to One relationships have a key and a value. For example a User and a Highscore.
-
The customer_id column is used to represent each unique customer and be used as a foreign key in another table, like the address table.
-
I can have multiple different Bitcoin addresses, but they all belong to one person (me).
-
A list of cryptocurrency YouTubers and their subscribers. Each YouTuber has many subscribers and each subscriber can be subscribed to multiple YouTubers.
-
The items_orders table links the order to each item in the order.