NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

create table users(
id int primary key ,
full_name varchar(20) ,
email nvarchar(20),
gender nvarchar(20) ,
date_of_birth nvarchar(20) ,
country_code int ,
created_at nvarchar(20)
)

create table countries(
code int primary key ,
name nvarchar(20) ,
continent_name nvarchar(20)
)

create table merchants(
id int primary key ,
merchant_name varchar(20),
admin_id int ,
country_code int ,
created_at varchar(20)
)

create table OrderItems(
orderid int Primary Key ,
product_id int ,
quantity int
)

create table orders(
id int primary key ,
user_id int ,
status nvarchar(20),
created_at nvarchar(20)
)

create table products(
id int Primary key ,
merchant_id int ,
name nvarchar(20),
price int ,
status nvarchar(20),
created_at nvarchar(20)
)

Insert into OrderItems(orderid , product_id , quantity)
values( 101 , 201 , 100),
(102,202,150),
(103,203,50)

Insert into orders(id , user_id,status,created_at)
values(101 , 301 , 'Shipped' ,'Kolkata'),
(102 , 302 , 'Not-Shipped' ,'Bangalore'),
(103 , 303 , 'Out For Delivery' ,'Rajasthan')

Insert into products(id , merchant_id,name, price, status,created_at)
values(401 , 501 , 'TV' , 1000 , 'Shipped' ,'Kolkata'),
(402 , 502 , 'Micro-Oven' , 2000 , 'Non-Shipped' ,'Bangalore'),
(403 , 503 , 'Laptop' , 5000 , 'Out For Delivery' ,'Rajasthan')

Insert into merchants(id,merchant_name,admin_id,country_code,created_at)
values(501 , 'Techno',301,601,'Kolkata'),
(502 , 'Eco',302,602,'Bangalore'),
(503 , 'Alpha',303,603,'Rajasthan')

Insert into users (id , full_name,email,gender,date_of_birth,country_code,created_at)
values(301 , 'Ritu' , '[email protected]','Female','21-05-2000', 601 ,'Kolkata'),
(302 , 'Madhu' , '[email protected]','Female','18-07-1995', 602 ,'Bangalore'),
(303 , 'Arijit' , '[email protected]','Male','11-03-1964', 603 ,'Rajasthan')

Insert into countries(code,name,continent_name)
values(601 , 'India','Asia'),
(602 , 'India','Asia'),
(603 , 'India','Asia')

Alter table Orders
add constraint
orderfk foreign key(id) references OrderItems( orderid)

Alter table products
add constraint
merchantfk foreign key(merchant_id) references merchants(id)

Alter table OrderItems
add constraint
pfk foreign key(product_id) references products(id)

Alter table orders
add constraint
ordersfk foreign key(user_id) references users(id)


Alter table merchants
add constraint
usersfk foreign key(admin_id) references users(id)

Alter table merchants
add constraint
countryfk foreign key(country_code) references countries(code)
     
 
what is notes.io
 

Notes is a web-based application for online 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 14 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.