Skip to content
Advertisement

SQL Database Design with more than one data in same column

I want to create a database table which will have multiply information. One of these information is phones. How can I create a database table that inside the phones column will contain let’s say sub-columns, because a user may have more than one phone and be stored in the same row for the same ID.

Below is an image of what I mean and how I want my table to be… enter image description here

ALL THE ANSWERS ARE HELPFUL UNFORTUNATELY I CAN PICK ONLY ONE BUT ALL ANSWERED HELPED ME

Advertisement

Answer

SQL Fiddle

MS SQL Server 2017 Schema Setup:

Query 1:

Results:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement