Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
45 views5 pages

CMSM4156 (Set-1) 2014

This document contains exam questions for a database management systems course. It includes 3 groups of questions. Group A focuses on SQL and PL/SQL programming and covers creating tables, inserting data, updating records based on conditions, and retrieving data using functions and cursors. Group B involves C programming questions on processes, file handling, and parallel programming using OpenMP. The questions test skills like creating and manipulating database tables, exception handling, inter-process communication, and parallelizing algorithms.

Uploaded by

Its Me SR
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)
45 views5 pages

CMSM4156 (Set-1) 2014

This document contains exam questions for a database management systems course. It includes 3 groups of questions. Group A focuses on SQL and PL/SQL programming and covers creating tables, inserting data, updating records based on conditions, and retrieving data using functions and cursors. Group B involves C programming questions on processes, file handling, and parallel programming using OpenMP. The questions test skills like creating and manipulating database tables, exception handling, inter-process communication, and parallelizing algorithms.

Uploaded by

Its Me SR
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/ 5

ST.

XAVIER’S COLLEGE
KOLKATA
(AUTONOMOUS)

1st SEMESTER EXAMINATION


NOVEMBER - DECEMBER 2014
M.Sc. Computer Science
Thursday, 4th December 2014
CMSM4156 10:00 am to 1:00 pm
Full Marks : 80
P/SQL & OS
PROGRAMMING LAB
(SET-1)

READ THESE INSTRUCTIONS FIRST:


 Of the questions attempted, the answers to only the first required number of questions (as
stipulated in the question paper) will be evaluated. So please do not attempt extra
questions.
 Use fountain pen or ball-point pen of blue or black ink.
 Answer in your own words as far as practicable.
 Do not write anything on the Question paper other than your Roll No.
 Answer Each Group in a separate Answer script.

At the end of the examination, fasten all your work securely together.
The marks are given in brackets [ ] at the end of each question or part question.

The question paper consists of 5 pages.

29112014 1
SET: I
GROUP-A
EXPERIMENT: 30; VIVA: 10

1. Create the following tables for a Book Store with proper integrity constraints:
Book (Book_id, Book_name, Book_price,Cust_id); Assume a book can have
multiple copies in the library.
Customer (Cust_id,Cust_name, Cust_city,Cust_add).

Every Book id must begin with ‘BK’, the price range of the books is from
Rs.100/- to Rs.5000/-. Insert at least 6 records in each table.

Now add a field ‘quantity’ to the Book table.

(a) Write a PL/SQL code to input the name of a Book and to check whether the
number of this book present in the store is less than 20. If so, add 100% more
items, otherwise add 50% more books. Ensure that the updation is properly
done. Write a block to throw an exception if the given book id is invalid.
(b) Write a procedure/function in PL/SQL to input the id of a customer and find
his/her details (name, city and address.) [10+10+10=30]

2. (a) Write a PL/SQL code to store the first n positive odd integers along with
their squares in table. 'n' should be taken as an input from the user. The
program will also display the rows of the table.
If the number supplied by the user is a negative number, a proper exception
will be thrown. (Create suitable table.)
(b) Write a PL/SQL code to check whether a given number is a palindrome or
not. The number should be taken as an input from the user.
(c) Write a PL/SQL program to check whether a given number is divisible by 5
or not. If the number is divisible by 5 then find the square of that number; if
the number is divisible by 2 then find the square root of it else find the cube
of that number.
[10+10+10=30]

3. Create the following tables with proper integrity constraints:


Student (s_id, s_name, s_fees, dept_id)
Department (dept_id,dept_name,dept_floor)

Every student id must begin with ‘STD’, the fees range of a student should be
between 2000 and 4000, and the departments are located in one of the following
floors : First, Second, Third and fourth. [10]
29112014 2
(i) Write a PL/SQL code using Cursor to decrease the fees of all the student of
first floor and third floor by 20%, second and fourth floors by 10 %.
(ii) Write a cursor/function to input the id of a student and return the
corresponding student details. Use proper Exception Handling in case of
invalid data s_id input.
[10+10=20]

SET: I
GROUP-B
EXPERIMENT: 30; VIVA: 10

4. (a) Write a parent C program to create a child processes. The child process
should create a text file by accepting characters from the keyboard. After the
file has been created, the parent should display the contents of the file.
(b) Write a C program using Open MP features to find the dot product of two
vectors of size n each in constant time complexity.
[Hint: Dot product = Ʃ(A[i]*B[i])] [18+12=30]

5. (a) Write a C program by using system calls to create a new text file by
accepting the text from the standard input. The new text file should store
only the digits. After the creation of the file, display the size of the file in
bytes.
(b) Write a C program using OpenMP features to find the dot product of two
vectors of size n each in constant time complexity.
[Hint: Dot product = Ʃ(A[i]*B[i])] [18+12=30]

6. (a) Write a parent C program to create a child process. The child process should
display the current system date.
(b) Write a C program using OpenMP features to find the dot product of two
vectors of size n each in constant time complexity.
[Hint: Dot product = Ʃ(A[i]*B[i])] [18+12=30]

7. (a) Write a C program by using system calls to open a text file and copy
everything except alphabets and digits in another file. After the creation of
the file, display the size of the file in bytes.
(b) Write a C program using OpenMP features to find the dot product of two
vectors of size n each in constant time complexity.
[Hint: Dot product = Ʃ(A[i]*B[i])] [18+12=30]

***********

29112014 3
CMSM 4156
SET: I
GROUP-A
1. Create the following tables for a Book Store with proper integrity constraints:
Book (Book_id, Book_name, Book_price,Cust_id); Assume a book can have multiple copies in
the library.
Customer (Cust_id,Cust_name, Cust_city,Cust_add).

Every Book id must begin with ‘BK’, the price range of the books is from Rs.100/- to Rs.5000/-.
Insert at least 6 records in each table.

Now add a field ‘quantity’ to the Book table.

(a) Write a PL/SQL code to input the name of a Book and to check whether the number of this
book present in the store is less than 20. If so, add 100% more items, otherwise add 50%
more books. Ensure that the updation is properly done. Write a block to throw an exception
if the given book id is invalid.
(b) Write a procedure/function in PL/SQL to input the id of a customer and find his/her details
(name, city and address.) [10+10+10=30]

CMSM 4156
SET: I
GROUP-A
2. (a) Write a PL/SQL code to store the first n positive odd integers along with their squares in
table. 'n' should be taken as an input from the user. The program will also display the rows of
the table.
If the number supplied by the user is a negative number, a proper exception will be thrown.
(Create suitable table.)
(b) Write a PL/SQL code to check whether a given number is a palindrome or not. The number
should be taken as an input from the user.
(c) Write a PL/SQL program to check whether a given number is divisible by 5 or not. If the
number is divisible by 5 then find the square of that number; if the number is divisible by 2
then find the square root of it else find the cube of that number. [10+10+10=30]

CMSM 4156
SET: I
GROUP-A
3. Create the following tables with proper integrity constraints:
Student (s_id, s_name, s_fees, dept_id)
Department (dept_id,dept_name,dept_floor)

Every student id must begin with ‘STD’, the fees range of a student should be between 2000 and
4000, and the departments are located in one of the following floors : First, Second, Third and
fourth. [10]

(i) Write a PL/SQL code using Cursor to decrease the fees of all the student of first floor and
third floor by 20%, second and third floors by 10 %.
(ii) Write a cursor/function to input the id of a student and return the corresponding student
details. Use proper Exception Handling in case of invalid data s_id input. [10+10=20]

29112014 4
CMSM 4156
SET: I
GROUP-B
4. (a) Write a parent C program to create a child processes. The child process should create a text
file by accepting characters from the keyboard. After the file has been created, the parent
should display the contents of the file.
(b) Write a C program using Open MP features to find the dot product of two vectors of size n
each in constant time complexity.
[Hint: Dot product = Ʃ(A[i]*B[i])] [18+12=30]

CMSM 4156
SET: I
GROUP-B
5. (a) Write a C program by using system calls to create a new text file by accepting the text from
the standard input. The new text file should store only the digits. After the creation of the
file, display the size of the file in bytes.
(b) Write a C program using OpenMP features to find the dot product of two vectors of size n
each in constant time complexity.
[Hint: Dot product = Ʃ(A[i]*B[i])] [18+12=30]

CMSM 4156
SET: I
GROUP-B
6. (a) Write a parent C program to create a child process. The child process should display the
current system date.
(b) Write a C program using OpenMP features to find the dot product of two vectors of size n
each in constant time complexity.
[Hint: Dot product = Ʃ(A[i]*B[i])] [18+12=30]

CMSM 4156
SET: I
GROUP-B
7. (a) Write a C program by using system calls to open a text file and copy everything except
alphabets and digits in another file. After the creation of the file, display the size of the file
in bytes.
(b) Write a C program using OpenMP features to find the dot product of two vectors of size n
each in constant time complexity.
[Hint: Dot product = Ʃ(A[i]*B[i])] [18+12=30]

29112014 5

You might also like