In this post I will include some of command I used to create the database. I don’t want to share with you all this values, because you will get lazy and still might have trouble to learn something more.
Anyway, catch the ravel:
create database Music4ever
use (...)
---> TABLE WITHOUT FK
create table dbo.ADDRESSES
(ID int primary key identity (1,1),
(...)
)
---> TABLES WITH ONE FK
create table dbo. SUPPLIERS
(Supplier_ID int primary key,
(...)
Id_Address int references dbo.ADDRESSES(ID)
)
create table dbo.PRODUCTS
(Product_ID int primary key,
Artist,Album ,Record_Label,Edition >>date<<,
Data_Storage , Condition, On_stock , Sales_price,
Delivery_Method int references dbo.SUPPLIERS(Supplier_ID) )
create table dbo.LOGINS (ID_employee int primary key, (...)
ID_storeAddress int references dbo.ADDRESSES(ID) )
---> Tables wit one or more FK
create table dbo.delivery_to
((...)
Courier_ID int references dbo.SUPPLIERS(Supplier_ID),
IDelivery_Address int references dbo.ADDRESSES(ID)
)
create table dbo.warehouse_movements
((..)
Product_Code int references dbo.PRODUCTS(Product_ID),
Courier_ID int references dbo.SUPPLIERS(Supplier_ID),
Employee_ID int references dbo.LOGINS(ID_employee)
)
hope, it was not too problematic to guess the hide lines. Now, let’s check how it looks on SQL Database diagram, will be similar to UML version?

quite so. Have you received it that way?
! Inserts into Music4ever !
Time to make some inserts. My suggestion is to create:
- About 20 rows for Addresses.
- 5 for Logins.
- 3 for Suppliers.
- 20-30 for Products.
- 3-5 for warehouse_movements.
- and about 3-5 for delivery_to.
That’s your homework for today, tomorrow. See ya with my next post, soon.