2024-2025 Dbms External Paper
2024-2025 Dbms External Paper
UGC AUTONOMOUS
II–B.Tech.–III–Semester
2. Create a table EMPLOYEE with following schema: (Emp_no, E_name, E_address, E_ph_no, Dept_no,
Dept_name, Job_id, Salary)
Write SQL queries for following question:
a. Insert a least 5 rows in the table.
b. Display all the information of EMP table.
c. Update the city of Emp_no-12 with current city as Nagpur.
d. List out different SQL commands? Write their basic structure
3. Create a table EMPLOYEE with following schema: (Emp_no, E_name, E_address, E_ph_no, Dept_no,
Dept_name, Job_id, Salary)
Write SQL queries for following question:
a. Display the details of Employee who works in department MECH.
b. Delete the email_id of employee James.
c. Display the complete record of employees working in SALES Department.
d.State the difference between primay key,unique key,not null with an example
a. Insert the any three records in the employee table. Check the result.
b. Add primary key constraint and not null constraint to the employee table.
c. Insert null values to the employee table and verify the result.
d. Explain the following terms with examples i) Derived attribute ii) Composite attribute iii)Strong Entity
7. Create a table sailor, reserves, boats:
a. Find the names of sailors who have reserved both a red and a green boat. (Intersect)
b. Find the names of sailors who have reserved both a red and a green boat. (union all)
c. Find the names of sailors who have reserved boat 103. (Exists)
d. Explain about different Aggregate functions with an example?
d. Find the average age of sailors for each rating level that has at least two sailors? (group by and Having)
e. What is Normalization? Explain about 1NF and 2NF with an example?
9. Create a table customer and order table:
a. Find the names of sailors who have reserved red boat. (Nested Query)
b. Find the names of sailors who have reserved boat number 103. (correlated Nested Query)
c. Find the name and age of the oldest sailor?
d. Write the differences between count () and count (*) with examples?
e. Write the differences between Drop and Delete with examples?
11. Create a table sailor, reserves, boats:
a. Find sailors whose rating is better than some sailor called Horatio. (Any)
b. Find the sailors with the highest rating. (All)
c. Find the names of sailors who have reserved a red and a green boat. (Union)
d. Write about delete, truncate,drop commands with syntax?
e. Compare between primary key and unique key
12. a. Write a PL/SQL code for creation of Trigger to insert data into a table.
b. Write a PL/SQL code for creation of trigger to update data into a table
c. Write a PL/SQL code for creation of trigger to delete data from a table
d. Explain the following terms with examples i) Derived attribute ii) Composite attribute iii)Strong Entity
13. a. Write a PL/SQL code for creation of procedure to view some specified columns from a
table.
b. Write a PL/SQL code for modification of a procedure on specified columns from a table.
c. Write the differences between primary key and unique key with examples?
d. List out the types of Notations used in ER-Diagram
14. a.Write a PL/SQL program that uses cursor operation on any data base.
b. Write a PL/SQL program for displaying multiplication of any number
c. Write a PL/SQL code for creation of trigger to delete data from a table
d. Explain the following terms with examples i) Derived attribute ii) Composite attribute iii)Weak Entity
15. a. Write a PL/SQL code for modification of procedure to view some specified columns from a table.
b. Write a PL/SQL program for displaying multiplication of any number
c. Write a PL/SQL code for creation of Trigger to update data into a table.
d. Explain the following terms with examples i) Multivalued attribute ii) Composite attribute iii)Strong
Entity
16. a) Write a PL/SQL code for creation of procedure to view some specified columns from a table.
b) Write a PL/SQL program for displaying factorial of any number.
c. Write a PL/SQL code for creation of Trigger to insert data into a table.
d. Explain the following terms with examples i) Derived attribute ii) Composite attribute iii)Strong Entity
17. Converting ER Model to Relational Model (Represent entities and relationships in Tabular form, represent
attributes as columns, identifying keys)
a. Write the differences between count () and count (*) with examples?
b. Write the differences between Drop and Delete with examples?
Students(sid: string, name: string, login: string, age: integer, gpa: real)
Faculty(fid: string, fname: string, sal: real)
Courses(cid: string, cname: string, credits: integer)
a. write a sql query to drop a column in students table.
b. Write a query to rename table students to STUDENT
c. Write a query to insert three rows in each table.
d. Write about delete, truncate,drop commands with syntax?
e. Differrence between primary key and unique key
19.
a)Difference between primary key , unique key, Not Null with an example?
20. Create a table called EMP with the following structure.
Name Type
---------- ----------------------
EMPNO NUMBER(6)
ENAME VARCHAR2(20)
JOB VARCHAR2(10)
DEPTNO NUMBER(3)
SAL NUMBER(7,2)
Create Dept table with the following structure.
Name Type
--------- --- ---------------------
DEPTNO NUMBER(2)
DNAME VARCHAR2(10)
LOC VARCHAR2(10)
i) Insert into a single record in dept table
ii)Display specify columns in emp table
iii) Delete only the data working as Lecturer
iv) List the records in emp table by salary in ascending order.
v) Update the emp table to set salary of all employees to RS.14000 who are working as
Manager.
vi) Write the differences between count() and count(*) with examples
Name Type
--------- --- ---------------------
DEPTNO NUMBER(2)
DNAME VARCHAR2(10)
LOC VARCHAR2(10)
i) Add a column experience to the emp table.
ii) Modify the column width of the job field of emp table.
iii) create the emp1 table with ename and empno, add constraints to check the empno
value while entering (i.e) empno > 100
iv) Drop any column in the emp table.
v) Rename any column in dept table.
vi) List out different SQL commands? Write their basic structure
22. Concept design with E-R Model Consider the following information about a university database:
Professors have an SSN, a name, an age, a rank, and a research specialty.
Projects have a project number, a sponsor name (e.g., NSF), a starting date, an ending date, and a budget.
Graduate students have an SSN, a name, an age, and a degree program (e.g., M.S. or Ph.D.).
Each project is managed by one professor (known as the project’s principal investigator).
Each project is worked on by one or more professors (known as the project’s co-investigators).
Professors can manage and/or work on multiple projects.
Each project is worked on by one or more graduate students (known as the
project’s research assistants).
When graduate students work on a project, a professor must supervise their work on the project. Graduate
students can work on multiple projects, in which case
they will have a (potentially different) supervisor for each one.
Departments have a department number, a department name, and a main office.
Departments have a professor (known as the chairman) who runs the department.
Professors work in one or more departments, and for each department that they
work in, a time percentage is associated with their job.
Graduate students have one major department in which they are working on their
degree.
Each graduate student has another, more senior graduate student (known as a
student advisor) who advises him or her on what courses to take.
i).Write about delete, truncate,drop commands with syntax ii)Differrence between primary key and unique key
23. a) Analyze the problem carefully and come up with the attributes of given entities and relationships.
Identify the primary keys for all the entities. Identify the other keys like candidate keys, partial keys, if any.
24. Create an Employee table with the following data, insert 10 records & display?
Tablename: EMPLOYEE123
Job Varchar2(10)
address Varchar2(35)
Salary Number(10,2)
DOJ Date
25. Create a MERCHANT table with the following data and perform the below Operations?
Tablename: MERCHANT100
Attributes Datatype Constraint
type
Mer_id Varchar2(10)
Name Varchar2(15) Unique
age Integer
budget Number(12,2) Check
>=100000
a. Add a New column “Address” with data type “Varchar2 (15)” to the existing table.
b. Modify the size of “Address” to “varchar2 (35)”.
c. Drop a column “age” from the table.
d. Add “Primary key” constraint for the “Mer-Id” Attribute.
e. Insert 5 records & display them.
f. List out different SQL commands? Write their basic structure