0% found this document useful (0 votes)
50 views

DBMS Practical - Internals Questions

Uploaded by

kavya.jagtap04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

DBMS Practical - Internals Questions

Uploaded by

kavya.jagtap04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Q1. Create the table called EmpDetails with the below mentioned details.

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

Table name: Employee


Constraints: Eid is Primary key and DeptId is foreign key, Salary should not be less than 10000
Table name: Department
Constraints: DeptId Primary key and Dname is NOT NULL

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.

Q4. Create a Table for Library Information .

Table name: Library


Constraints: BookId is primary key and BookName is NOT NULL

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.

1. Display name and specialization of all the teachers in city "Delhi".


2. Display name, Student ID and Programme in which they are registered, of all the students.
3. Display name of teacher of Teacher_ID = 123 and name of all the students who are associated
with TeacherID = 123.
4. Display name, specialization, and city of all the teachers who are associated with "Physics"
department.
5. Display total number of students registered in "MCA" programme.

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

EMPLOYEE (LID, Name, Age, Address, Salary, Dep_ID)


DEPARTMENT (Dep_ID, Name, City)
Select appropriate primary keys. Input at least 5 meaningful records in the tables. Select appropriate data
types for all the fields.

(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.

You might also like