BANARSIDAS CHANDIWALA INSTITUTE OF
PROFESSIONAL STUDIES
INFORMATION Systems MaNAGEMENT
Practical File
Submitted in partial fulfillment of the requirements
for the award of the degree of
Bachelor of Business Administration (BBA)
To
Guru Gobind Singh Indraprastha University, Delhi
Submitted to : Ms. Pooja Yadav
Student Name : Diya Rathour
Enrolment No. : 01561201720
Shift : First Shift
Batch : 2020-2023
BanarsidasChandiwala Institute of Professional Studies, New Delhi
2021-22
INDEX
S.No Practical Signature
Structured Query Language
1. Write SQL queries to create table and insert data.
2. Write SQL queries to select data
3. Write SQL queries for aggregate functions
4. Write SQL queries for Select and update
5. Write SQL queries for applying constraints
6. Write SQL queries using Alter command
Assignment 1
a. Write an SQL command that will create a table named Test1 with the following fields
and types: ENoint, FirstName VARCHAR(24), PAddress VARCHAR(30), Age int ,
Giftvalue NUMERIC(10,2).
b. Insert the following items in the table you have created
ENo FirstName PAddress Age Giftvalue
01 Ram Dwarka sector 41 200
10
02 Sita Janakpuri 26 250
block C
03 Rajesh Dwarka sector 23 200
15
04 Ajit Noida sector 35 150
11
05 Rita Noida sector 40 200
11
Solution : a.
Solution : b.
Assignment 2: Select Queries for table Test1
a. Write an SQL query to display all the records
b. Write an SQL query to display all the records where age >40
c. Write an SQL query to display Fname, Age from the table
d. Write an SQL query to display Fname, Age, Gift where Age > 35 from the table
e. Write an SQL query to display all record where Gift > 200 and Age >20
f. Write an SQL query to display all record where Gift > 200 or Age >20
Solution : a.
Solution : b.
Solution : c.
Solution : d.
Solution : e.
Solution : f.
Assignment 3: Queries for aggregate functions for table Test1
a. Write SQL query to add the age of all records.
b. Write a query to average of the cost of gifts.
c. Write a query to display the name and age of the youngest member
d. Write a query to count the number of candidates whose age in more than 30.
e. Write a query to find the name and cost of the costliest gift.
Solution : a.
Solution : b.
Solution : c.
Solution : d.
Solution : e.
Assignment 4: Applying functions and modification queries
a. Create a table with the following specifications
Field name Data type
EMPID INT
DEPT CHAR(5)
EMPNAME VARCHAR(15)
ADDRESS VARCHAR(30)
SALARY NUMERIC(7)
b. Make the following entries in the table
EMPID DEPT EMPNAME ADDRESS SALARY
101 RD01 Prince Park Way 15000
102 RD01 Harry Pebble Street 12000
103 RD02 Tom Rose Garden 11000
104 RD02 Susan Model Town 10000
105 ED01 Mark Victor Crescent 10000
106 AD01 Francis Chelmsford Park 13000
107 GR01 Robert Downtown Cross 14000
108 RD03 Philip Park Avenue 15000
109 RD03 Henry Malibu Beach 14000
110 AD01 Frank St. Peters Lane 7000
c. Find names for all employees who work for the RD01 department.
d. How many employees work in department starting from RD.
e. What is the maximum and minimum of the salaries.
f. Name the employees and their department whose salaries are greater than 12000.
g. Find the number of employees in each department.
h. List the employees in increasing order of their salaries.
i. Modify the table so that Susan is assigned to AD01 department.
j. Name the employee in department RD03 who lives in Park Avenue.
k. Find the Average salary.
l. Count the number of employees.
Solution : a.
Solution : b.
Solution : c.
Solution : d.
Solution : e.
Solution : f.
Solution : g.
Solution : h.
Solution : i.
Solution : j.
Solution : k.
Solution : l.
Assignment 5: Constraints
a. Create a table EMP_TABLEwith the following specifications
Field name Data type
EMPID CHAR(4), Primary Key
DEPT CHAR(5), NOT NULL
EMPNAME VARCHAR(15)
SALARY NUMERIC(7)
b. Make the following entries in the table
EMPID DEPT EMPNAME SALARY
M101 RD01 Prince 150000
M102 RD01 Harry 120000
F103 FD01 Tom 110000
M104 RD01 Susan 100000
P105 ED01 Mark 100000
M106 RD01 Francis 130000
P107 ED01 Robert 140000
P108 ED01 Philip 150000
F109 FD01 Henry 140000
H110 AD01 Frank 70000
c. Write an SQL query to display the table in ascending order of their names
d. Write a SQL query that returns the average salary using the alias “Average salary”
e. Write a SQL query to display the records of employees whose names start with letter ‘P’ or ‘H’
Solution : a
Solution : b.
Solution : c.
Solution : d.
Solution : e.
Assignment6: Alter command
Create a table Student1 with the following structure:
Roll no number 3
Name varchar 20
Marks number 6
Write the following SQL queries
1. Add new columns pincode and city to Student1
2. Change the width of pincode to 6
3. Add a primary key
4. Add a not null constraint
5. Add construct check to the Marks column (Marks >=0 and Marks<=100)
Solution : a.
Solution : b.
Solution : d.
Solution : e.