1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

plz plz help me wit these queries as soon as possible

Discussion in 'SQL - Questions and Answers' started by debonita2009, Mar 23, 2009.

  1. debonita2009 New Member

    plz help me wit queries
    im a bca student... can sumbody plz help me with the foll queries.. il b r grateful....

    1) consider th foll relations:
    BATSMEN (BAT_NAME, COUNTRY_CD, BAT_HAND, TOTRUNS, TOTFOURS, TORSIX, AVG, TOTMATCH)
    BOWLER( BOW_NAME, COUNTRY_CD, BOW_HAND, WICKETS, MATCHES)
    COUNTRY (COUNTRY_CD, COUNTRY_NAME)
    a) find th bowler who is the highest wicket taker.
    b)list th name of the batsman who have not played for 'india' or 'pakistan'
    c)delete records of players who played for 'kenya'

    2)consider the foll:
    lives( person_name, street , city)
    works( company_name, person_name, salary)
    locatedin(company_name, city)
    manager(person_name, manager_name)

    a)write a query in relational algebra to find the names , city of all employees who work for corporation bank.
    b) write a query in sql to list the names of all employees who live in margao work for company uti and earn more than mr. kamat.
    c) write a query in sql to list names of all employees who live in the same street and city as their manager.
    d) write a query in sql to list the manager name, salary , company , for which the person is the manager. list also the city and street of the manager.
    e) make the following modifications to the above database in sql. give all managers a 10% raise in salary, if salary becomes greater than 10000 due to this raise then give raise of only 3%
    f) find the employees who live in the same city as the company they work for.
    g) find the name, street and city of all employees who work for sbi and earn more than rs 1,00,000/-

    3) consider the foll :
    hotel ( hotel_no, hotel_name, city)
    room( room_no, hotel_no, type , price)
    booking ( hotel_no, guest_no, date_from, date_to, room_no)
    guest( guest_no, guest_name, guest_address)

    a)list the rooms that are currently unoccupied at the taj hotel.
    b) what is the most commonly booked room type for each hotel in pune.
    c) get the details of the guest who stays in the hotel of pune more than 15 days by occupying double bedrooms.
    d)delete the details of the guest who stayed in the hotels of nasik for a day.


    4) consider the foll
    customer ( cust_no, cust_name, cust_city, cust_street)
    account( acc_no, cust_no, branch_no, acc_bal)
    depositor( cust_no, acc_no, amt, dateof_dep)
    branch( branch_no, branch_name, branch_city)

    a)find branch names and average balance where the average balance is more than 5000 in sql
    b) find the customer who lives in 'mumbai' and has atleast four accounts in sql.
    c) find the customer name along with account number and branch name that deposited money on 14th jan 2005 in sql.
    d) write a query in relational algebra to find branch with maximum number of accounts.

    5)consider the following :
    sailors ( sailor_id, sailor_name, rating , age)
    boats( boat_id, boat_name, colour)
    reserves( sailor_id, boat_id, day)

    a)find the sailor ids of all sailors who have reserved red boats but not green boats.
    b) find the names of sailors who have reserved a red boat.
    c) find the sailors with the highest rating
    d) find the name and age of the oldest sailor.

    6) consider the following :
    pilot( p_id, name, hours_flew, age)
    plane( plane_no, model, airline)
    trip( p_id, plane_no, date)

    a) count the number of pilots who flew for over 500 hours and never flew a boeing 747 plane
    b) find the names of all pilots who flew a plane on 11/09/2002
    c) find the age of the oldest pilot


    7) consider the following
    suppliers ( sid, sname, saddress)
    parts( pid, pname, colour)
    catalog(sid, pid, date)

    a) find the details of the suppliers who supply parts of colour red.
    b) find the part names of the parts supplied on 14th feb 2005
    c) find the names of the suppliers who supplies all parts
    d) find the name of supplier who supplies maximum number of parts.

    8) consider the foll:
    employee( emp_id, emp_name, salary, sex, dept_id)
    department( dept_id, dept_name)
    project( proj_id, proj_name, topic, budjet, dept_id)

    a) list the name of the project with the lowest budget under sales department.
    b) increase the salary of all the male employees by 10%
    c) display the details of the projects undertaken by the employees in the descending order of proj id
    d) list the names of all the employees under the same department.

    9)consider the database:
    product ( pno*, pname, price)
    customer ( cno*, cname)
    order( pno*, cno*)

    i) find the pnames which have the second lowest pricing
    ii)find the pname for which there arent any orders.
    iii) delete all orders , for customer with cname = 'jason'
    iv) using relational algebra find the cno who have placed orders for all possible pnos.

    10)consider:
    student (rno, name, age, sex, adress, dno)
    department ( dno, dname)

    a) display the detail of female students from the "arts" department.
    b) display the department names which have average age of their students over 20 years.
    c) display the details of the student with the minimum age from the "computer" department

    plz
  2. my_s_e_l_f New Member

    You need to do your homework yourself. If you have specific issues, people can help.

Share This Page