NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

create database practice1

create table ORDERITEM
(Id int Not Null Primary Key,
OrderId int,
ProductId int,
UnitPrice int,
Quantity int)
insert into ORDERITEM(Id,OrderId,ProductId,UnitPrice,Quantity)
Values(1,1,1,10,5),
(2,2,2,34,3),
(3,3,3,45,7),
(4,4,4,54,8),
(5,5,5,32,2)

SELECT * FROM ORDERITEM

create table Product
(Id int Not Null Primary Key,
ProductName nvarchar(50),
SupplierId int,
UnitPrice float,
Package nvarchar(50),
isDiscontinued int)
insert into Product(Id,ProductName,SupplierId,UnitPrice,Package,isDiscontinued)
Values(1,'PEN',1,23,'ABC',1),
(2,'BALL',2,34,'BCD',1),
(3,'HAT',3,45,'CDE',1),
(4,'FURR',4,56,'DEF',0),(5,'MUG',5,57,'YAA',0)

SELECT * FROM Product


create table ORDERtbl
(Id int Not Null Primary Key,
OrderDate DATE,
CustomerId int,
TotalAmount float)
insert into ORDERtbl(Id,OrderDate,CustomerId,TotalAmount)
Values(1,'2022-03-02',1,33),
(2,'2022-03-01',2,44),
(3,'2022-04-03',3,55),
(4,'2022-01-03',4,66),
(5,'2022-01-02',5,77)

SELECT * FROM ORDERtbl

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,'CompanyA','SupplierA','New Dehi','India',123,321),
(2,'CompanyB','SupplierB','New Dehi','India',234,432),
(3,'CompanyC','SupplierC','New Dehi','India',345,543),
(4,'CompanyD','SupplierD','New Dehi','India',456,654),
(5,'CompanyE','SupplierE','New Dehi','India',567,765)

SELECT * FROM SUPPLIER

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,'YASHI','RAI','LUCKNOW','INDIA',1234567),
(2,'PARVIKA','GUPTA','AGRA','INDIA',1234),
(3,'YASHVI','JAIN','BANGALORE','INDIA',123),
(4,'TEEJAY','SINHA','GURGAON','INDIA',12),
(5,'AMAAN','ANJUM','LUCKNOW','INDIA',12345)

SELECT * FROM CUSTOMER

alter table ORDERITEM
add constraint ORDERITEM_PRODUCT_FK Foreign Key(ProductId)
references PRODUCT

alter table ORDERITEM
add constraint ORDERITEM_ORDER_FK Foreign Key(OrderId)
references ORDERtbl

alter table PRODUCT
add constraint PRODUCT_SUPPLIER_FK Foreign Key(SupplierId)
references SUPPLIER

alter table ORDERtbl
add constraint ORDER_CUSTOMER_FK Foreign Key(CustomerId)
references CUSTOMER

update Product
set UnitPrice=57
where UnitPrice=56

delete OrderItem
where id=1
     
 
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.