NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

create database prac1810

use prac1810

create table products
(
id int Not Null Primary Key,
merchant_id int Not Null,
[name] varchar (30),
price int,
[status] varchar (10),
created_at varchar (30)
)

create table order_items
(
order_id int Not Null Primary Key,
product_id int Not Null,
quantity int
)

create table orders
(
id int Not Null Primary Key,
[user_id] int Not Null,
[status] varchar (10),
created_at varchar (30)
)

create table countries
(
code int Not Null Primary Key,
[name] varchar (30),
continent_name varchar (30)
)

create table merchants
(
id int Not Null Primary Key,
merchant_name varchar(30),
admin_id int Not Null,
country_code int Not Null,
created_at varchar (30)
)

create table users
(
id int Not Null Primary Key,
full_name varchar(30),
email varchar(30),
gender varchar(10),
date_of_birth varchar(30),
country_code int Not Null,
created_at varchar (30)
)

insert into products
values(1,2,'Chocolate',150,'Available','17/10/2022'),
(2,3,'Cold drink',15,'NA','10/10/2010'),
(3,1,'Coffee',10,'Available','15/10/2022')

insert into order_items
values(1,1,10),
(2,3,20),
(3,2,50)

insert into orders
values(1,3,'Available','14/02/1997'),
(2,2,'NA','15/08/2009'),
(3,1,'NA','17/12/2010')

insert into countries
values(356,'India','Asia'),
(764,'Thailand','Asia'),
(124,'Canada','North America')

insert into merchants
values(1,'Milton',2,764,'15/08/2009'),
(2,'Ethan',1,356,'15/08/2010'),
(3,'Kaleb',3,124,'19/08/2009')

insert into users
values(1,'Apurva Awasthi','[email protected]','Female','15/08/1985',764,'19/05/2020'),
(2,'Mohd Shadab','[email protected]','Male','10/09/1988',356,'17/10/2015'),
(3,'Esther Lall','[email protected]','Female','23/01/1967',124,'05/08/2001')

alter table order_items
add constraint order_id_FK FOREIGN KEY (order_id) references orders(id),
constraint prod_id_FK FOREIGN KEY (product_id) references products(id)

alter table orders
add constraint user_id_FK FOREIGN KEY ([user_id]) references users(id)

alter table merchants
add constraint admin_id_FK FOREIGN KEY (admin_id) references users(id),
constraint country_mcode_FK FOREIGN KEY (country_code) references countries(code)

alter table users
add constraint country_code_FK FOREIGN KEY (country_code) references countries(code)

alter table products
add constraint merchant_id_FK FOREIGN KEY (merchant_id) references merchants(id)

select * from products
select * from order_items
select * from orders
select * from countries
select * from merchants
select * from users
     
 
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.