Wednesday, November 23, 2022

Database Management systems - Module 2


1 a. Explain the entity integrity and referential integrity constraints.  Why is each considered important. Give examples.

   b. Discuss equijoin and natural join with suitable examples using relational algebra notation.

   c. Given the schema:

      Passenger (pid,pname,pgender,pcity)

      Agency (aid,aname,acity)

      Flight (fid,fdate,time src,dest)

      Booking (pid,aid,fid,fdate)

     Give relation algebra expression for the following:

  1. Get the complete details of all flights to new Delhi
  2. Find only the flight numbers for the passenger with paid 123 for flights to Chennai before 06/11/2020
  3. Find the passenger names for those who do not have any bookings in any flights
  4. Get the details of flights that are scheduled on both dates 01/12/2020 and 02/12/2020 at 16:00 hours
  5. Find the details of all the male passengers who are associated with jet agency.

2 a. Explain the ER to relational mapping algorithm with suitable examples for each step.

   b. Write SQL query for the following database scheme:

        Employee (employee_name,street,city)

        Works (employee_name,company_name,salary)

        Company (company_name,city)

        Manages(employee_name,manager_name)

  1. Find the name, street address and cities of residence for all employee who work for ‘First Bank Corporation’ and earn more than $10000
  2. Find the names of all employees in the database who do not work for ‘First Bank Corporation’. Assume that all people work for exactly one company.
  3. Find the names of all employees in the database who earn more that every employee of ‘First Bank Corporation’. Assume that all people work for at most one company.
  4. Find the name of the company that has the smallest payroll
  5. Find the names of all the employee in the database who live on the same cities and on the same streets as do their managers.

3 a. Discuss the characteristics of relation that make them different from ordinary tables.

   b. Discuss DIVISION operation. Find the quotient for the following :  A/B1,A/B2,A/B3 where   A,B1,B2,Bare


4 a. Explain the steps to convert the basic ER model to relational database schema.

   b. For the following relations for a book club:

       MEMBERS (member_id,name,desg,age)

       BOOKS (book_id,book_title,book_author,book_publisher,book_price)

       RESERVES (member_id,book_id,date)

       Write the SQL queries 

  1. Find the names of members who are professors older than 45.
  2. List the titles of books reserved by professors.
  3. Find ID’s of members who have not reserved books that cost more than Rs.500
  4. Find the authors and titles of books reserved on 27-may-2017
  5. Find the names of members who have reserved all books

5 a. Consider the following schema and write the relational algebra :

        Sailors (sid,sname,rating,age)

        Boats (bid,bname,color)

        Reserve (sid,bid,day)

  1. Retrieve the sailors name who have reserved red and green boats
  2. Retrieve the sailors name with age over 20 years and reserved black boats
  3. Retrieve the sailors name who have reserved green boat on Monday
  4. Retrieve the number of boats which are not reserved
  5. Retrieve the sailors name who is the oldest sailor with rating 10

    b. List Set theory operations used in relational data model. Explain any two with an example.

    c. Define the following 

       a) Relation state    b) Domain   c) Relation schema   d) Arity

6 a. Discuss the various types of JOIN operations with an example. Why is THETA join required?

   b. Describe the steps of an algorithm for ER-to-Relational mapping.

   c. Describe any two characteristics of relations with suitable example for each.

7. Define the following terms i) Key ii) Super key iii) Candidate key iv) Primary key v) Foreign key

8. Consider the following COMPANY database 

    EMP(Name,SSN,Salary,SuperSSN,Gender,Dno) 

    DEPT(DNum,Dname,MgrSSN,Dno) 

    DEPT_LOC(Dnum,Dlocation)

    DEPENDENT(ESSN,Dep_name,Sex) 

    WORKS_ON(ESSN,Pno,Hours) 

    PROJECT(Pname,Pnumber,Plocation,Dnum)

    Write the relational algebra queries for the following 

    (i)Retrieve the name, address, salary of employees who work for the Research department. 

    (ii) find the names of employees who work on all projects controlled by department number4. 

    iii) Retrieve the SSN of all employees who either in department no :4 or directly supervise an employee           who work in department number :4

    (iv) Retrieve the names of employees who have no dependents

    (v) Retrieve each department number, the number of employees in the department and their average salary.

9. Summarize the steps involved in converting the ER constructs to corresponding relational tables

10. Explain with example basic constraints that can be specified when a database table is created.

11. Write SQL syntax for the following with example: (i) SELECT (ii) ALTER (iii) UPDATE

12.Consider the following relation schema 

    Works(Pname,Cname,salary) 

    Lives(Pname,Street,City) 

    located_in (Cname, city) 

    Manager(Pname,Mgrname) 

    Write the SQL queries for the following

     i) Find the names of all persons who live in the city Bangalore. 

    ii) Retrieve the names of all person of "Infosys" whose salary is between Rs .50000 

    iii) Find the names of all persons who lives and work in the same city 

    iv) List the names of the people who work for “Tech M” along with the cities they live in. 

    v) Find the average salary of “Infosys” persons


Sunday, October 9, 2022

Database Management Systems -Module 1

 

MODULE - 1 - Introduction to Databases

  1. Explain the characteristics of data base approach.
  2. Compare DBMS and early file systems bringing out the major advantages of the database approach. 
  3. Discuss the main Characteristics of the database approach.How does it differ from Traditional file systems?
  4. With a neat block diagram, explain the architecture of a typical DBMS. 
  5. Explain the typical components of a DBMS with a neat diagram
  6. Explain different types of user friendly interfaces and types of user who typically use each.
  7. What are the responsibilities of a data base administrators.
  8. What is meant by “persistent storage for program objects”. Explain.
  9. Briefly discuss the advantages of using the DBMS.
  10. Explain the Operation of Two-Tier Client/Server architecture for RDBMS?
  11. Briefly explain the advantages of Object Oriented Systems? 
  12. List the summary of the notations for ER diagrams. Include symbols used in ER diagram and their meaning.
  13. Define the following with an example: (i) Weak entity type (ii) participation constraint (iii)cardinality ratio (iv) recursive relationship (v) specialization
  14. Develop an ER diagram for keeping track of information about a company database taking into account atleast five entities.
  15. Explain hoe role names are assigned in case of recursive relationships? Illustrate this concept with an example.
  16. Design an ER Diagram for keeping track of Information about Bank Database,Taking into account 4 entities?
  17. Draw an ER diagram for a movie database. Assume your own entities (minimum 4), attributes and relationship. Indicate all keys, constraints and assumptions that are made.
  18. What are the responsibilities of the DBA and database designer?
  19. Discuss with example the structural constraints on relationship types.
  20. Describe the three schema architecture. Why do we need mapping among schema levels.
  21. Discuss the main characteristics of the database approach and how it differs from traditional file system.


 

Thursday, August 11, 2022

Object Oriented Concepts - Module 3


  1. Differentiate C++ and JAVA w.r.t inheritance. Also mention the use of super and this in Java.
  2. Define inheritance. List the different types of inheritance in java
  3. Illustrate with example a super class variable can reference a subclass object.
  4. Compare and contrast method overloading and overriding
  5. Define inheritance. Explain multilevel hierarchy with an example program.
  6. Discuss the terms: a)super b) final c) abstract class
  7. Can you overload constructor and destructor ? Justify with suitable program.
  8. Briefly explain the role of interfaces while implementing multiple inheritance in java
  9. What is the alternative approach to implement multiple inheritances in Java? Explain with example.
  10. What is meant by instance variable hiding? How to overcome it?
  11. With an example, give two uses of super.
  12. Discuss the following a. Inner class  b. Overriding and overloading c static variable and methods
  13. Write a program which contains one method which will throw IllegalAccessException and use proper exception handlers so that exception should be printed.
  14. Explain the constructor method. How is it different from other member functions.
  15. What is a Java exception? Explain the exception handling mechanism with an example.
  16. Define Exception. Demonstrate the working of nested try block with suitable examples.
  17. Create a try block that is likely to generate three types of exceptions and incorporate necessary catch blocks to handle them.
  18. Explain the java’s built-in exceptions.
  19. Give the basic form of an exception handling block.
  20. What is the importance of the clause finally.
  21. Illustrate the usage of throw in exception handling with suitable example.


Wednesday, August 10, 2022

Object Oriented Concepts : Module 4

  1. What is multithreading? Explain any two uses of multithreaded programs.
  2. Write a Java program to implement a producer-consumer problem using threads.
  3. Explain the mechanism of event delegation model. Give an example for using keyboard event.
  4. What is multithreading? Write a program to create multiple threads in Java.
  5. Discuss the significance of synchronization in Java.
  6. Briefly explain the role of :  a. ActionEvent class b. AdjustmentEvent class
  7. With syntax, explain the use of isAlive() and join() methods.
  8. How synchronization can be achieved for threads in Java? Explain with syntax.
  9. Enlist the different methods in WindowListener. What is the use of WindowAdaptor?
  10. Write a program in applet which will print “key pressed” on the status window when you press the key, “key released” on the status window when you release the key and when you type the characters it should print “Hello” at coordinates (50,50) on applet.
  11. What is meant by thread priority? How it is assigned?
  12. Explain the adaptor classes with examples.
  13. Provide Java syntax for the following:  
a. Making class threadable. 
b. Extending thread. 
c. Synchronization  
d. Catching interrupt
    14. Write a Java program which creates two threads, one thread displays “VTU-Belgaum” for every 100 seconds, and another thread displays “Karnataka” for every 50 seconds continuously.
    15..Define the delegation event model. Briefly explain the role of
    a. Event classes
    b. Event listener interfaces
    c. Sources of events
    d. Adaptor classes

16. Describe the various levels of access protections available for packages and their implications.

17. Define package. What are the steps involved in creating user defined package with an example.

18. Explain how variables in interfaces are used.  

Tuesday, August 9, 2022

Object Oriented Concepts : Module 5

  1. Discuss delegation event model with suitable example. 
  2. Explain with suitable example inner class 
  3. Explain JComboBox with example.
  4. Describe the two keys features of swings. 
  5. Create swing applet that has two buttons named beta and gamma. When either of the buttons pressed, it should display “beta pressed” and “gamma pressed” respectively.
  6. Explain any 8 event listener inter-faces with syntax
  7. Explain different methods of applet.
  8. Explain the HTML applet with syntax and example 
  9. Explain the following with an example for each and syntax.: A) .JLabel B) JTextField C) .JButton D) .JCheckBox E).JComboBox F) Jlist
  10. Explain a simple swing application with suitable program
  11. Explain delegation event model in Java.
  12. Write a Java program to handle mouse event. 
  13. Create a swing applet that has two buttons named as "CSE" and "ISE". When either of the button is pressed, it should display "CSE" is pressed" and "ISE is pressed" respectively. 
  14. Explain briefly the components and containers used in swings. 
  15. Write a swing program to create a table with column heading as StudentName, USN, Address and insert 5 records into the table and display on screen. 
  16. Explain key event class 
  17. Describe key features of Swings in Java. 
  18. Compare AWT and Swings. 
  19. Write a note on JFrame and JButton.

Object Oriented Concepts - Module 2

  1. List and explain the java  buzzwords.
  2. Explain how java is robust and interactive
  3. Explain type conversions in java with suitable example.
  4. Explain the concepts of arrays 'in java with examples.
  5. Write a java program to sum only first five elements of the array using for each looping.
  6. Write a java program that creates and initialises a four integer element array. Find the sum and average of its value.
  7. Explain the syntax of for-each loop.Write a java program to search a key element by using for-each loop.
  8. Explain type conversion in java with an example.
  9. Write a java program to initialize and display different types of integer and floating point variables.
  10. Explain the operation of the following operators: with an example  i) %  ii) >>> iii) && iv) >>
  11. What is type casting. Illustrate with an example.
  12. What is meant by automatic type conversion. Give example
  13. How to declare two dimensional array in java? Explain with simple example.
  14. Differentiate the usage of access specifiers in java and their scope.
  15. List and explain different jump statements used in java with suitable example.
  16. List and explain different iteration statements used in java with suitable example.
  17. Explain switch case usage with suitable example in java
  18. List the different types of operators in java and explain any three.
  19. Illustrate the usage of primitive datatypes and their default values for an instance variable with suitable example.
  20.  Write a java Program to illustrate data types, variables, and functions
  21.  Write a java Program to illustrate the concept of classes and objects.






Tuesday, June 15, 2021

Object Oriented concepts : Module - 1

         C++ Questions

  1. Identify the differences between procedure oriented programming and object oriented programming
  2. State the important features of object oriented programming. 
  3. List and explain any five features of object oriented programming.
  4. Compare object oriented programming with procedure oriented programming.
  5. Give comparison of C and C++ with example .
  6. Write the general form of function. Explain different argument passing techniques with example 
  7. Explain function overloading with suitable example.
  8. Define function overloading. Write a C++ program to define three overloaded functions to swap two integers, swap two floats and swap two doubles 
  9. Write a C++ program to define three overloaded functions to find the product of two integers, product of two floating point numbers and product of three integers.
  10. Write a C++ program to overload the function area() with three overloaded function to find area of triangle , area rectangle and area of circle 
  11. Explain the working of inline functions with example 
  12. Write a C++ recursive program to find the factorial of a given number 
  13. Explain the use of scope resolution operator 
  14. Implement a C++ program to find prime number between 200 and 500 using for loop. 
  15. List a few areas of applications of OOP Technology. 
  16. What is class?how it is created? Write a c++ program to create a class called Employee with data members name age and salary. Display at least 5 employee information 
  17. How do namespace help in preventing pollution of the global namespace.
  18. What is nested class? What is its use? Explain with example. 
  19. What is static data member?explain with example. What is the use of static members 
  20. Write a class rectangle which contains data items length and breadth and member functions setdata() getdata() displaydata(),area() to set length and breadth, to take user input,to display data and find area of rectangle.
  21. What is a constructor. List the different types of constructor and explain default constructor with example.
  22. Define a Student class with the following measures:
    1. Data Members: RollNo, Name, AvgMarks
    2. Member functions : To read data, To print data
    3. Write a C++ program to read the data of 3 students and print the 3 student information.

        23. Define a friend function. Illustrate with an example.

        24. Explain how one can bridge two classes using friend function. Write a C++ program to find the sum of two numbers using  bridge friend function add().

        25. Can you overload constructors and destructors. Justify with example.

        26.Write a C++ programs to count the number of objects created.

Database Management systems - Module 2

1 a. Explain the entity integrity and referential integrity constraints.   Why is each considered important. Give examples.    b. Discuss eq...