DBMS (Database Management Systems) Example Queries
DBMS (Database Management Systems) Example Queries
4) Consider the following schema for the company data base. The
primary keys are underlined.
Employee(SSN, fname, lname, birthdate, address, salary, dnumber)
Department(Dnumber, Dname, Dlocation)
Perform the following operations using SQl. Assume the data.
i) Insert a record into employee table.
ii) Delete an employee with SSN equal to 10.
iii) Update the Dnumber of the employee tuple having salary greater than
Rs. 10,000.
iv) Retrieve the name and address of all employees who work for the “XYZ”
department.
5)Assume there are two relations,
STUDENT(stnum,stname,totalmarks,semester)
Hostel(stnum,roomnum)
Represent the following queries in SQL.
i) Obtain the room number allotted to Sai
ii) Obtain name of the student staying in room number 19
iii) Get the name and marks of student with student number 1939