SQL Report: (A Report On SQL Queries Based On Transactional Processing Systems)

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

SQL Report

(A Report on SQL Queries based on Transactional Processing Systems)

Report by: Submitted to:


Arush Saxena – 21BSP0 Dr. Gauri Jain
Gaurav Arora – 21BSP0 Information Systems for
Kshitij Agrawal – 21BSP0873 Managers
Kunal Banerjee – 21BSP0874
Contents
1. Company Profile (3)
1.1 Overview
1.2 Transaction Processing Systems

2. Database Creation (4)


2.1 Big Basket Database
2.2 Tables
2.2.1 Customers
2.2.2 Orders
2.2.3 Inventory
2.2.4 Suppliers

3. Relationship Diagram (11)


3.1 Relation through MS Access

4. SQL Query Statements (12)

5. References (10)

SQL Report – Big Basket | 2


Company Profile
1.1 Overview
Big Basket is an online food delivery platform, covering wide range of
products being delivered fresh and safe at the doorsteps across India.
The company is spread across 24 cities, headquartered in Bangalore.
The company’s aim is to provide hassle-free shopping and delivery of
convenience needs to the customer.

1.2 Transaction Processing Systems


Transaction Processing Systems perform the operational level functions
of the management such as collecting, storing, modifying, and retrieving
the data transactions. These systems help the company in capturing a
large amount of data. Example include point-of-sale service, ticket
reservation systems, sales order.
At Big Basket, the Transaction Processing System filters data and
places them under tables such as customers, orders, inventory, sales,
suppliers, and so on.

Database Creation
SQL Report – Big Basket | 3
2.1 Big Basket Database

To create a database for Big Basket we write the following query:

Create database Big_Basket;

Result: Query successful. Database created.

2.2 Tables:
Then we create the following tables along with its characteristics:

2.2.1 Customers

create table cust(Customer_ID varchar(20) primary key not null, Customer_Name


varchar(20), Customer_Address varchar(30), Postal_Code varchar(20), Customer_Phone
int[10] );
insert into cust values('c001','rajesh','sec-30 dehradun',243233,8127053998)
insert into cust values('c002','kapil','sec-30 chandigarh',232133,8168053998)
insert into cust values('c003','amit','sec-40 lucknow',230033,8111253998)
insert into cust values('c004','ayush','sec q lucknow',230063,8111653998)
insert into cust values('c005','rajesh','RKpuram Delhi',230073,8111273998)
insert into cust values('c006','priyanshu','sector 20 cybercity gurgaon',230033,8111253998)
insert into cust values('c007','yash','sec-40 bareilly',230093,8199253998)
insert into cust values('c008','deepak','shastrinagar rishikesh
Uttarakhand',330033,8111253998)
insert into cust values('c009','keshav','kothanur bangalore karnataka',430033,8861253998)
insert into cust values('c010','dheerav','secor 10 hudacity gurugram
haryana',260033,8981253998)
insert into cust values('c011','Ram','mahanagar bharmour himachal
pradesh',530033,8011253998)
insert into cust values('c012','Shyam','sector a aliganj lucknow UP',280033,8231253998)
insert into cust values('c013','ritesh','udyog vihar gurgaon',730033,8111253998)

SQL Report – Big Basket | 4


insert into cust values('c014','akshat','shantinagar dehradun
uttarakhand',430033,8444253998)
insert into cust values('c015','aatish','funcity bhopal MP',540033,8001253998)
insert into cust values('c016','amal','white field bangalore Karnataka',255033,7111253998)
insert into cust values('c017','sonu','north city nainital uttarakhand',276033,9111253998)
insert into cust values('c018','Sam','sector 30 Noida UP',288033,8001253998)
insert into cust values('c019','Rishi','sec d lucknow UP',291033,8771253998)
insert into cust values('c020','raju','pratapgarh Jaipur Rajasthan',330033,8661253998)

Result:

2.2.2 Orders

SQL Report – Big Basket | 5


Create table Orders
(
Order_ID varchar(6) PRIMARY KEY,
Customer_ID numeric(4) NOT NULL,
Order_Item char(25),
Order_Qty numeric(5) NOT NULL,
Order_Price numeric(6),
Order_Date date
);

Result: The table has been created.

To view the structure of the table,


Select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = ‘Orders’;

This query specifically runs on Microsoft SQL Server Management Studio 2018 only.
The general query for displaying table structure is
DESCRIBE Orders;
insert into Orders
Values ('OD1100','c001','Vegetables Saver Pack',1, 275,'25-AUG-21'),
('OD1101','c002','Wheat flour',1, 450,'26-AUG-21'),
('OD1102','c003','Butter Pack of Two',2, 65,'26-AUG-21'),
('OD1104','c004','Corn Flakes',2,100,'24-AUG-21'),
('OD1103','c005','Herbal Tea Pack',1,35,'23-AUG-21'),
('OD1105','c006','Noodles Pack of Six',4,100,'22-AUG-21'),
('OD1006','c007','Coke Diet',4,120,'22-AUG-21'),
('OD2001','c008','Wheat Flour',2,750,'01-SEP-21'),
('OD2101','c009','Noodles Pack of Six',1,35,'22-SEP-21'),
('OD2102','c010','Lemon Drink Medium',2,185,'22-SEP-21'),
('OD1107','c011','Spice Pack One',2,40,'13-SEP-21'),
('OD1218','c012','Yogurt Fresh',1,55,'12-SEP-21'),
('OD1304','c013','Corn Flakes',4,425,'24-AUG-21'),
('OD1203','c014','Herbal Tea Pack',2,60,'23-AUG-21'),
('OD1305','c015','Noodles Pack of Six',2,50,'22-AUG-21'),
('OD1046','c016','Coke Diet',1,30,'22-AUG-21'),
('OD2011','c017','Wheat Flour',5,1200,'01-SEP-21'),
('OD2131','c018','Noodles Pack of Four',1,35,'22-SEP-21'),
('OD2108','c019','Lemon Drink Medium',4,225,'22-SEP-21'),
('OD1207','c020','Spice Pack One',5,80,'13-SEP-21');

SQL Report – Big Basket | 6


Result:

2.2.3 Inventory

CREATE TABLE Inventory


(Inventory_ID int,
Inventory_Item_name varchar(255),
Inventory_qty int,
Inventory_Warehouse_Number int,
Inventory_Item_price int)
Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,
Inventory_Warehouse_Number, Inventory_Item_price)

values (2001, "apple", 10, 532415, 120)

Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,


Inventory_Warehouse_Number, Inventory_Item_price)

values (2003, "Fruity", 100, 245456, 20)

Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,


Inventory_Warehouse_Number, Inventory_Item_price)

values (2006, "shorts", 60, 124548, 250)


Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,
Inventory_Warehouse_Number, Inventory_Item_price)

values (2020, "Sunflower oil", 120, 324648, 180)

SQL Report – Big Basket | 7


Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,
Inventory_Warehouse_Number, Inventory_Item_price)

values (2324, "Books", 65, 524753, 200)


Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,
Inventory_Warehouse_Number, Inventory_Item_price)

values (5334, "Curtains", 30, 327753, 2000)


Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,
Inventory_Warehouse_Number, Inventory_Item_price)

values (6324, "Towel", 300, 774453, 150)


Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,
Inventory_Warehouse_Number, Inventory_Item_price)

values (7714, "Utensils", 70, 100237, 800)


Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,
Inventory_Warehouse_Number, Inventory_Item_price)

values (8314, "Cusions", 130, 324287, 300)


Insert into Inventory (Inventory_ID, Inventory_Item_name, Inventory_qty,
Inventory_Warehouse_Number, Inventory_Item_price)

values (1238, "flowers", 30, 213483, 30)

Result:

2.2.4 Suppliers

SQL Report – Big Basket | 8


CREATE TABLE Supplier

Supplier_ID INT,

Supplier_Name Varchar(250),

Supplier_Address Varchar(250),

Supplier_Conatact_No INT

INSERT INTO Supplier values

(101,'Britania','U 9/8,DLF Phase 3, Gurgaon 100002',9576767676),

(102,'Nestle','4/14, Sector 22, Gurgaon 100067',9785858585),

(103,'Country Delight','3/15,Sector 54, Gurgaon 100056',9869696969),

(104,'Amul','6/3,T 18/2,Sector 21, Gurgaon, 100075', 9200022222),

(105,'Mother Dairy', '7/9, Sector 56, Gurgaon, 100002',9347474747),

(106,'Kellogs','5/4, Sector 43, Gurgaon, 100045',9400404040),

(107,'Haldiram','6/18,Sector 22,Gurgaon,100234',9876767667),

(108,'Bikaner','21/4, Sector 18,Gurgaon 100087',9100938383),

(109,'Priyagold','U 12/8,DLF Phase 2, Gurgaon 107872',9865837465),

(110,'Ashirvaad','22/5,Sector 19, Gurgaon 108572',9677888933),

(111,'Fortune','56/2,Sector 52, Noida 100453',9988776523),

(112,'Tops','16/3,Paharganj, Delhi 100212',9146784326),

(113,'Lakme','7/1,Sector 22E, Gurgaon 100672',9577853256),

(114,'Nature Fresh','15/3,Sector 24, Noida 100876',9576347825),

(115,'Chings','D 33,DLF Phase 2, Gurgaon 104562',9577456436),

(116,'Loreal','17/5,Kavi Nagar, Ghaziabad 100874',9974387289),

SQL Report – Big Basket | 9


(117,'Rajdhani','C 19/2,Karol Bagh, Delhi 100078',9578535876),

(118,'Patanjali','21/6,Kharibawli, Delhi 105667',6387755643),

(119,'Cocacola','7/12,Sector 21, Old Delhi 103344',9987654235),

(120,'Dettol','6/18,Sector 32, Gurgaon 105767',9574567895)

Result:

SQL Report – Big Basket | 10


SQL Report – Big Basket | 11

You might also like