How can we specify left/right joins when specifying relationships between tables in Power BI desktop? i am not referring to merging of tables but setting up joins between tables under "manager relationship" tab.
Have you looked under the Advanced Options section in the Create Relationship or Edit Relationship dialogs? You can specify the cardinality and the cross filter direction of the relationship.
Related
Title says it all - I can apply system versioning to a table, but can it be done to a view?
You can't apply temporal table system versioning to a view directly.
You can ensure all/some of the tables referenced by the view have it configured and then use FOR SYSTEM_TIME AS OF when selecting from the view however.
SQL Server will apply AS OF clause transparently to all temporal
tables that participate in view definition. Furthermore, you can
combine temporal with non-temporal tables in the same view and AS OF
will be applied only to temporal ones.
I'm dealing with a huge ERP database, hundreds of tables, and am having trouble figuring out how one entity is referenced from another. Let's call them the "sale" table and the "shipment" table. Each has FK relationships with numerous other tables, but no FK links either one to the other, and no obvious associative table is linked to both.
Is there any good way using SQL or the psql command line to discover the chains of relationships that connect the two tables?
Is there any good way to discover the chains that connect a specific row or PK of "sale" and a specific row/PK of "shipment"?
You should look at a tool like schemacrawler. It's good a opensource tool for data modelling retro-engineering.
You can find documentation here.
I am creating a database with about 40 different tables.
I have heard about people grouping tables into database 'schemas' - what are the implications of using different schemas in a database? Can tables from one schema still relate to another schema? What are the functional differences between different schemas?
Where are schemas located in SSMS? They are rightfully placed under the security tab.
Lets use the AdventureWorks databases.
If you assign security at the schema level, purchasing users will only have access to the purchasing table and sales people will have only access to the sales tables.
In fact, they will not even see the other tables if you set it up correctly.
If you combine schemas with creating tables/indexes on file groups, now you can place all the sales people onto file group sales and purchasing on file group purchasing.
IE - Spreading the I/O load.
In short, I think schemas are an unknown and little used feature.
Check out my blog article on this fact.
http://craftydba.com/?p=4326
I assume that you are talking about SQL Server. You can join and reference between tables in different schemas. I see it mostly used for visual organization and/or for managing objects' permission (you can assign permissions at the schema-level).
If you are worried about any negative effects of doing dbo.table vs custom.table - there aren't any that I imagine you would encounter.
Schemas are just collections of database objects. They are useful for maintaining separation of sets of objects.
There is always at least one schema. For SQL Server it is named dbo.
One implication of having multiple schemas is that you will have to manage permissions for the various schemas. This is usually done via a role that's associated with the schema.
Objects in one schema are available to objects from another, and there is no performance penalty in writing queries that use objects from multiple schemas.
Can anyone give me an idea about database flow diagram in my SqlServer Server Management Studio? I have a database (ERBIA) in my server; I want to know about the database relationship among different tables.
You can simply click on this:
And then select the tables for which you wish to create diagrams (graphs)
By database flow diagram I think you mean an Entity Relationship Diagram (ERD). There are a number of 3rd party tools that exist to create ERDs. ERWin, Visio, ER/Studio are some examples.
These tools can read the database schema information and create a diagram and draw relationship lines based on the Foreign Key constraints. You can edit the diagrams and depending on the tool update the database or generate a DDL script for the database changes.
SQL Server also includes a database designer, but it should be noted there is no separation from a logical model and the physical model. This means if you draw a line from one table to another indicating a relationship a FK will actually be created when you save the diagram. For some scenarios this would be a problem.
I'm new to CakePHP & Mysql Workbench and i just did a reverse engineer to a a open source application built with cakephp(Croogo CMS). In order to better understand the relations between tables I'll like to draw them, but using the mysql workbench the tables are getting new columns as foreign keys. I assume this isn't the right way to do it.
My questions are:
1) How to use mysql workbench in order to draw/see the relations between tables?
2) Do you know where can I find a EER mysql workbench diagram which use the cakephp convention and can help me to figure out, how this thing has to work?
The problem is that this CMS doesn't set proper relations in the database. That's why they are not retrieved from the DB.
If you know what is the relations between the tables (hopefully the Croogo CMS follow the Cake naming conventions) you can set relations between the tables by the icon "Place Relationship Using Existing Columns" (it's the last icon in the relation's toolbar). You need to select a column from a child table and then select the id column of the master table and the relation will be created.
Bear in mind that at least for me Workbench is a little bit unstable and crashes unsuspectingly - so save regularly your changes :)
You may find these graphics my Andy Dawson useful: https://github.com/AD7six/croogo/tree/mi/config/schema/graphics/