MySQL – Sample – Sakila – Adding new customer record

Background Wanted to see how hard it will be to play around with the sakila MySQL Database. Objective Our objective will be to add a couple of records to the sakila.customer table. Because the table has a couple of foreign keys, we need to get a handle to valid entries in those tables, as well. … Continue reading MySQL – Sample – Sakila – Adding new customer record

“Entity Relationship” meets poetry

Background Researching an issue and wanted to see the best choice for a name.¬† Googled on it and found good reasoning. Question The Question is :- Image Text Table: Color Columns: Id, ColorName, ColorCode Table: Shape Columns: Id, ShapeName, VertexList What should I call the table that maps color to shape? Table: ??? Columns: ColorId, … Continue reading “Entity Relationship” meets poetry

Transact SQL – Constraint – Primary Key

There are a couple of approaches one can use to get the primary key for a table. Here are some of those ways: sp_pkeys sp_primarykeys INFORMATION_SCHEMA.TABLE_CONSTRAINTS sp_pkeys Syntax: Sample: Output: sp_primarykeys Though sp_primarykeys was added to gain insight into remote data sources, you can use it it to query your local data source, as well. … Continue reading Transact SQL – Constraint – Primary Key