0% found this document useful (0 votes)
21 views39 pages

Goysha ISM Lab File (FINAL) - 3

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)
21 views39 pages

Goysha ISM Lab File (FINAL) - 3

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/ 39

A

Practical file on
INFORMATION SYSTEMS MANAGEMENT - LAB (BBA 307)

Submitted To: Submitted By:

Mr. Mohit Khatri Goysha Vishnoi


Assistant Professor, RDIAS BBA-V
Roll No :- 04615901722

RUKMINI DEVI INSTITUTE OF ADVANCED STUDIES

An ISO 9001:2015 Certified Institute

NAAC Accredited: A Grade (3rd Cycle), Category A+ Institution (by SFRC, Govt of NCT of

Delhi)

(Approved by AICTE, HRD Ministry, Govt. of India) Affiliated to Guru Gobind Singh

Indraprastha University, Delhi

2A & 2B, Madhuban Chowk, Outer Ring Road, Phase-1, Delhi-110085


ACKNOWLEDGEMENT

I am deeply indebted to Mr. Mohit Khatri, Assistant Professor at Rukmini Devi Institute of

Advanced Studies (RDIAS), for his invaluable guidance, support, and mentorship throughout the

preparation of this practical file on Information Systems Management - Lab (BBA 307). His

detailed explanations and constructive feedback have been instrumental in enhancing my

understanding of various concepts and in completing this project effectively.

I would also like to extend my sincere gratitude to the esteemed faculty members of RDIAS, who

have consistently provided their knowledge and encouragement, fostering an environment

conducive to learning and growth.

My heartfelt thanks go to my peers for their collaborative spirit and my family for their unwavering

support and encouragement, which have played a crucial role in motivating me to give my best.

Name of the Student: Goysha Vishnoi


Enrolment Number: 04615901722
Class and Section: BBA Semester-V Morning C
CERTIFICATE

This is to certify that the practical file titled "Information Systems Management - Lab (BBA

307)" has been successfully completed and submitted by Goysha Vishnoi, Roll No: 04615901722,

a student of BBA-V Semester at Rukmini Devi Institute of Advanced Studies.

The work presented in this practical file is the result of the student’s dedicated efforts and has been

completed under my guidance during the academic session 2024–2025. The file includes the

practical application of concepts and tasks related to database management, SQL, and entity-

relationship modeling as per the curriculum requirements.

I hereby affirm that the content of this practical file is original and meets the standards of academic

rigor as set forth by the institute.

Name of the Faculty: Mr. Mohit Khatri


Designation of the Faculty: Assistant Professor, RDIAS
INDEX

Page
S.No LIST OF QUESTIONS No.

Demonstrate the understanding of facts by:


1 A. Making a pictorial presentation of a table and its different components 1-2
B. Make a cheat sheet of all the Basic DDL commands

Create a table Student using the following Schema


Column Data Size
name type

Reg_no Varchar 10
2 3-4
Name Char 30

DOB date

Address Varchar 50

Design an Entity Relationship (ER) model for a college database in MS


word. Say we have the following statements.

● A college contains many departments


● Each department can offer any number of courses
● Many instructors can work in a department
3 ● An instructor can work only in one department 5-6
● For each department there is a Head
● An instructor can be head of only one department
● Each instructor can take any number of courses
● A course can be taken by only one instructor
● A student can enroll for any number of courses
● Each course can have any number of students
Dept_identify any 5 tables from above case study , create them and add
4 7 – 14
at least 5 rows in each.
Using the table you created (Student) in question 3 (Annexure 1) solve the
following queries using DDL commands.
5 15 - 17
A. Display the schema of the Student table.
B. Rename the table to ‘Candidate’.
C. Single line and Multi line comment
D. Truncate the table Student.
E. DROP the table Student.
Solve the following queries making use of DDL commands:
Columns Data Type & constraints
EMP_NO Number
EName Varchar (20), NOT NULL
JOB Varchar(10), DEFAULT ‘MANAGER’
HIREDATE number, UNIQUE
6 SAL number, CHECK (SAL>=800) 18 - 20
A. Create table Employee as per the data provided above in the table.
B. Add new Column email as varchar(15) .
C. Change the data type of Column Hiredate to date in the table.
D. Which field will you choose as primary key? Why? Apply to it
primary key constraint.
Drop the attribute email.

Perform following SQL DML commands using table (Employee) created in


the question above.

A. Insert records to the table with row 4 having JOB entry as default value.
B. Enter Salary as 100 to verify the running of Check constraint.
C. DELETE the third row.
D. Add Attribute experience as varchar(10). Fill the records in the column
using reference of empno and name.

7 21 - 24
Solve the following SQL queries using table (Employee) created in the
question above.
A. Write a query to display the records of employees in alphabetical order of
their name.
B. Write a query to display name, job and hiredate of salesman only.
C. Write the query to display name of employee having in their names ‘ll' or ‘tt’.
D. Write a query to display employees who are analyst or salesman in
8 25 - 28
descending order of names.
E. Write the query to display name, empno, job and hiredate of employees
hired between '08–jun–1981' and '16–apr–1982';
F. Write the query to display employees who are managers and have salary
above 2500.
G. Write the query to display employees who are NOT analyst.
H. Write the query to display the distinct jobs.

Use the table Employee given in Q7 and solve the following queries to understand
the usage of AGGREGATE FUNCTIONS
A. Count the number of job available.
Count number of clerks.
9 29 - 31
B. Find the total of EMPNO and SAL.
C. Find minimum and maximum salary of Managers.
D. Find the average of salary and name it AverageSalary.
E. Write a query to get the difference between the highest and lowest salaries.

Write the Query to get the given output.

10 32 - 34

More on AGGREGATE FUNCTIONS


D. Display data of table having salary greater than the average salary of all
employees in descending order of names.
E. Display name, hiredate and job of the employees having salary equal to the
averagesalary of all staff members in ascending order of names.
Q-1 Demonstrate the understanding of facts by:
A. Making a pictorial presentation of a table and its different components
B. Make a cheat sheet of all the Basic DDL commands

Ans 1- A) Pictorial presentation of a table and its different components (created in MS


PowerPoint)

1
B) Cheat sheet of all the Basic DDL commands

1. CREATE: Used to create a new table or database.


For example:- CREATE TABLE Users (
ID INT,
Name VARCHAR(100),
Age INT );

2. ALTER: Modifies an existing table (e.g., adding/removing columns).


For example:- ALTER TABLE table_name
ADD column_name datatype;

3. DROP: Deletes a table or database.


For example:- DROP TABLE table_name;

4. TRUNCATE: Removes all rows from a table but keeps its structure.
For example:- TRUNCATE TABLE table_name;

5. RENAME: Changes the name of a table.


For example:- RENAME TABLE old_name TO new_name;

6. COMMENT: Adds a descriptive remark to a table or column.


For example:- COMMENT ON {TABLE | COLUMN} object_name IS 'comment_text';

2
Q-2 Create a table Student using the following Schema

Column name Data type Size

Reg_no Varchar 10

Name Char 30

DOB date

Address Varchar 50

Ans 2- Create a table Students


- Created table using this command

3
- The table shows column_name, data_type, data_length

4
Q-3 Design an Entity Relationship (ER) model for a college database in MS word. Say we
have the following statements.

● A college contains many departments


● Each department can offer any number of courses
● Many instructors can work in a department
● An instructor can work only in one department
● For each department there is a Head
● An instructor can be head of only one department
● Each instructor can take any number of courses
● A course can be taken by only one instructor
● A student can enroll for any number of courses
● Each course can have any number of students

Ans 3- Entity Relationship (ER) model for a college database

5
Q-4 Dept_identify any 5 tables from above case study , create them and add at least 5 rows
in each.

Ans 4 - 5 tables from above case study

1. Department Table - This table stores the details of departments in the college.

- Inserting 5 rows into Department table

6
- Table Created

2. Instructor Table - This table stores the details of instructors working in different
departments.

7
- Inserting 5 rows into Instructor table

- Table Created

8
3. Course Table- This table stores information about courses offered by departments.

- Inserting 5 rows into Course table

9
- Table Created

4. Student Table - This table stores information about students in the college.

10
- Inserting 5 rows into studentss table

- Table Created

11
5. Enrollment Table - This table stores information about which students have enrolled in
which courses.

- Inserting 5 rows into Enrollment table

12
- Table Created

13
Q-5 Using the table you created (Student) in question 3 (Annexure 1) solve the following
queries using DDL commands.

F. Display the schema of the Student table.

G. Rename the table to ‘Candidate’.

H. Single line and Multi line comment

I. Truncate the table Student.

J. DROP the table Student.

Ans 5 a) Display the schema of the Student table.

b) Rename the table to ‘Candidate’

14
c) Single line and Multi line comment

Single line comment


-- This is a single-line comment
SELECT * FROM Employee; -- Selecting all records from the Employee table

Multi line comment


/*
This is a multi-line comment.
It can span multiple lines.
*/
SELECT * FROM Employee;

d) Truncate the table Student

15
e) DROP the table Student.

16
Q-6 Solve the following queries making use of DDL commands:
Columns Data Type & constraints
EMP_NO Number
EName Varchar (20), NOT NULL
JOB Varchar(10), DEFAULT ‘MANAGER’
HIREDATE number, UNIQUE
SAL number, CHECK (SAL>=800)

A. Create table Employee as per the data provided above in the table.
B. Add new Column email as varchar(15) .
C. Change the data type of Column Hiredate to date in the table.
D. Which field will you choose as primary key? Why? Apply to it primary key
constraint.
E. Drop the attribute email.

Ans 6 a) CREATE TABLE Employee (


EMP_NO NUMBER,
EName VARCHAR(20) NOT NULL,
JOB VARCHAR(10) DEFAULT 'MANAGER',
HIREDATE NUMBER UNIQUE,
SAL NUMBER CHECK (SAL >= 800)
);

17
b) ALTER TABLE Employee
ADD email VARCHAR(15);

c) ALTER TABLE Employee


MODIFY HIREDATE DATE;

18
d) The EMP_NO field should be chosen as the primary key because it is unique for each
employee and serves as a unique identifier for each record.
ALTER TABLE Employee
ADD CONSTRAINT pk_employee PRIMARY KEY (EMP_NO);

e) ALTER TABLE Employee


DROP COLUMN email;

19
Q-7 Perform following SQL DML commands using table (Employee) created in the
question above.

E. Insert records to the table with row 4 having JOB entry as default value.

F. Enter Salary as 100 to verify the running of Check constraint.

G. DELETE the third row.

H. Add Attribute experience as varchar(10). Fill the records in the column using
reference of empno and name.

Ans 7 a) insert records insert into employee (emp_no, ename, job, hiredate, sal) values (7369,
'smith', 'clerk', to_date('1980-12- 17', 'yyyy-mm-dd'), 800);
insert into employee (emp_no, ename, job, hiredate, sal) values (7499, 'allen', 'salesman',
to_date('1981- 02-20', 'yyyy-mm-dd'), 1600);
insert into employee (emp_no, ename, job, hiredate, sal) values (7521, 'ward', 'salesman',
to_date('1981- 02-22', 'yyyy-mm-dd'), 1250);
insert into employee (emp_no, ename, job, hiredate, sal) values (7566, 'jones', default,
to_date('1981-04- 02', 'yyyy-mm-dd'), 2975);
insert into employee (emp_no, ename, job, hiredate, sal) values (7654, 'martin', 'salesman',
to_date('1981-09-28', 'yyyy-mm-dd'), 1250);
insert into employee (emp_no, ename, job, hiredate, sal) values (7698, 'blake', 'manager',
to_date('1981- 05-01', 'yyyy-mm-dd'), 2850);
insert into employee (emp_no, ename, job, hiredate, sal) values (7782, 'clark', 'manager',
to_date('1981- 06-09', 'yyyy-mm-dd'), 2450);
insert into employee (emp_no, ename, job, hiredate, sal) values (7788, 'scott', 'analyst',
to_date('1987- 04-19', 'yyyy-mm-dd'), 3000);
insert into employee (emp_no, ename, job, hiredate, sal) values (7839, 'king', 'president',
to_date('1981- 11-17', 'yyyy-mm-dd'), 5000);
insert into employee (emp_no, ename, job, hiredate, sal) values (7844, 'turner', 'salesman',
to_date('1981-09-08', 'yyyy-mm-dd'), 1500);

20
b) insert into employee values('7844','turner','salesman','8-sep-81','100');

21
c) delete from employee where emp_no=7521

d) alter table employee add experience varchar(10)

B- update employee set experience='two' where emp_no='7369';

22
update employee set experience='three' where emp_no='7499';

update employee set experience='seven' where emp_no='7566';

update employee set experience='one' where emp_no='7654';

update employee set experience='four' where emp_no='7698';

update employee set experience='two' where emp_no='7782';

update employee set experience='three' where emp_no='7788';

update employee set experience='five' where emp_no='7839';

update employee set experience='two' where emp_no='7844';

23
Q- 8 Solve the following SQL queries using table (Employee) created in the
question above.

I. Write a query to display the records of employees in alphabetical order of their name.
J. Write a query to display name, job and hiredate of salesman only.
K. Write the query to display name of employee having in their names ‘ll' or ‘tt’.
L. Write a query to display employees who are analyst or salesman in descending order of
names.
M. Write the query to display name, empno, job and hiredate of employees hired between '08–
jun–1981' and '16–apr–1982';
N. Write the query to display employees who are managers and have salary above 2500.
O. Write the query to display employees who are NOT analyst.
Write the query to display the distinct jobs.

Ans 8 part-a select* from employee order by ename

Part-b select ename , heridate, job from employee where job='salesman'

24
Part-c select* from employee where ename like'%ll%' or ename like'%tt%';

Part-d select* from employee where job='salesman' or job='analyst' order by ename desc;

25
Part-e select ename, emp_no, job, heridate from employee where heridate between ('08-jun
1981') and ('16-apr-1982');

Part-f select* from employee where job='manager' and salary>2500;

26
Part-g select* from employee where job<>'analyst';

Part-h select distinct job from employee;

27
Q-9 Use the table Employee given in Q7 and solve the following queries to understand the
usage of AGGREGATE FUNCTIONS
A. Count the number of job available. Count number of clerks.
B. Find the total of EMPNO and SAL
C. Find minimum and maximum salary of Managers.
D. Find the average of salary and name it AverageSalary.
E. Write a query to get the difference between the highest and lowest salaries.

Ans 9 A) Count the number of job available.


Count number of clerks.

Command - Select Count(Distinct job) from employee;

Count number of clerks.


Command - Select count(job) from employee where job='clerk';

28
B) Find the total of EMPNO and SAL.
Command - Select Sum(EMP_NO), Sum(SAL) from
employee;

C) Find minimum and maximum salary of Managers.


Command - SELECT MIN(SAL) , MAX(SAL)
FROM Employee
WHERE job = 'manager';

29
D) Find the average of salary and name it AverageSalary.
Command - SELECT AVG(SAL) FROM Employee;

E) Write a query to get the difference between the highest and lowest salaries.
Command - Select Max(sal) - min(sal) from employee;

30
Q-10 Write the Query to get the given output.

More on AGGREGATE FUNCTIONS

D. Display data of table having salary greater than the average salary of all employees in
descending order of names.

E. Display name, hiredate and job of the employees having salary equal to the
averagesalary of all staff members in ascending order of names.

Ans 10 A) Command – Select avg(sal), Count(DISTINCTJOB) from employee;


OUTPUT –

31
B) Command – Select Max(sal) as HIGHEST_BONUS , Min(sal) as LOWEST_BONUS,
Sum(sal) as TOTAL_BONUS, avg(sal) as AVERAGE_BONUS from employee;
OUTPUT –

C) Command – Select max(sal) from employee where job=’salesman’;

OUTPUT –

32
D) Display data of table having salary greater than the average salary of all employees in
descending order of names.

Command – SELECT * FROM Employee

WHERE SAL > (SELECT AVG(SAL) FROM Employee)

ORDER BY ENAME DESC;

OUTPUT –

E) Display name, hiredate and job of the employees having salary equal to the average salary of
all staff members in ascending order of names.

Command - SELECT MAX(SAL) - MIN(SAL) AS SALDifference FROM Employees;

33

You might also like