Experiment: 3.
Aim: Perform data analysis using SQL
Software Required: Oracle Live SQL
Relevance of the Experiment: The experiment is relevant in the context of Business Intelligence
(BI) as it focuses on performing data analysis using SQL. SQL (Structured Query Language) is a
powerful tool for managing and manipulating databases, making it crucial for BI professionals who
need to extract meaningful insights from data. Understanding SQL and its data analysis capabilities
enables users to perform complex queries, aggregate data, and generate reports for informed
decision-making.
Implementation:
create table customers(
c_id INTEGER,
f_name VARCHAR(100),
l_name VARCHAR(100),
age INTEGER,
country VARCHAR(100));
create table orders(
o_id INTEGER,
item VARCHAR(100),
amount INTEGER,
c_id INTEGER);
- - insert command
- - inserting records in Customers table
insert into customers values(1, 'John', 'Doe', 31, 'USA');
Name: Ishika UID: 20BCS9499
insert into customers values(2, 'Robert', 'Luna', 22, 'USA');
insert into customers values(3, 'David', 'Robinson', 22, 'UK');
select * from customers;
Fig 1: Customers Table
- - insert command
- - inserting records in Orders table
insert into orders values(1, 'Keyboard', 400, 3);
insert into orders values(2, 'Mouse', 300, 1);
insert into orders values(3, 'Monitor', 12000, 2);
select * from orders;
Fig 2: Orders Table
Name: Ishika UID: 20BCS9499
- - update command
- - updating a record in Customers table
update customers set age= 30 where c_id= 2;
Fig 3: Updated Customers Table
- - delete command
- - deleting a record in Orders table
delete from orders where o_id = 2;
Fig 4: Deleted record from Orders Table
Name: Ishika UID: 20BCS9499
- - inner join
select customers.c_id,f_name,age,o_id,item,amount
from customers
inner join orders
on customers.c_id = orders.c_id;
Fig 5: Table after applying inner join on Customers and Orders tables
Name: Ishika UID: 20BCS9499