Faculty of Computer Applications Bachelor of Science (Information Technology) B.Sc. (IT)
Faculty of Computer Applications Bachelor of Science (Information Technology) B.Sc. (IT)
▪ Sem. :1
▪ Subject Code :05BS0104
▪ Subject : Database Management System – 1
▪ Course Objectives :
1. To understand and to get familiarize with basic concepts of DBMS.
2. To conceptualize the database using E-R Model and to understand the
process of normalization.
3. To create database design using relational model and to carry out
relational algebraic operations.
4. To execute and analyze basic SQL queries.
5. To create and manage different SQL objects.
3 Relational Model: 10
Relational Model concepts, RelationalModel constraints
and Relational Database Schemas
Relational Algebra, Relational Algebra Operations:
Selection, Projection, Join, Union, Intersect and
Difference, Relational Algebra Examples.
4 Basic SQL: 10
Introduction to SQL, Data Types, Categories of SQL
Commands, Creating a table, Altering the structure of
table, Removing the table, Rename the table, Insert,
Update, Delete operation, Assigning and revoking
object privileges using Grant and Revoke Command,
Primary Key, Foreign Key, Unique, Not Null, Check
Constraint, Oracle SQL operators.
5 Advanced SQL: 10
Range Searching, Pattern Matching, Order By Clause,
Group By and Having Clause,Set Operators, Sub
Queries, Joins, Dual Table, Oracle Aggregate and
built-in Functions, Views, Index, Sequence,
Synonyms.
Course Outcomes:
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10
CO1 L L H
CO2 L M H M
CO3 H L H
CO4 M L L
CO5 L M M H
Text Book :
Reference Books :
Web References:
1. https://www.oracletutorial.com/
2. https://www.guru99.com/sql.html
FACULTY OF COMPUTER APPLICATIONS
3. https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/
12c/r1/odb_quickstart/odb_quick_start.html
4. https://www.techonthenet.com/oracle/index.php
5. https://www.w3resource.com/oracle/index.php
App References:
1. https://livesql.oracle.com/apex/
2. https://apex.oracle.com/en/
3. https://play.google.com/store/apps/details?id=in.ajaykhatri.learnd
bms&hl=en_IN
4. https://play.google.com/store/apps/details?id=com.msh.plsqllearni
ng&hl=en_IN&gl=US
5. https://www.oracle.com/database/technologies/appdev/plsql.html
PRACTICALS
# Tool: Oracle 10g or above
Sr. Unit : 1
No
1 - Create following tables:
(1) DEPOSIT (3) CUSTOMERS
Column Name Datatype(Size) Column Name Datatype(Size)
ACTNO VARCHAR2(5) CNAME VARCHAR2(15)
CNAME VARCHAR2(15) CITY VARCHAR2(15)
BNAME VARCHAR2(15)
AMOUNT NUMBER(9,2)
ADATE DATE (4) BORROW
Column Name Datatype(Size)
(2) BRANCH LOANNO VARCHAR2(5)
Column Name Datatype(Size) CNAME VARCHAR2(15)
BNAME VARCHAR2(15) BNAME VARCHAR2(15)
CITY VARCHAR2(15) AMOUNT NUMBER(9,2)
(8) BORROW
LOANNO CNAME BNAME AMOUNT
201 ANIL VRCE 1000.00
206 MEHUL AJNI 5000.00
311 SUNIL DHARAMPETH 3000.00
321 MADHURI ANDHERI 2000.00
375 PRMOD VIRAR 8000.00
481 KRANTI NEHRU PLACE 3000.00
201 ANIL VRCE 1000.00
206 MEHUL AJNI 5000.00
311 SUNIL DHARAMPETH 3000.00
321 MADHURI ANDHERI 2000.00
2
Id Name Type Price Quality Item_pack_date
Unit : 2
6 - Create following tables with proper normalization process :
(2) EMPLOYEE
emp_no emp_name emp_sal emp_comm dept _no
101 Smith 800 20
102 Snehal 1600 300 25
103 Adama 1100 0 20
104 Aman 3000 15
105 Anita 5000 5,000 10
106 Sneha 2450 2,450 10
107 Anamika 2975 30
(3) DEPOSIT
A_no cname Bname Amount date
101 Anil andheri 7000 01-jan-06
102 sunil virar 5000 15-jul-06
103 jay villeparle 6500 12-mar-06
104 vijay andheri 8000 17-sep-06
105 keyur dadar 7500 19-nov-06
106 mayur borivali 5500 21-dec-06
9. Display name, number and salary of those employees whose name is 5 characters long
and first three characters are ‘Ani’.
10.Sort and display the names of customers from deposit table.
7 - Perform the following queries on the tables created in practical exercise 1 and 6:
1. List total deposit from deposit.
2. List total loan from karolbagh branch.
3. Give maximum loan from branch vrce.
4. Count total number of customers .
5. Count total number of customer’s cities.
6. Create table supplier from employee with all the columns.
7. Create table sup1 from employee with first two columns.
8. Create table sup2 from employee with no data.
9. Insert the data into sup2 from employee whose second character should be ‘n’ and string
should be 5 characters long in employee name field.
10.Delete all the rows from sup1.
11.Delete the detail of supplier whose sup_no is 103.
12.Rename the table sup2 to suplier_two.
13.Destroy table sup1 with all the data.
14.Update the value dept_no to 10 where second character of emp. name is ‘m’.
15.Update the value of employee name whose employee number is 103.
8 - Perform the following queries on the tables created in practical exercise 1 and 6:
1. List total deposit of customer having account date after 1-jan-96.
2. List total deposit of customers living in city Nagpur.
3. List maximum deposit of customers living in Bombay.
4. Display the highest, lowest, sum, and average salary of all employees. Label the columns
Maximum, Minimum, Sum, and Average, respectively. Round your results to the nearest
whole number.
5. Write a query that displays the difference between the highest and lowest salaries. Label
the column DIFFERENCE.
6. Create a query that will display the total number of employees and, of that total, the
number of employees hired in 1995, 1996, 1997, and 1998
7. Find the average salaries for each department without displaying the repetitive
department numbers.
8. Write a query to display the total salary being paid to each job title, within each
department.
9. Find the average salaries > 2000 for each department without displaying the repetitive
department numbers.
10.Display the job and total salary for each job with a total salary amount exceeding 3000.
FACULTY OF COMPUTER APPLICATIONS
Unit : 3
9 - Perform the following queries on the tables created in practical exercise 1 and 6:
1. Give name of customers who are depositors having same branch city of mr.sunil.
2. Give deposit details and loan details of customer in same city where pramod is living.
3. Create a query to display the employee numbers and last names of all employees who
earn more than the average salary. Sort the results in ascending order of salary.
4. Display the last name and salary of every employee who reports to ford.
5. Display the department number, name, and job for every employee in the Accounting
department.
6. Give name of customer who are borrowers and depositors and having living city nagpur
7. Give city as their city name of customers having same living branch.
8. Write a query to display the last name, department number, and department name for all
employees.
9. Create a unique listing of all jobs that are in department 30. Include the location of the
department in the output
10.Write a query to display the employee name, department number, and department name
for all employees who work in CALCUTTA.
10 1. Create the following table named table as CUSTOMER with proper normalization.
COLUMN NAME DATATYPES SIZE DESCIPTION
CUST_NO NUMBER 4 PRIMARY KEY
FIRST_NAME VARCHAR2 20 NOT NULL
LAST_NAME VARCHAR2 20 -
ADDRESS VARCHAR2 20 -
CITY VARCHAR2 8 -
STATE VARCHAR2 20 -
PIN NUMBER 6 -
B_DATE DATE - -
STATUS CHAR 1 VALUES MUST BE IN (‘V’,’I’,’A’)– Check Constraint
5. Delete the row from the table where PIN CODE is 576201.
6. Set the PIN CODE equal 476001 where CUST_NO=1004.
7. Change the ADDRESS as “KAVI MUDDANNA MARG” AND PIN=576104 where
CUST_NO=1003.
8. Delete the records of GOA state from the table and then retrieve all the records back.
9. List all the records for INVALID (‘I’) persons.
10.Select all the records with single occurrence (without duplication) of state from the table.
11.Sort and display the customer data, in the alphabetic order of state.
12.Sort and display the state field in the in descending order.
13.Select the records of KARNATAKA customers who are valid (‘V’).
14.Retrieve records of Karnataka / Kerala customers.
15.Retrieve records of Karnataka / Kerala customers who are ACTIVE (‘A’).
16.Retrieve records of Karnataka customers with pin code 576201.
17.Display all the rows from the table except for customer number 1005.
18.Retrieve rows where the state name begins with K and following by any other character.
19.Retrieve rows where name contains the word RAJ embedded it.
20.Display all the row who’s CUST_NO is in the range from 1003 to 1005.
21.Display all the rows whose dates are in the range of 10-JAN-71 and 31-DEC-71.
22.Retrieve all the rows where city column equals to UDP or MNG or BNG or PGN.
23.Rename customer table to CUST.
Unit : 4
11 - Perform the following queries on the tables created in practical exercise 10:
1. Create view named as CUST_VIEW from CUSTOMER table using CUST_NO, FIRST_NAME,
LAST_NAME columns and list out the records from CUST_VIEW.
2. Insert new record into CUST_VIEW.
3. Update LAST_NAME to RAO where CUST_NO 1006;
4. Delete the record from CUST_VIEW for CUST_NO 1005;
5. Create read only view CUST_RVIEW from CUSTOMER table and list out the records from
CUST_RVIEW.
Unit : 5
14 - Perform the following queries on the tables created in practical exercise 1 and 6:
1. Create synonym DEPOSITOR for DEPOSIT table and list out the records.
2. Create synonym BORROWER for BORROW table and list out the records.
3. Create synonym FUNCTION for JOB table and list out the records.
15 - Perform the following queries on DUAL table:
1. Write a query to add 15 days to the current date.
2. Write a query to Add and subtract 5 months from the current month.
3. Find out the ASCII equivalent of character ‘M’.
4. Find out the character equivalent of ASCII 67, 65 and 84.
5. Write a query to find the last day of the month.
6. Write a query to calculate the Date difference between current date and 20/05/2015.
7. Write a query to Calculate the number of months between current date and03/03/2016.
8. Find out the second occurrence of ‘or’ from third position in the string ‘corporate floor.
9. Convert the string ‘marwadi university’ so that first character of eachword is in capital.
10.Find out the user name and user id of currently logged on user.