0% found this document useful (0 votes)
142 views43 pages

UNIX and DBMS Lab Exam Guide

This document contains instructions for a practical exam involving UNIX and DBMS labs. It is divided into two sections, each worth 20 marks and lasting 1 hour. Section A involves UNIX commands, including writing commands to perform tasks and a shell script program. Section B involves creating a database with given schemas, performing queries and inserts, and writing a trigger and procedure. Students should attempt only the section(s) they have not yet passed.

Uploaded by

Shubbyy Chan
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)
142 views43 pages

UNIX and DBMS Lab Exam Guide

This document contains instructions for a practical exam involving UNIX and DBMS labs. It is divided into two sections, each worth 20 marks and lasting 1 hour. Section A involves UNIX commands, including writing commands to perform tasks and a shell script program. Section B involves creating a database with given schemas, performing queries and inserts, and writing a trigger and procedure. Students should attempt only the section(s) they have not yet passed.

Uploaded by

Shubbyy Chan
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

No.

of Printed Pages : 2 I MCSL-045(P)/S1

MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)
41 =H
___I
- 1
Term-End Practical Examination
June, 2018

MCSL-045(P)/S1 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50


Note : (i) There are two sections in this paper.
(ii) All the questions are compulsory.
(iii) Each section is of one hour duration and carries. 20 marks.
(iv) 5 marks are for viva-voce of each section separately.
(v) Attempt only that section(s) in which you are not successful as yet.

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

INSTRUCTOR (I_NO, I_NAME, I_SALARY, DOB, SUPERVISOR,


DESIGNATION, JOINING_DATE)

SESSION (S_NO, I_NO, S_ROOM)

EARNING (E_MIN, E_MAX, E_GRADE, I_NO)

(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

Time allowed : 2 hours Maximum Marks : 50

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

1. Write and execute UNIX commands for the following : 5


(a) To display the last 10 lines in a text file.
(b) To remove a directory.
(c) To connect to a remote machine.
(d) To change the permission of a file.
(e) To quit from a file with no changes.

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

Note : Answer the following questions :

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)

2. Perform the following tasks using schema/Table/Relations given in Q.1


(a) Using the schema /Tables of Q.1, write a trigger that fires before any row is 5
inserted in the table RESULT.
(b) Using the schema/ tables of Q.1, write a procedure to display the marks of those 10
students who have studied "Computer Graphics" subject by a Teacher whose
designation is "Professor".

MCSL-045 /S1 2 5,000


No. of Printed Pages : 2 MCSL-045(P)/S4

MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)
Term-End Practical Examination
December, 2017
00953
MCSL-045(P)/S4 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50

Note : (i) There are two sections in this paper.


(ii) All the questions are compulsory.
(iii) Each section is of one hour duration and carries 20 marks.
(iv) 5 marks are for viva-voce of each section separately.
(v) Attempt only that section(s) in which you are not successful as yet.

SECTION A
UNIX

1. Write and execute the following commands in UNIX : 5x1=5


(a) To change the ownership of a file.
(b) To run a program at lower priority.
(c) To compare two files and show their differences.
(d) To display the first 10 lines of a text file.
(e) To kill a process.

2. Write a shell program to write the initials of any given name. 15

e.g. : Input : Rahul Mahindra

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

COMPANY (Com_ID, Com_Name, Com_Address, Com_City, P_ID)

PRODUCT (P_ID, P_Name, P_Size, P_Price)

SALE (P_ID, P-Target, P_Sold, Area_Code)

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

Time allowed : 2 hours Maximum Marks : 50

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

Note Answer the following questions :


:

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

Time allowed : 2 hours Maximum Marks : 50

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.

SECTION - A : UNIX LAB


1. Write and execute the UNIX commonds for performing the followings : 5
(a) To print the information about the active processes.
(b) To search all the files in a specific directory which contain word "UNIX" in it.
(c) To list the details of the largest file in the given directory.
(d) To display your current environment variables.
(e) To sort the contents of a file named "MY ACCOUNT" in ascending order.

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

Note : Answer the following questions.


1. Create a relational data base with the following relations and insert at least eight records 8
in each table of the relation.
EMPLOYEE (Emp_ID, Name, Designation, Year_of_Experience, Dep_ID)
DEPARTMENT (Dep_ID, Name, Function)

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

Time allowed : 2 hours Maximum Marks : 50

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.

SECTION - A : UNIX LAB

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

Note : Answer the following questions :

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

Time allowed : 2 hours Maximum Marks : 50

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.

SECTION - A : UNIX LAB

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

Note : Answer the following questions :


1. Create a relational database with the following relations and insert at least 8 records in 6
each table of the relation.
DEPARTMENT (Did, D_Name, Address, Year_of_establishment)
EMPLOYEE (Eid, Did, Name, Designation, Year-of_experience)
SALARY (Eid, Basic, DA, HRA, Perks, Gross)

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

Time allowed : 2 hours Maximum Marks : 50

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.

SECTION - A : UNIX LAB

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

Note : Answer the following questions :


1. Create a relational database with the following relations and insert atleast 8 records in 6
each table of the relation.
PUBLISHER (P_id, P_Name, Address, Year_of_Establishment)
BOOK (P_id, ISBN, Author_id, Title, Year_of Pub, Price)
AUTHOR (Author_id, name, Address, City, ISBN)

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

4. Using SQL query perform the followings on relations given in Q1.


(a) List the Book title, author name and city for all the books of price more than
Rs. 1000/- and published by publisher id = 202012.
(b) List title and price of all the books published in year 2012.
(c) List the name and address of all the publishers who have published books of
price more than Rs. 20,000/-

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

Time allowed : 2 hours Maximum Marks : 50

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.

SECTION - A : UNIX LAB

1. Write and execute the UNIX commands for performing the following : 5

(a) To reset the password.

(b) To kill a process with its given ID.

(c) To connect to a remote machine.

(d) To run a program at higher priority.

(e) To change the ownership of a file.

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

Note : Answer the following questions :


1. Create the relational database with following relations and insert at least 8 records in 6
each table of the relation.
PASSENGER (P-id, name, address, age, sex)
TICKET (P_id, PNR, Source, F_NO, Destination, Date, Fare)
FLIGHT (F_NO. Source, Destination Dep_Time, Arr_Time, Distance)

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

MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)
Term-End Practical Examination
04267 June, 2014

MCSL-045(P)/S1 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50


Note : (i) There are two sections in this paper.
(ii) Each section is of 1 hour duration and carries 20 marks.
(iii) 5 marks are for viva-voce of each section separately.
(iv) Attempt only that section(s) which is not yet clear.

SECTION A
UNIX

1. Write and execute UNIX commands for the following : 5


(a) To reset the password.
(b) To change the ownership of a file.
(c) To check the spellings of words in a file.
(d) To run a program at lower priority.
(e) To compare two files and show their differences.

2. Write a shell script to print the following pattern : 8


1
1 2
1 2 3
1 2 3 4

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

4. Enter 10 meaningful records in the relational databases, whose schema is given


below : 6
Dept_Head (Dept_ID, Dept_Name, DOB, Emp_ID, Date_of Joining)
Employee (Dept_ID, Emp_ID, Name, Designation, Specialization)
Salary (Emp_ID, Basic, DA, HRA, Perks, Gross)

5. Use the relational database developed by you in Q4 (above), to write a procedure


for "Display of the names of all the employees whose Department ID (i.e.
Dept_ID) is 101, and whose Gross Salary is 40,000 per month and
specialization is in "Engineering". 7

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

MASTER OF COMPUTER APPLICATIONS (Revised)


02450 (MCA)
Term-End Practical Examination
June, 2014

MCSL-045(P)/S2 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50


Note : (i) There are two sections in this paper.
(ii) Each section is of 1 hour duration and carries 20 marks.
(iii) 5 marks are for viva-voce of each section separately.
(iv) Attempt only that section(s) which is not yet clear.

SECTION A
UNIX

1. Write and execute UNIX commands for the following : 5


(a) To display first 10 lines of a file.
(b) To count number of words in a file.
(c) To find out who is logged on to the system.
(d) To kill a process.
(e) To show the current working directory.

2. Write a shell script to check whether a given string is a palindrome or not. 8

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

4. Insert 10 meaningful records in each table whose schema is given below : 6


Company (C_ID, C_Name, C_Address, P_ID)
Product (P_ID, P_Name, P_Size, P_Price)
Sale (P_ID, P_Target, P_Sold, Area_Code)

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

0.1426 MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)
Term-End Practical Examination
June, 2014

MCSL-045(P)/S3 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50


Note : (i) There are two sections in this paper.
(ii) Each section is of 1 hour duration and carries 20 marks.
(iii) 5 marks are for viva-voce of each section separately.
(iv) Attempt only that section(s) which is not yet clear.

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

4. Create an Employee table with fields Emp_No, Emp_Name, Designation, Salary,


Department_No, Date_of Joining. Insert 10 meaningful records in this table. 4

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

MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)
Term-End Practical Examination
00385
June, 2014

MCSL-045(P)/S4 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50

Note : (i) There are two sections in this paper.


(ii) Each section is of 1 hour duration and carries 20 marks.
(iii) 5 marks are for viva-voce of each section separately.
(iv) Attempt only that section(s) which is not yet clear.

SECTION A
UNIX

1. Write and execute UNIX commands for the following : 5


(a) To sort the files by their modification time.
(b) To display the login details of any user.
(c) To change the ownership of a file.
(d) To pipe the output of "Who" command to Sort command.
(e) To connect to a remote machine.

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

4. Create a table "Institute" with fields Inst_Name, Inst_Address, Inst_Owner,


Establishment_Year.
Select appropriate data types for each field and insert 10 meaningful records in
this table. 3

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

Time allowed : 2 hours Maximum Marks : 50

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.

SECTION - A : UNIX LAB

1. Write and execute the UNIX Commands for performing the followings : 5

(a) Send message to other users who are currently loged - in.

(b) Change password

(c) To make a copy of a file named UNIX.TXT.

(d) To move to the root directory from current working directory.

(e) To change ownership of a file.

2. Write a shell script to find the factorial of a given number. 8

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

Note : Answer the following questions.

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

3. Write a procedure/function that take P_id as input and display P_name, 5


Company_name and color of that product.

MCSL-045/S1 2
13

No. of Printed Pages : 3 MCSL-045/S 1

Master of Computer Application


(Revised) (MCA)
Term-End Examination
December, 2018

UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks 50

Note : (i) There are two Sections in this paper.

(ii) All the questions of the two Sections are compulsory.

(iii) Each Section is of one hour duration and carries 20 marks.


(iv) 5 marks are for viva-voce for each Section separately.
(v) Attempt only those Section(s) in which you are not
successful as yet.

(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.

1. Create and execute the following 'UNIX commands : 1 each


(a) To list previously executed commands.
(b) To show one line summary of system status.
(c) To show who is logged onto this terminal.
(d) To set file permission of any file to r, w, x for all.
(e) To count characters in a file (text).
2. Write a shell program to combine any two text files into a single file
(appending) in the order they appear in the arguments and display the
word count. 15
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), (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

(b) Display the balance, branch_name and city for the


Acc_No. = 7943486591. 2
2

(c) List all the Customer_Name, Ac _No whose accounts are in the city
Bengaluru. 2 2I

4. Write a procedure which takes Acc_No as input and displays the


Customer_Name, Add1 Add2, City, Branch Name and Balance. 5
5. Write a trigger which fires before inserting and deleting a record in the
"Depositor" table. 5

MCSL-045/S1 3,000
(A-8)
No. of Printed Pages : 2 MCSL-045(P)/S1

MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)
02 1 5 9 Term-End Practical Examination
December, 2015

MCSL-045(P)/S1 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50


Note : (i) There are two sections in this paper.
(ii) All the questions are compulsory.
(iii) Each section is of one hour duration and carries 20 marks.
(iv) 5 marks are for viva-voce of each section separately.
(v) Attempt only that section(s) in which you are not successful as yet.

SECTION A
UNIX

1. Write and execute the following commands in UNIX : 5x1=5

(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

3. Create a table with name "CATALOGUE" with the following fields :


(BOOK_ID, TITLE, AUTHOR_ID, AUTHORS, PUBLISHER_ID, PUBLISHER,
CATEGORY_ID, YEAR, PRICE, VOLUME)
Select the appropriate data type for each of the fields. Identify the primary key.
Input meaningful data for at least 10 records. 10

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

044 MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)
Term-End Practical Examination
December, 2016

MCSL-045(P)/S1 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50


Note : (i) There are two sections in this paper.
(ii) All the questions are compulsory.
(iii) Each section is of one hour duration and carries 20 marks.
(iv) 5 marks are for viva-voce of each section separately.
(v) Attempt only that section(s) in which you are not successful as yet.

SECTION A
UNIX

1. Write and execute the following UNIX commands : 5x1=5


(a) To change to a new directory from the current directory.
(b) To summarize the free space on disk device.
(c) To remove the files with file name starting with b or B in the current directory.
(d) To compare two files and show the differences.
(e) To show the date and time.

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

3. Create a table "SEMINAR" with the following fields :


(SEM_NO, SEM_TITLE, DEPT_ORGANISED, YEAR, CO_ORDINATOR,
CO_COORDINATOR, NO_OF_DAYS, VENUE, START_DATE, END_DATE,
NO_OF_PARTICIPANTS, NO_OF_RESOURCE_PERSONS,
SPONSORED/NON_SPONSORED)
Select appropriate data types for all the fields. Identify the primary key. Input
10 meaningful records. 10

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

MASTER OF COMPUTER APPLICATIONS (MCA)


(Revised)

Term-End Examination 0 .75 7 8 6


June, 2016
MCSL-045 - Set - 1 : UNIX AND DBMS LAB

Time : 2 hours Maximum Marks : 50

Note : (i) There are 2 Sections in this paper.


(ii) All the questions are compulsory.
(hi) Each section is of one hour duration and carries 20 marks.
(iv) 5 marks are for viva-voce of each section separately.
.(v) Attempt only that section(s) in which you are not successfill as yet.

SECTION - A
UNIX

1. Write and execute the following UNIX Commands : 5x1=5

(a) To use any screen editor and create a file with file extension .c.

(b) To send a file for printing on a line printer.

(c) To compare two files and report if different.

(d) To copy files from a subdirectory and paste them in another subdirectory.

(e) To create a new directory.

2. Write a shell script to translate all the characters to upper case in a given text file. 15

MCSL-045 - Set - 1 1 P.T.O.


SECTION - B
DBMS

3. Create a table with name SOCIS having following fields : 15


(PROG_CODE, PROG_TITLE, TOTAL_CREDITS, NO_OF_SEMESTERS,
LAUNCH_YEAR, NO_OF_STUDENTS_ENROLLED, NO_OF_CENTRES,
PROG_COORDINATOR).
Select a Primary key. Insert 10 meaningful records. Also write the queries for the
following :
(a) Modify the table by inserting another 2 fields called
"MEDIUM_OF_INSTRUCTION" and "TYPE_OF_PROG (Certificate/Bachelors/
Masters)".
(b) Display the highest enrolment programme.
(c) Drop the field namely NO_OF_CENTRES.

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

MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)
Term-End Practical Examination
June, 2015

MCSL-045(P)/S1 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50


Note : (i) There are two sections in this paper. All the questions are compulsory.
(ii) Each section is of one hour duration and carries 20 marks.
(iii) 5 marks are for viva-voce of each section separately.
(iv) Attempt only that section(s) which is not yet clear.

SECTION A
UNIX

1. Write and execute the following UNIX commands : 5x1=5


(a) To remove a file from a sub-directory.
(b) To change the permissions of a file to "read" only for all categories of users.
(c) To send the print of any file to a line printer, attached.
(d) To kill a process using process-ID.
(e) To go to the /bin directory and display the files.

2. Write a shell program to perform addition, subtraction, multiplication and


division operations for the 2 given numbers as input and display their sum,
difference, product and quotient in 4 separate files. 15

MCSL-045(P)/S1 1 P.T.O.
SECTION B
DBMS

3. Create the following table COMPLAINTS with the fields :


[ C ID (should be auto-generated), COMPONENT NAME, CATEGORY (II/W
OR-S/W), TYPE -OF_COMPLAINT (REPLACE/REPAIR), COMPLAINT_DATE,
SUPERVISOR_NAME, ALLOCATED_TO
Select appropriate datatypes for each of the fields and identify a PRIMARY KEY.
Insert 10 records with meaningful data. 10

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

MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)

0701? Term-End Practical Examination


December, 2014

MCSL-045(P)/S1 : UNIX AND DBMS LAB

Time : 2 Hours Maximum Marks : 50


Note : (i) There are two sections in this paper.
(ii) Each section is of one hour duration and carries 20 marks.
(iii) 5 marks are for viva-voce of each section separately.
(iv) Attempt only that section(s) which is not yet clear.

SECTION A
UNIX

1. Write and execute the UNIX commands for the following : 5x1=5

(a) To remove a subdirectory.


(b) To change the permission of a file to deny write permission to the owner.
(c) To print the last 5 lines of any text file.
(d) To display the present working directory.
(e) Go to the root directory directly from the working directory.

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

3. Create the following DB : 10


SALESPERSON (SSN, Name, Start_Year, Dept_No)
TRIP (SSN, From_City, To_City, Departure_Date, Return_Date, Trip_ID)
EXPENSE (Trip_ID, Account#, Amount)
Select appropriate datatype for each of the fields. Identify appropriate "keys".
Input meaningful data for at least 5 records for each.

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

MASTER OF COMPUTER APPLICATIONS (Revised)


(MCA)
Term-End Practical Examination
.111:21 C June, 2017

MCSL 045(P)/S1 : UNIX AND DBMS LAB


-

Time : 2 Hours Maximum Marks : 50

Note : (i) There are two sections in this paper.


(ii) All the questions are compulsory.
(iii) Each section is of one hour duration and carries 20 marks.

(iv) 5 marks are for viva-voce of each section separately.


(v) Attempt only that section(s) in which you are not successful as yet.

SECTION A
UNIX

1. Write and execute the following UNIX commands : 5x1=5


(a) To show the date and time.
(b) To show the system status and CPU-bound processes.
(c) To find out information about the user @ system.
(d) To show last few lines of a text file.
(e) To display binary file as equivalent oct/hex codes.

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

3. Create a database with the following schema :


INSURANCE DATABASE
DRIVER (DRIVER_ID, NAME, ADDR1, ADDR2, CITY, STATE)
CAR (REG_NO, MODEL, MAKE, YEAR)
ACCIDENT (FIR_NO, ACCD_DATE, LOCATION)
OWNS (DRIVER_ID, REG_NO)
PARTICIPATED (DRIVER_ID, REG_NO, FIR_NO, YEAR, DAMAGE_AMOUNT)
Select appropriate data types for all the fields. Identify the primary key. Also,
input 10 meaningful records. 10

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

You might also like