0% found this document useful (0 votes)
14 views

Lakshay ISM File 2.0

The document discusses a practical file submitted for a Bachelor of Business Administration degree. It contains an index listing 14 practical assignments related to database concepts like ER diagrams, creating tables, and performing queries. The practical assignments cover topics such as creating tables, inserting data, and querying tables to display, filter, and aggregate data.
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)
14 views

Lakshay ISM File 2.0

The document discusses a practical file submitted for a Bachelor of Business Administration degree. It contains an index listing 14 practical assignments related to database concepts like ER diagrams, creating tables, and performing queries. The practical assignments cover topics such as creating tables, inserting data, and querying tables to display, filter, and aggregate data.
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/ 18

PRACTICAL FILE

OF
INFORMATION SYSTEM MANAGENET

Submitted in the Partial fulfillment for the award of Degree of BACHELOR IN BUSINESS
ADMINISTRATION (G)

Under The Guidance: Submitted By:


Ms. Bhumika Lakshay Tomer
Assistant Professor 00824201721
Batch: 2021-24

CHANDERPRABHU JAIN COLLEGE OF HIGHER STUDIES AND SCHOOL OF LAW

An ISO 9001: 2015 Certified Institute (Approved by the Govt. of

NCTDelhi Affiliated to Guru Gobind Singh Indraprastha University,

Delhi& Approved byBar council of India) Plot No OCF Sector A-8,

Narela New Delhi- 110040


INDEX

S TITLE DATE Page Sign


NO No.
1 Introduction to database

Pratical-1 ER diagram of hospital management system


2
3 PraticalL 2 ER diagram of examination system

4 Pratical -3 ER diagram of examination system

5 Pratical-4 Create student table

6 Pratical- 5 c r e a t e e m p _ i n f o t a b l e p r a t i c a l

7 Pratical- 6 Display the salaries of the employees from emp_info table

8 Pratical-7 Display different departments from rmp_info table

9 Pratical-8 Display total numbers of departments in the company


form emp_info table

Pratical-9 Display the name of those employees whose name


10 starts with ‘A’ from emp_info table

Pratical-10 Display the name of those employees whose 2nd


11 alphabet is ‘A’
Pratical-11 Display the id and name of those employees who
12 lives in Delhi/Mumbai
Pratical-12 Display the id and name of those employees who
13 lives in Delhi/Mumbai
14 Pratical-13 Display name and maximum salaries in
each department of company

15 Pratical-14 Add phone no. Coloumn in emp_info table

Pratical-15 Update the city of ms sara atary from Delhi to Uttar


16 Pradesh
Q1 Introduction to data base

A database is an organised collection of structured information, or data, typically stored


electronically in a computer system. A database is usually controlled by a database
management system (DBMS). Together, the data and the DBMS, along with the
applications that are associated with them, are referred to as a database system, often
shortened to just database.

Data within the most common types of databases in operation today is typically modelled
in rows and columns in a series of tables to make processing and data querying efficient. The
data can then be easily accessed, managed, modified, updated, controlled, and organised.
Most databases use structured query language (SQL)for writing and querying data.

Types of databases
There are many different types of databases. The best database for a specific
organisation depends onhow the organisation intends to use the data.

• Relational databases
Relational databases became dominant in the 1980s. Items in a relational database are
organised as aset of tables with columns and rows. Relational database technology
provides the most efficient and flexible way to access structured information.
• Object-oriented databases
Information in an object-oriented database is represented in the form of
objects, as inobject-oriented programming.
• Distributed databases
A distributed database consists of two or more files located in different sites.
The database may be stored on multiple computers, located in the same
physical location, orscattered over different networks.
• Data warehouses
A central repository for data, a data warehouse is a type of database specifically designed
for fast queryand analysis.

What is database software?

Database software is used to create, edit, and maintain database files and records,
enabling easier file and record creation, data entry, data editing, updating, and reporting.
The software also handles data storage, backup and reporting, multi-access control, and
security. Strong database security is especially important today, as data theft becomes
more frequent. Database software is sometimes alsoreferred to as a “database
management system” (DBMS).

Database software makes data management simpler by enabling users to store data in a
structured form and then access it. It typically has a graphical interface to help create and
manage the data and, insome cases, users can construct their own databases by using
database software.

What is a database management system (DBMS)?

A database typically requires a comprehensive database software program known as a


database management system (DBMS). A DBMS serves as an interface between the
database and its end usersor programs, allowing users to retrieve, update, and manage
how the information is organised and optimised. A DBMS also facilitates oversight and
control of databases, enabling a variety of administrative operations such as
performance monitoring, tuning, and backup and recovery

MySQL database?
MySQL is an open source relational database management system based on SQL. It was designed
and optimised for web applications and can run on any platform. As new and different requirements
emerged with the internet, MySQL became the platform of choice for web developers and web-based
applications. Because it’s designed to process millions of queries and thousands of transactions,
MySQL is a popular choice for e-commerce businesses that need to manage multiple money
transfers.On-demand flexibility is the primary feature of MySQL.

MySQL is the DBMS behind some of the top websites and web-based applications in the
world,including Airbnb, Uber, LinkedIn, Facebook, Twitter, and YouTube.
Q2. Make ER- Diagram of Hospital management system
Q3. Make ER- Diagram of examination system
Q4. Create student table

Syntax:
• create table table name(column 1 datatype, column 2 datatype, column 3 datatype,.. column N
datatype);
• insert to table_name values(value1, value2, value3,………);

Query:
create table student(std_id int, name varchar(30), email varchar(50), phone_number varchar(10));
insert into student value(1, "Rahul", "[email protected]", 9911346811);
insert into student value(2, "Shaurya", "[email protected]", 7865450021);
insert into student value(3, "Gautam", "[email protected]", 8882345672);
insert into student value(4, "Vridhi", "[email protected]", 9823005431);
insert into student value(5, "Parth", "[email protected]", 9065478287);
select*from student

Output:
Q5 Create EMP_info table

Syntax:
• create table table name(column 1 datatype, column 2 datatype, column 3 datatype,.. column N
datatype);
• insert to table_name values(value1, value2, value3,………);

Query:
create table emp_info(emp_id int, name varchar(20), email varchar(50), hire_date int, salary int, department varchar(20), city
varchar(20));
insert into emp_info value(1001, "Rahul", "[email protected]", 2022-05-01, 35000, "HR", "Delhi");
insert into emp_info value(1002, "Shaurya", "[email protected]", 2022-05-01, 40000, "Sales", "Mumbai");
insert into emp_info value(1003, "Gautam", "[email protected]", 2022-01-01, 60000, "Finance", "Agra");
insert into emp_info value(1004, "Vridhi", "[email protected]", 2022-01-01, 20000, "HR", "Delhi");
insert into emp_info value(1005, "Parth", "[email protected]", 2021-07-01, 80000, "Finance", "Hyderabad");
select * from emp_info
Output:
Q6. Display the salary of all employees from EMP_ info table

Query:

create table emp_info(emp_id int, name varchar(20), email varchar(50), hire_date int, salary int, department
varchar(20), city varchar(20));
insert into emp_info value(1001, "Rahul", "[email protected]", 2022-05-01, 15000, "HR", "Delhi");
insert into emp_info value(1002, "Shaurya", "[email protected]", 2022-05-01, 50000, "Sales", "Mumbai");
insert into emp_info value(1003, "Gautam", "[email protected]", 2022-01-01, 40000, "Finance", "Agra");
insert into emp_info value(1004, "Vridhi", "[email protected]", 2022-01-01, 20000, "HR", "Delhi");
insert into emp_info value(1005, "Parth", "[email protected]", 2021-07-01, 90000, "Finance", "Hyderabad");
select salary from emp_info
Output:
Q7. Display different department in the company from EMP_info table

Query:

create table emp_info(emp_id int, name varchar(20), email varchar(50), hire_date int, salary int, department
varchar(20), city varchar(20));
insert into emp_info value(1001, "Rahul", "[email protected]", 2022-05-01, 35000, "HR", "Delhi");
insert into emp_info value(1002, "Shaurya", "[email protected]", 2022-05-01, 40000, "Sales", "Mumbai");
insert into emp_info value(1003, "Gautam", "[email protected]", 2022-01-01, 60000, "Finance", "Agra");
insert into emp_info value(1004, "Vridhi", "[email protected]", 2022-01-01, 70000, "HR", "Delhi");
insert into emp_info value(1005, "Parth", "[email protected]", 2021-07-01, 80000, "Finance", "Hyderabad");
select department from emp_info;
Output:
Q8. Display total number of departments in the company
Syntax:
• select count(column_name) from table_name;

Query:
create table emp_info(emp_id int, name varchar(20), email varchar(50), hire_date int, salary int, department
varchar(20), city varchar(20));
insert into emp_info value(1001, "Rahul", "[email protected]", 2022-05-01, 35000, "HR", "Delhi");
insert into emp_info value(1002, "Shaurya", "[email protected]", 2022-05-01, 40000, "Sales",
"Mumbai");
insert into emp_info value(1003, "Gautam", "[email protected]", 2022-01-01, 60000, "Finance",
"Agra");
insert into emp_info value(1004, "Vridhi", "[email protected]", 2022-01-01, 70000, "HR", "Delhi");
insert into emp_info value(1005, "Parth", "[email protected]", 2021-07-01, 90000, "Finance",
"Hyderabad");
select count(distinct department) as total_department from emp_info;
Output:
Q9. Display the name of employees whose name starts with ‘A’

Syntax:
• select column1, column2,… from table_name where condition;

Query:
create table emp_info(emp_id int, name varchar(20), email varchar(50), hire_date int, salary int,
department varchar(20), city varchar(20));
insert into emp_info value(1001, "Rahul", "[email protected]", 2022-05-01, 35000, "HR", "Delhi");
insert into emp_info value(1002, "Shaurya", "[email protected]", 2022-05-01, 50000, "Sales",
"Mumbai");
insert into emp_info value(1003, "Gautam", "[email protected]", 2022-01-01, 20000,
"Finance", "Agra");
insert into emp_info value(1004, "Vridhi", "[email protected]", 2022-01-01, 90000, "HR",
"Delhi");
insert into emp_info value(1005, "Parth", "[email protected]", 2021-07-01, 10000, "Finance",
"Hyderabad");
select name from emp_info where name like 's%';
Output:
Q10. Display the name of those employees whose name
second alphabet is ‘A’

Syntax:
• select column1, column2,… from table_name where condition;

Query:
create table emp_info(emp_id int, name varchar(20), email varchar(50), hire_date int, salary int,
department varchar(20), city varchar(20));
insert into emp_info value(1001, "Rahul", "[email protected]", 2022-05-01, 35000, "HR", "Delhi");
insert into emp_info value(1002, "Shaurya", "[email protected]", 2022-05-01, 40000, "Sales",
"Mumbai");
insert into emp_info value(1003, "Gautam", "[email protected]", 2022-01-01, 60000, "Finance",
"Agra");
insert into emp_info value(1004, "Vridhi", "[email protected]", 2022-01-01, 20000, "HR", "Delhi");
insert into emp_info value(1005, "Parth", "[email protected]", 2021-07-01, 80000, "Finance",
"Hyderabad");
select name from emp_info where name like '_r%';

OUTPUT:
Q11. Display id and name of those employees who lives in Delhi

Query:

create table emp_info(emp_id int, name varchar(20), email varchar(50), hire_date int, salary int, department
varchar(20), city varchar(20));
insert into emp_info value(1001, "Rahul", "[email protected]", 2022-05-01, 35000, "HR", "Delhi");
insert into emp_info value(1002, "Shaurya", "[email protected]", 2022-05-01, 40000, "Sales",
"Mumbai");
insert into emp_info value(1003, "Gautam", "[email protected]", 2022-01-01, 60000, "Finance",
"Agra");
insert into emp_info value(1004, "Vridhi", "[email protected]", 2022-01-01, 20000, "HR", "Delhi");
insert into emp_info value(1005, "Parth", "[email protected]", 2021-07-01, 80000, "Finance",
"Hyderabad");
select emp_id, name from emp_info where city = "Delhi";
OUTPUT:
Q12. Display id and name of those employees who lives in Delhi/Mumbai

Syntax:
• select column1, column2,… from table_name where condition1 or condition2;

Query:
create table emp_info(emp_id int, name varchar(20), email varchar(50), hire_date int, salary int,
department varchar(20), city varchar(20));
insert into emp_info value(1001, "Rahul", "[email protected]", 2022-05-01, 35000, "HR", "Delhi");
insert into emp_info value(1002, "Shaurya", "[email protected]", 2022-05-01, 40000, "Sales",
"Mumbai");
insert into emp_info value(1003, "Gautam", "[email protected]", 2022-01-01, 60000, "Finance",
"Agra");
insert into emp_info value(1004, "Vridhi", "[email protected]", 2022-01-01, 20000, "HR", "Delhi");
insert into emp_info value(1005, "Parth", "[email protected]", 2021-07-01, 90000, "Finance",
"Hyderabad");
select emp_id, name from emp_info where city in ("Delhi", "Mumbai");

OUTPUT:
Q13 Display name and maximum salary in each department of company

Syntax:
• MAX(DISTINCT expression)

Query:
create table emp_info(emp_id int, name varchar(20), email varchar(50), hire_date int, salary int, department
varchar(20), city varchar(20));
insert into emp_info value(1001, "Rahul", "[email protected]", 2022-05-01, 35000, "HR", "Delhi");
insert into emp_info value(1002, "Shaurya", "[email protected]", 2022-05-01, 40000, "Sales",
"Mumbai");
insert into emp_info value(1003, "Gautam", "[email protected]", 2022-01-01, 60000, "Finance",
"Agra");
insert into emp_info value(1004, "Vridhi", "[email protected]", 2022-01-01, 20000, "HR", "Delhi");
insert into emp_info value(1005, "Parth", "[email protected]", 2021-07-01, 90000, "Finance",
"Hyderabad");
Select department, max(salary) as max_salary from emp_info group by department;
OUTPUT:
Q14. Add phone number column in employee information table

Syntax:
• Alter table table_name add column_name, datatype;

Query:
• alter table emp_info add phone_number varchar(10);
• update emp_info set phone_number = '7592013380' where emp_id = 1001;
• update emp_info set phone_number = '8294012478' where emp_id = 1002;
• update emp_info set phone_number = '7921678366' where emp_id = 1003;
• update emp_info set phone_number = '9716004688' where emp_id = 1004;
• update emp_info set phone_number = '8920159933' where emp_id = 1005;

OUTPUT:
Q15. Update the city of Ms. Sara Atray from Delhi to Uttar Pardesh

Syntax:
• update table_name set column1 = value where some_column = some_value;

Query:
• update emp_info set city = 'Uttar Pradesh' where name = 'Sara Atray' and city = 'Delhi';

OUTPUT:

You might also like