UNIX and DBMS Lab

The assignment has two parts A and B. Answer all the questions. Each part is for 20 marks. UNIX and DBMS lab record carries 40 Marks. Rest 20 marks are for viva voce. You may use illustrations and diagrams to enhance the explanations. Please go through the guidelines regarding assignments given in the MCA Programme Guide for the format of presentation. If any assumptions made, please state them.

PART-I: MCS-041

  1. Write and execute the following UNIX commands:
    1. To change the password.
    2. To search files in the current directory/subdirectory for lines that match a particular string pattern given as input.
    3. To print the first 5 lines of a file.
    4. To print the number of processes run by a particular user.
    5. To kill a process that is running at the background.
    6. To display the count of no. of blank spaces in a given file.
    7. To sort alphabetically, a list of numbers stored in a data file in an ascending order.
    8. To convert the upper case letters to corresponding lower case letters in a text file.
    9. To count the number of users currently logged on.
    10. To display the calendar for a given month and year.
  2. Write shell programs for the following:
    1. To find second largest number among the 5 numbers given.
    2. To find sum of all the alternate digits in a given 7 digit number.
    3. To count number of vowels in a given string. (d) To take 2 strings as input, concatenate them and display
    4. To take 2 strings as input, concatenate them and display the length of the resultant string.
    5. To display the reverse of a given number.

PART-II: MCS-043

    1. Design a database for a Property Dealer who deals in Flat Rentals, including:
      1. Apartment data: city, street, house number, apartment number, size (square feet), purchase date and price, rent per month
      2. Renter data: name, contact information, which apartments she/he has rent (one renter may have several) and for which time periods, agreed start date, agreed end date (if fixed), check out date
      3. The relational schema is as follows:
        1. Apartment(aptID, city, street, housenr, aptnr, size, purchdate, price).
        2. Rent(aptID, rentsetdate, rentpermonth).
        3. Renter(renterID, name, contact).
        4. Rental(aptID, renterID, startdate, enddate, checkout)
    2. Perform following queries using SQL:
      1. To find the total rent earned during certain time interval (input to be given by the user) for a particular aptID.
      2. To display all the aptIDs if the street ID and City are given.
      3. To display the list of all the renters w
      4. ho have more than one apt.
      5. To display the list of all aptIDs whose rent is equal to or more than Rs.15,000/- per month in a particular street with apt size more than 850sq feet.
      6. To display all the details of the apartment which were bought before year 2000 in a particular city and street.
    3. Write appropriate triggers, exceptions and functions for the above said system database schema and describe them briefly.