Tuesday, 21 January 2014

C# DATABASE PROGRAMS




  1. Create a table employee with the following fields :  idno, name, designation, department, dob, doj and salary. Insert 6 values into the table. Write a C# program to do the following :
a)    Display the employees belonging to sales department and whose salary is in the range of  Rs. 10000 and Rs. 15000.
b)    Display the employee details whose salary is maximum.

  1. Create a table CIA with the following fields :  regno, name, class, test1, test2, asmt1, asmt2, quiz and total. Insert 6 values into the table. Write a C# program to do the following :
a)    List out the student details whose quiz mark is greater than the average of assignment marks.
b)    List out the student details whose total is greater than 80 and belonging to I M.C.A.

  1. Create a table accounts with the following fields :  accno, custname, bankname, acctype & balance and create another table transaction with the following fields: accno, trans_date, trans_type, and trans_amt. Insert 6 values into each table. Write a C# program to do the following :
a)    Display  the accno and bankname of customers whose deposit amount is greater than 5000 for this month.
b)    Transfer the details of SBI account whose trans_amt is < 10000 to IOB.

  1. Create a table employee with the following fields :  idno, name, dept, dob, doj & salary and create another table personal with the following fields: idno, address, phone_no, bloodgroup and accno. Insert 6 values into each table. Write a C# program to do the following :
a)    Display  the name and address of employees in accounts dept. and whose salary  is greater than 5000.
b)    Display the employee details with minimum and maximum salary.
  1. Create a table stock with the following fields :  item_code, item_name, company_name, quantity_on_hand, reorder_level and price. Insert 6 values into the table. Write a C# program to do the following :
a)    Display  the item details which has the lowest price and highest price.
b)    List out the item name and price of items whose item name ends with ‘r’.

  1. Create a table student with the following fields :  regno, name, class, dob, & bloodgroup and create another table hostel with the following fields: hostel_no, block_name, room_no and regno. Insert 6 values into each table. Write a C# program to do the following :
a)    Display  the total number of students in each block from M.C.A.
b)    Display the student details in Gandhi block and whose name begins with ‘M’.

  1. Create a table employee with the following fields :  idno, name, designation, department, dob, doj and salary. Insert 6 values into the table. Write a C# program to do the following :
a)    Display the employees in the sorted order of their salary.
b)    Count the number of employees in each department.

  1. Create a table accounts with the following fields :  accno, custname, bankname, acctype & balance. Insert 6 values into the table. Write a C# program to do the following :
a)    Display  the customer details who has both type of accounts.
b)    Insert a new record into the table.

  1. Create a table student with the following fields :  regno, name, class, subject1, subject2, subject3 and total. Insert 6 values into the table. Write a C# program to do the following :
a)    Display  the student details whose name begin with ‘P’.
b)    Count the number of students who scored below 50 in all subjects.
  1.  Create a table book with the following fields : isbn, title, author, publisher and price. Insert 6 values into the table. Write a C# program to do the following :
a)    Display  the book details of same author for same publishers.
b)    List out the book details in author wise order.

  1.  Create a table stock with the following fields :  item_code, item_name, company_name, quantity_on_hand and price. Insert 6 values into the table.
a)    Insert a record into the table.
b)    Modify the price value of the item whose item_code is I005.

  1.  Create a table accounts with the following fields :  accno, custname, bankname, acctype & balance and create another table transaction with the following fields: accno, trans_date, trans_type, and trans_amt. Insert 6 values into each table. Write a C# program to do the following :
a)    Display  the accno and bankname of customers who have withdrawal transactions in this month.
b)    Insert a new record into both the tables.

  1.  Create a table journey with the following fields :  ticket_no, date, passenger_name, origin, destination, gender, bloodgroup and age. Insert 6 values into the table. Write a C# program to do the following :
a)    Count the number of male passengers traveling below 21 years.
b)    Delete the details of passengers those who are travelling from Chennai and age is between 50 and 75.

14. Create a table book with the following fields :  isbn, title, author,  publisher    and  price. Insert 6 values into the table. Write a C# program to do the following :
a)    Display  the book details with same title written by same author for different  publishers.
b)    Display the book names belonging to TMH publications and author name ends with ‘raj’ or ‘Raj’.


  1.  Create a table stock with the following fields :  item_code, item_name, company_name, quantity_on_hand, reorder_level and price. Insert 6 values into the table. Write a C# program to do the following :
a)    Display  the item details whose quantity_on_hand is less than the reorder_level.
b)    Display the item_code and item_name which belongs to the same company.

  1.  Create a table book with the following fields :  isbn, title, author, publisher    and  price. Insert 6 values into the table. Write a C# program to do the following :
a)    List out the book names whose price is > 250 and author name ends with ‘h’.
b)    Display the book names belonging to PHI publications and price is between  Rs.1000 and  Rs.2000.

  1.  Create a table student with the following fields :  regno, name, class, dob, & bloodgroup and create another table hostel with the following fields: hostel_no, block_name, room_no and regno. Insert 6 values into each table. Write a C# program to do the following :
a)    List out the blood groups available in the hostel with number of students having it.
b)    Display the students belonging to Nehru block with ‘O+ve’ bloodgroup.

  1.  Create a table accounts with the following fields :  accno, custname, bankname, acctype & balance. Insert 6 values into each table. Write a C# program to do the following :
a)    Count the number of customers belonging to SA type and whose balance is > 30000.
b)    Display the customer details with maximum and minimum balance.



  1.  Create a table employee with the following fields :  idno, name, dept, dob, doj & salary and create another table personal with the following fields: idno, address, phone_no, bloodgroup and accno. Insert 6 values into each table. Write a C# program to do the following :
a)    List out the employee details whose salary is maximum with O+ve blood group.
b)    Count the number of employees in sales department with B+ve blood group.

  1. Create a table student with the following fields :  regno, name, class, dob, & bloodgroup and create another table hostel with the following fields: hostel_no, block_name, room_no and regno. Insert 6 values into each table. Write a C# program to do the following :
c)    List out the blood groups available in the hostel with number of students having it.
d)    Display the students belonging to Nehru block with ‘O+ve’ bloodgroup.

No comments:

Post a Comment