UNIX and DBMS Lab Exam Guide
UNIX and DBMS Lab Exam Guide
SECTION A
UNIX
1. Write and execute the UNIX commands for the following : 5x1=5
(a) To print the last ten lines of a file.
(b) To login as a super user.
(c) To rename a file in a current directory and move that file to another
sub-directory.
(d) To print all the usernames who are currently logged on to the system.
(e) To remove a directory of your choice.
2. Write a shell program to use a "case" statement to select any one of the three
commands (who, list, col, etc.) input by the user as a choice. 15
MCSL-045(P)/S 1 1 P.T.O.
SECTION B
DBMS
Note : Answer the following questions. They carry 20 marks and the viva-voce is
for 5 marks.
3. For the schema given below, perform the tasks (a) and (b) 5
(a) List all the Instructors details who have sessions in S_ROOM = 2A.
(b) Display Name, Salaries and Earning Grades of all the Instructors.
4. Using the schema given above, write a procedure to display the names of all
those instructors whose supervisor is "RAHUL". 10
5. Using the schema given above, write a trigger that is fired before any row is
inserted in the SESSION TABLE. 5
MCSL-045(P)/S1 2 3,000
No. of Printed Pages : 2 SET-1
MCA (Revised)
Term-End Practical Examination 00873
June, 2011
MCSL-045 : UNIX AND DBMS LAB
Note : There are two parts : UNIX and DBMS in this paper. Each part is of 1 hour
duration and carry 20 marks. 5 marks is for Viva - voce of each part
separately. Attempt only that part(s), which is/are not yet clear.
PART-I
UNIX
2. Write a shell script to write the initial of any name given as input. 5
Input VINAY KUMAR
Output. VK
3. Write a shell script program to find out biggest number from the three given numbers
as input as through command line argument. Display appropriate message if exactly
three arguments are not provided through command line
MCSL-045/S1 1 P.T.O.
PART-II
DBMS
1. Create a relational database with the following relations and insert 10 meaningful 5
records/data in each table of the relation :
- TEACHER (T_ID, Name, Designation, Subject)
- STUDENT (T_ID, Roll_No, Subject, S_Name, Semester)
- RESULT (Roll_No, S_Name, Subject, E_Marks)
SECTION A
UNIX
01P RM
MCSL-045(P)/S4 1 P.T.O.
SECTION B
DBMS
3. Insert 10 meaningful records in each of the tables whose schema is given below : 10
4. Write a trigger that will be fired when any row/record from the Table Product
[of Q 3] is deleted. 5
5. Using the relational database developed in Q(3), write a procedure to display the
names of all the companies that are in the city "DELHI". 5
MCSL-045(P)/S4 2 1,000
No. of Printed Pages : 2 SET - 1
MCA (Revised)
04702
Term-End Practical Examination
December, 2011
MCSL-045 : UNIX AND DBMS LAB
Note : There are two sections in this paper. Each section is of 1 hour duration and
carry 20 marks. 5 marks is for viva - voce of each section separately. Attempt
only that section(s) which is not yet clear.
SECTION - A : UNIX
1. Write UNIX commands and execute them for performing the following :
(a) To identify the users logged on the system and then sending message from your 5
terminal to any user logged in
(b) To compare any two files and show the differences .
(c) To delete all the files in the current directory whose name ends in ".bak".
(d) To show the current working directory.
(e) To remove a directory.
2. Write a shell script to take a six digit number as input and print the reverse of the 8
number :
Input : 123456
Output : 6 5 4 3 2 1
3. Write a shell script that prints the message "Good Morning", "Good After Noon," or 7
"Good Evening", according to the system's time.
MCSL-045/ S1 1 P.T.O.
SECTION - B : DBMS
1. Create a relational data base with the following relations and insert ten meaningful 6
data /records in each table of the relation :
Company (C_id, C_name, P_id, C_Address)
Product (P_id, P_name, P_size, P_price)
Sale (P_id, Area_code, P_target, P_sold)
2. Using the schema given above in Q. 1, write a trigger that is fired before any row is 3
inserted in the table product.
3. Using the relations given in Q1. Write a procedure to display the name of company 4
whose product id =1000 and date of product manufacturing is 01/01/2011.
4. Perform the following queries using the relations created in Q-1, through SQL
statements :
(i) List name and address of the companies whose products are sold in area 4
code = 1000.
(ii) Find the company name and the price of the product id = 235. 3
MCSL-045/ S1 2 5,000
No. of Printed Pages : 2 SET - 1
MCA (Revised)
Term-End Practical Examination 00504
December, 2013
MCSL-045 : UNIX AND DBMS LAB
Note : There are two sections in this paper. Each section is of 1 hour duration and
carry 20 marks. Each section has 5 marks for viva - voce separately. Attempt
only that section in which you are not yet successful.
2. Write a shell script that prints the message "Good Morning", or "Good After Noon", or 8
"Good Evening" ; according to the system's time.
3. Write a shell script to find the sum of following series upto 10 terms. 7
1+3+5+7+9 ;
SECTION - B : DBMS LAB
MCSL-045/S1 1 P.T.O.
2. Write a trigger that fires before any row is inserted or deleted from EMPLOYEE table in 6
Question 1 above.
3. Write a procedure/function which take Dep_ID as input and list Employee name and 6
designation of all the employees in that department.
MCSL-045/S1 2
No. of Printed Pages : 2 SET -1
MCA (Revised)
Term-End Practical Examination
05185
December, 2012
MCSL-045 : UNIX AND DBMS LAB
Note : There are two sections in this paper. Each section is of 1 hour duration and
carry 20 marks. Each section have 5 marks for viva - voce separately.
1. Write and execute the UNIX Commands for performing the following : 5
(a) To create a directory.
(b) To compare two files and show the differences.
(c) To pipe the output of "who" command to the "sort" command.
(d) To change the ownership of a file
(e) To save the output in a file and display the same on the VDU.
2. Write a shell script that read first five lines from a text file named my File. txt : 10
Count the number of special characters (*, #, &, @, ?) and blank space in these five
lines.
3. Write a shell script to display user name, current directory, current date and time. 5
MCSL-045/S1 1 P.T.O.
SECTION - B : DBMS
1. Create a relational database with the following relations and insert at least 8 records in 6
each table of the relation.
Employee (Eid, name, designation, salary, comp_id, years_of_exp) Company
(Comp_id, C_name, address, turnover)
2. Using relations of Q1., Write a procedure to display name and designation of the 5
employees of companies whose turnover is Rs. 2,00000/- or above.
3. List the name and address of the companies whose turnover is more than 5
Rs. 1,00,000/- and have more than 50 employees on roll.
4. Create a view that stores name and designation of all the companies, whose turnover 4
is less than Rs. 5,00,000/-
MCSL-045/S1 2
No. of Printed Pages : 2 SET-2
MCA (Revised)
Term-End Practical Examination
01985
December, 2012
MCSL-045 : UNIX AND DBMS LAB
Note : There are two sections in this paper. Each Section is of 1 hour duration and
carry 20 marks. Each section have 5 marks for viva - voce separately.
1. Write and execute the UNIX commands for performing the following : 5
(a) To run a program with higher priority.
(b) To send message from your terminal to other active user.
(c)e To report the repeated lines in a file named "MyFile. txt".
(d) To kill more than one process at a time.
(e) To rename the file "First. txt" to "second. txt".
2. Write a shell script to find the average marks of ten students in UNIX Lab paper. 8
3. Write a shell script to display message "Good Morning", "Good After Noon" or "Good 7
Evening", according to the system's time at the moment of execution of the script.
MCSL-045/S2 1 P.T.O.
SECTION - B : DBMS
2. Using the schema given in Q1 write a procedure to display the name and year of 5
experience of all the employees, who work for Department id = 1001 and have Gross
Salary more than Rs. 50,000/-
3. Using schema given in Q1.; Write a trigger that fired before any row is inserted in 3
SALARY table.
4. Using SQL query perform the followings on relations given in Q1. 3x2=6
(a) List name and designation of all the employees who work for department
id = 2002 and have more than 10 years of experience.
(b) List name and Basic Salary of all the Managers who work in department
id = 2002.
MCSL-045/S2 2
No. of Printed Pages : 2 SET-3
MCA (Revised)
Term-End Practical Examination 01835
December, 2012
MCSL-045 : UNIX AND DBMS LAB
Note : There are two sections in this paper. Each section is of 1 hour duration and
carry 20 marks. Each section have 5 marks for viva - voce separately.
1. Write and execute the UNIX Commands for performing the following : 5
(a) To display your current environment variable.
(b) To determine the type of a file.
(c) To remove a directory.
(d) To check the spellings of the words in a file.
(e) To make poster of "MCA PRACTICAL EXAM".
2. Write a shell script that take your name as input and display : 7
Miss/Mr : Your name
Today is : date
Current Time : time
3. Write a shell script to find the sum of first 10 elements of the series : 8
1+5+9+13+17
MCSL-045/S3 1 P.T.O.
SECTION - B : DBMS
2. Using schema given in Q1., write a trigger that is fired before any row is inserted in 4
BOOK table.
3. Using the schema given in Q1,. Write a procedure to display the name and city of all 4
the authors who have written books with publisher id = 202011 and the price of book
is more than Rs. 500/-
MCSL-045/S3 2
No. of Printed Pages : 2 SET - 4
MCA (Revised)
Term-End Practical Examination
00735
December, 2012
MCSL-045 : UNIX AND DBMS LAB
Note : There are two sections in this paper. Each section is of 1 hour duration and
carry 20 marks. Each section have 5 marks for viva - voce separately.
1. Write and execute the UNIX commands for performing the following : 5
2. Write a shell script that delete all the even numbered lines in a text file named 7
Mybook .txt.
3. Write a shell script to find the factorial of a given number. The number should be given 8
as command line argument.
MCSL-045/S4 1 P.T.O.
SECTION - B : DBMS
2. Using schema given in Q1. Write a trigger that is fired before any row is inserted in 3
TICKET table.
3. Create a view that stores passengers name and address who will fly from Delhi to 5
Mumbai on 15-01-2013.
4. Perform the following queries using the relations created in Q1., through SQL
statements : 3x2=6
(a) Find the fare (minimum) from Jaipur to Delhi.
(b) List the name and address of passengers whose age is more than_ 60 years and
will fly on 15-01-2013.
MCSL-045/S4 2
No. of Printed Pages : 2 MCSL-045(P)/S1
SECTION A
UNIX
3. Write a shell script to print factorial of any number (n), entered by user. 7
MCSL-045(P)/S1 1 P.T.O.
SECTION B
DBMS LAB
6. Write a trigger that executes (or fires) when any record is updated in the table
Dept_Head of Q4 (above). 7
MCSL-045(P)/S1 2 5,000
No. of Printed Pages : 2 I MCSL-045(P)/S2
SECTION A
UNIX
3. Write a shell script to display current date, time, username and current
directory.
MCSL-045(P)/S2 1 P.T.O.
SECTION B
DBMS LAB
5. Write a trigger that is fired when any record/row from table Product (in Q4) is
deleted. 7
6. Using the relational databases developed in Q4, write a procedure to display the
name of the company whose Product ID (i.e. P_ID) is 1000 and price (i.e. P_Price)
is 15000. 7
MCSL-045(P)/S2 2 3,000
No. of Printed Pages : 2 MCSL-045(P)/S3
SECTION A
UNIX
1. Write and execute UNIX commands for the following : 5
(a) To append the redirected output to a storage file.
(b) To show the disk space used by files or directories.
(c) To translate all the lowercase letters of a text file to uppercase.
(d) To move file from one directory to other directory.
(e) To run any job in background.
2. Write a shell script which takes a list of 10 numbers as input, and prints all the
odd numbers in the list. 8
3. Write a shell script to write the initials of any name given as input. 7
Input : Yogesh Jolly
Output : YJ
MCSL-045(P)/S3 1 P.T.O.
SECTION B
DBMS LAB
5. Write a trigger that is fired before any row is inserted in the table Employee of
Q4. 8
6. Write a function that takes the Department_No and returns the Emp_Name and
Date_of Joining in the department of all its employee(s). 8
MCSL-045(P)/S3 2 2,000
No. of Printed Pages : 2 MCSL-045(P)/S4
SECTION A
UNIX
2. Write a shell script to count number of ".bak" files in the current working
directory. 7
3. Write a shell script to immediately echo the length of the string given as an
argument. 8
MCSL-045(P)/S4 1 P.T.O.
SECTION B
DBMS LAB
5. Using the table "Institute" from Q4 create a view with fields Inst_Name,
Establishment_Year. 3
6. Use the table "Institute" from Q4 to write a procedure that finds whether an
Inst_Name given by the user exists in the table Institute or not. 7
7. Use the table "Institute" from Q4 to write a function that takes the
Establishment_Year as input, and returns the Inst_Name of all the institutes
established in the year given as input. 7
MCSL-045(P)/S4 2 2,000
No. of Printed Pages : 2 SET-1
MCA (Revised)
Term-End Practical Examination
04109
June, 2013
MCSL-045 : UNIX AND DBMS LAB
Note : There are two sections in this paper. Each section is of 1 hour duration and
carry 20 marks. Each section have 5 marks for viva - voce separately.
1. Write and execute the UNIX Commands for performing the followings : 5
(a) Send message to other users who are currently loged - in.
3. Write a shell script that delete odd numbered lines from a given text file. 7
MCSL-045/S1 1 P.T.O.
SECTION - B : DBMS
1. Create a relational database with the following relations and insert at least of 8 records 10
in each table of the relation.
SUPPLIERS (S_id, S_name, Address)
PARTS (Pid, P_name, Company_name, Color)
CATALOG (S_id, P_id, Price)
The key fields are underlined. Select appropriate data types for the fields. List the
colors of the parts available with supplier id = 20005.
2. Write a trigger that fires before any row is inserted in PARTS and CATALOG tables. 5
MCSL-045/S1 2
13
(A-8) P. T. 0.
[2] MCSL-045/S1
Section—A
(UNIX)
Note : Answer the following questions. They carry 20 marks and the
viva-voce is for 5 marks.
3. For the schema given below, perform the tasks (a), (b) and (c) :
Branch (Branch_name, city)
Account (Branch_nalne, Acc_No, Balance)
Depositor (Customer_Name, Acc_No, Addl, Add2, City)
(a) Create tables. Select appropriate data types for each of the fields.
Identify appropriate keys. Input meaningful data for at least
10 records. 5
(A-8)
[3I
(c) List all the Customer_Name, Ac _No whose accounts are in the city
Bengaluru. 2 2I
MCSL-045/S1 3,000
(A-8)
No. of Printed Pages : 2 MCSL-045(P)/S1
SECTION A
UNIX
(a) Create a sub-directory with 3 files — filel, file2 and file3 in the current working
directory.
(b) Make a copy of any text file using a command in UNIX.
(c) To display all the files whose filename starts with "a".
(d) Write a grep command to select the lines from a file that has exactly
3 characters.
(e) Compare the two text files and display the first difference.
2. Write a shell program to display the last modification time of any file, if the
filename of the file is given as input. 15
MCSL-045(P)/S1 1 P.T.O.
SECTION B
DBMS
4. Write the following queries using SQL for the table given in Q 3 : 5x2=10
(a) List all the Book_ID's published in the year 2015.
(b) List all the Publisher's names.
(c) List the Author(s) and their ID's for a given Book_ID.
(d) Display the Price for any given book Title.
(e) List all the Publisher_ID's.
MCSL-045(P)/S1 2 4,000
No. of Printed Pages : 2 MCSL-045(P)/S1
SECTION A
UNIX
2. Write a shell program, using "grep" to find the number of occurrences of a string
"and" in a text file and display its count. 15
MCSL-045(P)/S1 P.T.O.
SECTION B
DBMS
4. For the above table in Q. 3, answer the following queries using SQL : 5x2=10
(a) To display all the seminars co-ordinated by "RAHUL" and co-coordinated by
"ACHUTH".
(b) To display the details of all the seminars conducted in the year 2015.
(c) To display all the records whose venue is "AUDITORIUM_1" and are all
sponsored seminars.
(d) To display all the seminars in which the No_of participants is more
than 100.
(e) To display all the seminar_nos whose title starts with "D".
MCSL-045(P)/S1 2 3,000
No. of Printed Pages : 2 MCSL-045 - Set -1
SECTION - A
UNIX
(a) To use any screen editor and create a file with file extension .c.
(d) To copy files from a subdirectory and paste them in another subdirectory.
2. Write a shell script to translate all the characters to upper case in a given text file. 15
4. Write a trigger that will be fired whenever an insertion or deletion takes place in the 5
SOCIS table.
MCSL-045 - Set - 1 2
No. of Printed Pages : 2 MCSL-045(P)/S1
SECTION A
UNIX
MCSL-045(P)/S1 1 P.T.O.
SECTION B
DBMS
4. For the above table in Q3, answer the following queries using SQL : 5
(a) To display all the details of the complaints received/registered on (any)
particular date.
(b) To display the Supervisor's name and allocated Engineer's name for the
CID = 004.
5. Write a trigger that will be fired before any row is inserted or deleted in the
existing database. 5
MCSL-045(P)/S1 2 5,000
No. of Printed Pages : 2 MCSL-045(P)/S1
SECTION A
UNIX
1. Write and execute the UNIX commands for the following : 5x1=5
2. Write a shell program to take 'N' numbers as input and direct the even numbers
to even.txt file and odd numbers to odd.txt file. 15
MCSL-045(P)/S1 1 P.T.O.
SECTION B
DBMS
4. Write the following queries using SQL for the DB given in Q3 : 5x2=10
(a) Give the details (all attributes of TRIP relation) for trips that exceeded 20,000.
(b) Print the SSN of salesmen who took trips from MUMBAI to DELHI.
(c) Print the total trip expenses incurred by any particular salesman.
(d) Print the Dept_No of "SSN = 12345".
(e) Print the expenses of "Trip_ID = 123".
MCSL-045(P)/S1 2 4,000
No. of Printed Pages : 2 I MCSL-045(P)/S1 I
SECTION A
UNIX
2. Write a shell program to accept a directory name as an argument and delete all
those files starting their file name with "c" or "C". 15
MCSL-045(P)/S1 P.T.O.
SECTION B
DBMS
4. For the above tables in Q3, answer the following queries using SQL : 5x2=10
(a) To update the damage amount for the car with specific reg_no in the
accident with FIR_NO 123 to 25,000.
(b) To add a new accident to the database.
(c) To find the total number of people (drivers) who owned cars that were
involved in accidents in the year 2016.
(d) To list all the driver details who own cars of MAKE = "TOYOTA".
(e) To display all the accidents that happened in any particular location "XYZ".
MCSL-045(P)/S 1 2 3,000