0% found this document useful (0 votes)
25 views4 pages

BA 2.2 Prashant

Experiment 2.2 aimed to teach business analytics skills including creating a database and table, altering a table, creating views, functions, and indexes, and dropping objects. Key steps included using SQL commands to create a Business_Analytics database and Table_Name table with columns, alter a table by adding a column, create a view using a SELECT statement, create count, sum, avg, and max functions, build an index on two columns of a table, and drop a column from a table. The student learned how to perform these fundamental database operations.

Uploaded by

deadm2996
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

BA 2.2 Prashant

Experiment 2.2 aimed to teach business analytics skills including creating a database and table, altering a table, creating views, functions, and indexes, and dropping objects. Key steps included using SQL commands to create a Business_Analytics database and Table_Name table with columns, alter a table by adding a column, create a view using a SELECT statement, create count, sum, avg, and max functions, build an index on two columns of a table, and drop a column from a table. The student learned how to perform these fundamental database operations.

Uploaded by

deadm2996
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Experiment 2.

Business Analytics

Student Name : Prashant UID:-22MCA20996

Branch:- UIC Section/Group: 22MCA-3B

Semester:- 3rd Date of Performance:13/09/23

Subject Code:- 22CAH-703

---------------------------------------------------------------------------------------------

Aim of Experiment: Create Database, Create Table, Alter Table, Create View, Creating
Function, Creating Index and Dropping Objects.

(1). Create Database :- SYNTAX: Create Database Business_Analytics;

(2). Creating Table :-


SYNTAX:

Create Table Table_Name ( Column name data_type, Column name data-type,…….);


(3). Alter Table :-
SYNTAX: ALTER TABLE table_name ADD column_name datatype;

(4). Create View :-

SYNTAX:
CREATE VIEW view_name AS
SELECT column1, column2, ...
FROM table_name WHERE condition;
(5). Creating Function :-
1) Count
SELECT COUNT(*) FROM Student
WHERE Math_score > 60;

2) Sum : SELECT SUM(Math_score) FROM Student;

3) AVG :SELECT AVG(Math_score) FROM Student;

4) MAX SELECT MAX(Math_score) FROM Student;


(6). Creating Index :-
CREATE INDEX idx ON Student(Student_id, Student_name);

(7). Dropping Objects :-


Dropping Column :- ALTER TABLE Student DROP COLUMN Mobileno ;
select * from Student

Learning outcomes:-
1. I have learn how to create database
2. I have learn how to create and alter table.
3. I have learn how to create view, indexes and function.

You might also like