Professional Documents
Culture Documents
Dbms External Que Paper
Dbms External Que Paper
Dbms External Que Paper
VISHNUPUR: BHIMAVARAM
II B.TECH – I SEMESTER LAB EXTERNAL EXAMINATION
Question # 1
1. Write Syntax of SQL Order By and Group By clauses
2. Write a procedure to print the multiplication table.
3. Create the following tables with the given information: SAILORS(sid, sname, age, rating)
3. Write a pl/sql block to check the number is even or odd, if even return true or else return
false.
4. Write SQL queries for the following
a. Write an SQL command to increase the NAME column size in STUDENT table
b. Display CSE & IT students’ details
c. Find the names of students studying in a branch “CSE” with more than 60
Percentage.
d. Find the name of the student who secured highest percentage.
Question # 3
1. Write a PL/SQL program to find the largest of 3 numbers.
2. Create the following tables with the given information: SAILORS(sid, sname, age, rating)
Question # 4
1. Create PL/SQL procedure to find area and perimeter of the given circle.
2. Explain about different numeric functions.
3. Create STUDENT & BRANCH tables with the following schemas:
STUDENT (regdno, name, age, bname, perc)
4. Write alter statements to add PRIMARY KEYs to the STUDENT and BRANCH tables.
Also write an alter statement to add FOREIGN KEY to the STUDENT table.
5. Write SQL queries for the following:
a. Display student’s details whose name starts with ‘a’.
b. Write a query to find the names of students studying in a branch started in the year
2008.
c. Display the student details by grouping them based on branch name.
Question # 5
1. Write a trigger that doesn’t allow insertion of data in the employee table.
2. Create EMP & DEPT tables with the following schemas:
EMP(EMPNO, ENAME, JOB, HIREDATE, SALARY,DEPTNO)
DEPT(DEPTNO, DNAME,
Question # 6
1. What is the difference between DELETE, TRUNCATE and DROP statements in
SQL
2. Create the following tables with the given information: SAILORS(sid, sname,
age, rating)
Question # 7
1. Create a function to reverse the given string
2. Create EMP & DEPT tables with the following schemas:
EMP(EMPNO, ENAME, JOB, HIREDATE, SALARY,DEPTNO)
DEPT(DEPTNO, DNAME, LOCATION)
3. Differentiate alter and update commands in detail 4. Write SQL queries for the following:
a. List employee details who are working in the Hyderabad location.
b. Group the employee based on the department and display the details.
c. Write a query to find the names of employee who started their career from the year
2008.
5. Write any 5 Numerical Functions for the above table.
Question # 8
1. Write a PL/SQL program to find the sum of digits in a given number
2. Write about DML commands in detail.
3. Create EMP & DEPT tables with the following schemas:
EMP(EMPNO, ENAME, JOB, HIREDATE, SALARY,DEPTNO)
DEPT(DEPTNO, DNAME,
LOCATION) Use appropriate data types for the
columns.
4. Write SQL queries for the following:
a. List employee details in departments 10 and 20.
b. List employee names and salary whose name contains 'A' as the third letter.
c. Display the department number and average salary, where the average salary is
greater than Rs. 2000.
Question # 9
1. Write and explain the structure of SQL SELECT statement with suitable
example
2. Create the following tables with the given information: SAILORS(sid, sname, age,
rating)
3. Write a pl/sql block to find whether the given number is Armstrong or not.
4. Write an ALTER TABLE command to add UNIQUE constraint on RATING column in
SAILORS table.
5. Write SQL queries for the following
a. Find the names of sailors who have not reserved boat number 103
b. Find the names of sailors who have reserved RED color boat.
c. Find the sailors whose rating is more than 7
Question #10
1. List and explain aggregate functions used in SQL with examples
2. Consider the following schema:
SAILORS(sid, sname, age, rating)
3. Write a pl/sql program to find the given number is a prime number or not.
4. Write the relational algebraic queries for the following:
a. Find the names of sailors who have reserved at least one boat
b. Find sids of sailors who have reserved both RED and GREEN boats (use set
operations)
c. Find the name of the oldest sailor.