Logical Data Model Vs Physical Data Model - data-modeling

What is difference between Logical data model and physical data model?
Can an entity have below information (marking) :
Primary key attribute
Indexed attributes
Foreign key attributes?

Related

Can a Weak Entity Set be in a one-to-many relationship with a Strong Entity Set?

Can a weak entity set be in a one-to-many relationship with a strong entity set? If yes, then how can this be implemented in relational model? The relation corresponding to the weak entity must have an attribute that refers to the primary key of the relation corresponding to the strong entity set. If (weak : strong) is (1: Many) then this particular attribute becomes multivalued , which is not allowed in relational model. So can a weak entity set be in a one-to-many relationship with a strong entity set?

Databases - equivalent of ERD, UML and in relation data model

I have got this question:
What is the equivalent of table in ERD, UML and in relation data model?
In Chen's ER model (and Chen-notation ERDs), data is represented as attributes of and relationships between entities. This is an interpretation of relations in the relational model, which understands data as associations between domains of values/entities. Relations (i.e. attributes and relationships) can be represented as tables, though tables and relations don't map 1-to-1 - certain rules and semantics must be applied to tables (such as eliminating merged cells, ensuring that every cell contains exactly one value, column values are from a single domain, no duplicate rows, and order of rows/columns aren't significant) to understand them as relations.
In non-Chen ERDs (the kind in products like Visual Paradigm and MySQL Workbench), tables are directly represented but called entities, and foreign keys constraints are called relationships. This is reminiscent of the pre-relational network model. UML class diagrams fall in this category when used for data modeling.

Do we include a composite key of a week entity (partial key + foreign key from owner entity) as a foreign key or just the partial key?

In the conversion of an Entity Relationship Model to a Relational Data Model:
When mapping a 1:N Binary Relationship, should we include (as a foreign key) the composite key (partial key + foreign key from the owner entity) of the entity on the 1 side of the relationship to the relation corresponding to the entity type on the N side of the relationship, or just the partial key?
Background:-
While transforming an Entity-Relationship Model into a Relational Data Model, the following steps are followed:
Map regular entity types into relations, including their single valued attributes.
Map week entity types into relations. Include in the relation the Primary Key attribute of its Identifying (i.e. Owner) Entity Type as a Foreign Key. The key of this relation is a combination of its Partial Key and the Foreign Key from its Identifying Entity Type.
Map Binary 1:1 Relationship Types by including the Primary Key of one entity type (which is not showing a Total Participation, if only one of the two participating entity types is showing a total participation in the relationship) as a Foreign Key in the relation corresponding to the other entity type (the one showing the total participation in the relationship.
Map Binary 1:N Relationship Types by including the Primary Key of the participating entity type towards to 1 side, as a Foreign Key in the relation corresponding to the entity type towards to N side of the relationship.
Map the Binary Relationship M:N by making a new relation for the Relationship Type and making its Composite Key by including Primary Keys of both the participating entity types as Foreign Keys.
Make a new relation for each multivalued attribute and make its Key by including Primary Key from its entity type as a Foreign Key.
Reference: ERM to RDM
Question explained:-
My first question is from step 3.
If, in step 2, a week entity type's patial key had been combined with a foreign key from its owner relationship to form a composite key in the corresponding relation for the week entity type,
and the same week entity type is showing a total participation in a 1:1 binary relationship,
and then in step 3, when we are required to add a foreign key from the (although owner) entity type which is not the one showing the total participation to the relation corresponding to the (although week) entity type which is showing total participation, BUT we have already done that in the previous step as a requirement of that step, what will we do? Nothing, just move on?
My next question is from step 4, if the entity type towards the 1 side of the relationship is actually a week entity, and thus its primary key is (now, after following the previous step 2) a combination of its own partial key and the foreign key from its identifying relationship, shall we add this composite key as a foreign key in the entity type towards the N side of the relationship, or just its partial key?
this rule is only for binary relationships that have strong entities on both side i.e. both of the entities have primary key.
if their is weak entity then it will defenitly be on many (N) side of this relationship in that case we again follow the same rule but the primary key of the relation you built w. r. t. weak enity will be combination of partial key (if any) and primary key of owner (strong) entity.

What is the difference between object and entity in the database?

What is the difference between object and entity in the database?
Please explain with an example.
An entity is an abstract concept that's typically represented by a table in a database schema. The term object usually refers to in-memory data structures. An object that represents an entity may be called an entity object (often mapped to a row in a database table), that is it's an instance of an entity class (often mapped to a table).
A database object is represented as database, schema, table, column, primary key, and foreign key While a database Entity is a concept or object of importance about which data must be captured.

Entity Framework 4.0 Relationship map table

I have these tables;
Customer
- CustomerID (primary key)
- Name
Car
- CarID (primary key)
- Model
Customer_Car_Map (composite primary key CustomerID and CarID)
- CustomerID (foreign key to Customer.CustomerID)
- CarID (foreign key to Car.CarID)
When I generate the models from the database using EF4, it generates classes for all tables except for the _Map tables. For these it seems to add an EdmRelationshipAttribute, but not separate class.
How would I create and save a new Customer_Car_Map?
If the Entity Framework does its job correctly, you shouldn't need a class for the mapping tables.
Entity Framework 4 supports many to many relationships. It will generate Members on either of the Entities representing the two sides of the mapping tables. You will use the Entities to add relationships and Entity Framework will utilize the mapping table behind the scenes.
If those facilities aren't enough to get the job done, I would question why you need access to such low level data in your application.

Resources