NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

CREATE TABLE Supplier
(
ID int NOT NULL PRIMARY KEY,
CompanyName nvarchar(50),
ContactName nvarchar(50),
City nvarchar(50),
Country nvarchar(50),
Phone int,
Fax int
)
INSERT INTO Supplier (ID,CompanyName,ContactName,City,Country,Phone,Fax)
VALUES (1,'A','B','C','D',12345,67890),
(2,'E','F','G','H',14324,98675),
(3,'I','K','L','M',65489,09874)


CREATE TABLE Customer
(
ID int NOT NULL PRIMARY KEY,
FirstName nvarchar(50),
LastName nvarchar(50),
City nvarchar(50),
Country nvarchar(50),
Phone int,
)
INSERT INTO Customer(ID,FirstName,LastName,City,Country,Phone)
VALUES(1,'B','A','E','F',45362),
(2,'Q','P','R','L',76432),
(3,'S','G','C','Z',93022)


CREATE TABLE Orders
(
ID int NOT NULL PRIMARY KEY,
OrderDate int,
CustomerID int,
TotalAmount int
)
alter table Orders
add constraint
OrderItem_ProductID_FK
Foreign Key (ProductID) references Product(ID)
insert into OrderItems (Id ,
OrderId , ProductId , UnitPrice , Quantity)
values(1,3,2,346,2),
(2,1,2,23,5),
(3,2,3,233,6),
(4,3,1,2346,1),
(5,2,2,234,9)





CREATE TABLE OrderItem
(
ID int NOT NULL PRIMARY KEY,
OrderID int,
ProductID int,
UnitPrice int,
Quantity int
)
alter table OrderItem
add constraint
OrderItem_ProductID_FK
Foreign Key (ProductID) references Product(ID)
insert into OrderItem(ID ,
OrderID , ProductID , UnitPrice , Quantity)
values(1,3,2,346,2),
(2,1,2,23,5),
(3,2,1,233,6)




CREATE TABLE Product
(
ID int NOT NULL PRIMARY KEY,
ProductName nvarchar(50),
SupplierID int,
UnitPrice int,
Package nvarchar(50),
IsDiscontinued nvarchar(50)
)
alter table Product
add constraint
Product_SupplierID_FK
Foreign Key (SupplierID) references Supplier(ID)
INSERT INTO Product(ID,ProductName,SupplierID,UnitPrice,Package,IsDiscontinued)
VALUES (1,'N',1,22,'lOOSE','o'),
(2,'P',3,24,'PACK','Q'),
(3,'R',2,26,'LOOSE','S')



CREATE PROCEDURE spJoinSupplierAndProduct
AS

BEGIN
SELECT CompanyName,ContactName ,City ,Country ,Phone ,Fax
FROM Supplier
LEFT OUTER JOIN
Product
ON Supplier.ID = Product.ID
END

EXECUTE spJoinSupplierAndProduct


CREATE PROCEDURE spJoinSupplierAndProduct2
@CompanyName nvarchar(50), @ContactName nvarchar(50), @City nvarchar(50), @Country nvarchar(50),
@Phone int, @Fax int
AS

BEGIN
SELECT CompanyName,ContactName ,City ,Country ,Phone ,Fax
FROM Supplier
WHERE CompanyName= @CompanyName AND ContactName= @ContactName AND City= @City AND Country= @Country AND
Phone = @Phone AND Fax= @Fax
LEFT OUTER JOIN
Product
ON Supplier.ID = Product.ID
END
EXECUTE spJoinSupplierAndProduct2





     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.