NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

create table SupplierNew(
_id int PRIMARY KEY,
CompanyName varchar(20),
ContactName varchar(20),
City varchar(30),
Country varchar(30),
Phone int,
Fax varchar(40)
);

create table CustomerNew(
_id int PRIMARY KEY,
FirstName varchar(20),
LastName varchar(20),
City varchar(30),
Country varchar(30),
Phone int
)
create table OrderNew(
_id int PRIMARY KEY,
OrderDate datetime,
Customer_id int FOREIGN KEY REFERENCES CustomerNew(_id),
TotalAmount varchar(15)
);
create table Product(
_id int PRIMARY KEY,
ProductName varchar(200),
Suipplier_id int FOREIGN KEY REFERENCES SupplierNew(_id),
UnitPrice varchar(15),
Package varchar(30),
isDiscontinued int CHECK(isDiscontinued IN(0,1))
);

create table OrderItem(
_id int PRIMARY KEY,
Order_id int FOREIGN KEY REFERENCES OrderNew(_id),
Product_id int FOREIGN KEY REFERENCES Product(_id),
UnitPrice varchar(15),
Quantity int
);



INSERT INTO SupplierNew(_id, CompanyName ,ContactName ,City ,Country ,Phone,Fax) Values (1, 'ABC', 'John','Koklkata','India', 746373893, 668682166);
INSERT INTO SupplierNew(_id, CompanyName ,ContactName ,City ,Country ,Phone,Fax) Values (2, 'DEF', 'Daniel','Sydney','USA', 876373893, 987682166);
INSERT INTO SupplierNew(_id, CompanyName ,ContactName ,City ,Country ,Phone,Fax) Values (3, 'GHI', 'Ron','California','USA', 946373893, 79682166);

INSERT INTO CustomerNew Values (4, 'SGSIH', 'hsjhs','lksasnslk','India', 75508459);
INSERT INTO CustomerNew Values (5, 'SuySIH', 'jvvh','kghyuy','vgtbjct', 66890898);
INSERT INTO CustomerNew Values (6, 'SuytH', 'ressesrds','oujiojij','India', 755084598);

INSERT INTO OrderNew Values (7,SYSDATETIME(),1002, '2000');
INSERT INTO OrderNew Values (8,SYSDATETIME(),1003, '2000');
INSERT INTO OrderNew Values (9,SYSDATETIME(),1002, '2000');

INSERT INTO Product Values (10,'Sport Shoes', 101,'2000','XYZ', 0);
INSERT INTO Product Values (11,'Running Shoes', 102,'3500','XYZ', 0);
INSERT INTO Product Values (12,'Walking Shoes', 103,'4500','XYZ', 1);

INSERT INTO OrderItem Values (13,1011, 001, '4000', 4);
INSERT INTO OrderItem Values (14,1012, 003, '4500', 3);
INSERT INTO OrderItem Values (15,1013, 004, '5000', 2);

Select * from Product;

Select A.ProductName, B.CompanyName from Product A LEFT JOIN SupplierNew B on A.Suipplier_id = B._id;
Select A.FirstName, B._id from CustomerNew A LEFT JOIN OrderNew B on A._id = B.Customer_id;
Select A._id, B.Productname from OrderItem A LEFT JOIN Product B on A.Product_id = B._id;
Select * from OrderNew A LEFT JOIN OrderItem B on A._id = B.Order_id;
     
 
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.