Tag: database-design

Find relationship between any table A and B in Sql Server

Suppose we have the following tables, with pretty foreign keys in place. CREATE TABLE Person ( Id int not null –other stuff ) CREATE TABLE Employee ( Id int not null, PersonId int not null, UserId int null –other stuff ) CREATE TABLE User ( Id int not null, Name varchar(25) not null, Password varchar(25) […]

SQL Server – Computed column counting over partition

I am fairly new to creating tables in SQL Server – Especially to computed columns – And am looking to make sure that I’m not creating a terribly inefficient database. As a simplified example of what I’m trying to accomplish, suppose I have the following table definition: CREATE TABLE [dbo].[MyTable]( [ID] [int] IDENTITY(1,1) NOT NULL, […]

Can we Store and Retrieve Multiple Images in one SQL column?

Hello Everyone I’m new in programming. I am working on small project in my project I have windows form where user will upload 4 to 6 Images and i want to store these images in SQL Database Table After that i want to retrieve these Images regarding one user. Now my question is how can […]

Database Schema relationship design

Hi there, I’m new to database design and I’m trying to design a very simple schema for the model. Just wondering if this will be the best way to design it, since this is my first time and don’t want to build this out without a lookover. Pokemon table: I get the name, id (PK), […]

How to identify identical columns with different names across tables?

My database has many columns that are reused across tables, but the name of the column changes. edit: as an example: We’re in telecom and deal with the 10 digit telephone number. It’s used across 100s of tables, usually with a different column_name for each table, and the datatype and format of the column are […]

Either/Or Relationship in Database design improvement

I have following either/Or relationship in my model. Following requirements are catered in model Plan Is made for certain length of period 3 months, 6 months yearly etc Plan may have revision In revision length of Period will not be changed Planning will be either at SKU level or SKU Group level Each SKU Group […]

Referential integrity of a hierarchy in sql

I’m trying to model the identification of securities that Bloomberg do. First they have a structure for a exchange and a group of exchanges (they call it a composite). Example 1 (United States): Example 2 (Euro Zone): Second they identify a security using a ticker plus a exchange code: Ticker + exchange code I.e. they […]

Creating one many to many table that is reused for many different tables when they all have a relationship to the same entity

I have a table [Team] in my Database. Many other tables require a many to many relationship with this table. This is mostly due to various records in my other table having authorisation settings based on which team the current user is in. For example a record in my [User] table can be linked to […]

Table design for “cordoned off” tables to avoid locking?

I have an application where there are groups of users who rarely to never see or interact with each others’ data, even though it’s in the same tables. Effectively they could all be running separate SQL Server databases 95% of the time. But I don’t want to have a separate database for each because that […]

circular relationship

I have a question that circulates a lot in my head, I’d like to find a response that can unlock me … in the field of database (DBMS and Modeling MPD). Is it possible to find a circular relationship between two (or more)tables such as: Create Table TA ( TA_ID INTEGER not null, A SMALLINT, […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.