DBMS Practical - Internals Questions
DBMS Practical - Internals Questions
1. Write sql query to display all the employees whose designation is Programmer.
2. Write sql query to display employees who have joined after 2014.
3. Write sql query to display all the employees whose name ends with ‘a’.
4. Write sql query to display the total salary of all the employees whose designation is
programmer.
5. Write sql query to display all the employee names in upper case.
Q2. Create the two tables as shown below with the given constraints
1. Write sql query to display all the employees who earn more than average salary of all the
employees in the company.
2. Write sql query to display the fields Eid, Ename and Dname.
Q3 Create the table called Student with the below mentioned details.
1. Write sql query to display the students who are not from Telangana or AndhraPradesh.
2. Create a view to display the columns Sid, Sname for students belonging to Telangana.
3. Write sql query to display the student ids, names, and their present age.
4. Write sql query to delete all the students records who have enrolled for Comp course and who
are born after 2002.
5. Write a sql query to add two new columns Contactno and Email to the existing fields.
1. Write sql query to display the list of authors from Himalaya publications.
2. Write sql query to display the books whose price is between 500 and 700
3. Write sql query to display the book details where author name contains the name Sharma.
4. Write sql query to count the total number of books under Kalyani publications.
Q5. Create the following tables with the fields given below :
TEACHER (T_ID, Department, Year of Exp, Name)
SUBJECT PAPER (Sub_Paper_ID, T_ID, Title_of Paper, Programme, Semester)
Select appropriate primary keys. Input at least 5 meaningful records in the tables. Select
appropriate data types for all the fields.
1. Display Name and Year-Of-Exp of all the teachers of "Computer Science" department.
2. Display name of teacher and department of all the teachers who have more than 5 years of
experience.
3. List the file of Subject Paper which are handled by T_ID = 1010.
4. List the name of Programme and Semester of paper titled "C Programming".
5. List name of all the teachers of "Physics" department.
Q6. Create the following tables with the fields given below :
STUDENT (Student ID, Name, Programme, Teacher ID)
TEACHER (Teacher ID, Department, Name, City, Specialization)
Select appropriate primary keys. Input at least 5 meaningful records in the tables. Select appropriate
data types for all the fields.
Q7. Create the following tables with the fields given below
PRODUCT (Product_ID, Supplier ID, Proudct_Name, Category, Price, QuantityAvailable)
SUPPLIER (Supplier ID, Name, Area, City)
Select appropriate primary keys. Input at least 5 meaningful records in the tables. Select appropriate
data types for all the fields.
(a) List price and product name of all the products whoseQuantity- available is more than 100.
(b) Display product name and category of all the product whose price is more than Rs. 1,000
(c) Display product name and product ID of the products which are supplied by SupplieriD = 10111.
(d) Display name and area of all the suppliers of city "Mumbai".
(e) Display the number of products which are of price more than Rs. 1,500 and QuantityAvailable is
more than 5.
Q8. Create the following tables with the fields given below
(a) Display name and Dep_ID of all the departments in city "Delhi".
(b) Display name and age of the employees working in Dep_ID = 1001 and their salary is more than 10,000/-
p.m.
(c) Find total number of employees whose salary is less than 7 50,000/- p.m.
(d) Display name and salary of all the employees whose age is more than 50 years.
(e) Display name and E_ID of all the employees who work in Dep_ID = 11011.
Q9.
Q10.