moje: CREATE TABLE [dbo].[Knihovna] ( [KnihovnaID] INT IDENTITY (1, 1) NOT NULL, [Jmeno] NCHAR (100) NULL, PRIMARY KEY CLUSTERED ([KnihovnaID] ASC) ); CREATE TABLE [dbo].[Oddeleni] ( [OddeleniID] INT IDENTITY (1, 1) NOT NULL, [Jmeno] NCHAR (100) NULL, [KnihovnaID] INT NULL, PRIMARY KEY CLUSTERED ([OddeleniID] ASC), FOREIGN KEY ([KnihovnaID]) REFERENCES [dbo].[Knihovna] ([KnihovnaID]) ); CREATE TABLE [dbo].[Kniha] ( [KnihaID] INT IDENTITY (1, 1) NOT NULL, [Nazev] NCHAR (100) NULL, [Autor] NCHAR (100) NULL, [Zanr] NCHAR (100) NULL, [Rok] INT NULL, [ISBN] INT NULL, [OddeleniID] INT NULL, PRIMARY KEY CLUSTERED ([KnihaID] ASC), FOREIGN KEY ([OddeleniID]) REFERENCES [dbo].[Oddeleni] ([OddeleniID]) ); app a navod: https://app.quickdatabasediagrams.com/#/ # Modify this code to update the DB schema diagram. # To reset the sample schema, replace everything with # two dots ('..' - without quotes). Customer - CustomerID PK int Name string INDEX Address1 string Address2 NULL string Address3 NULL string Order - OrderID PK int CustomerID int FK >- Customer.CustomerID TotalAmount money OrderStatusID int FK >- os.OrderStatusID OrderLine as ol ---- OrderLineID PK int OrderID int FK >- Order.OrderID ProductID int FK >- p.ProductID Quantity int # Table documentation comment 1 (try the PDF/RTF export) Product as p # Table documentation comment 2 ------------ ProductID PK int # Field documentation comment 1 # Field documentation comment 2 Name varchar(200) UNIQUE # Field documentation comment 3 Price money OrderStatus as os ---- OrderStatusID PK int Name UNIQUE string moje: Knihovna ---------------------- KnihovnaID PK int Jmeno string Oddeleni ---- OddeleniID PK int Jmeno string KnihovnaID int FK >- Knihovna.KnihovnaID Kniha - KnihaID PK int Nazev string Autor string Zanr string Rok int ISBN int OddeleniID int FK >- Oddeleni.OddeleniID