0% found this document useful (0 votes)
2 views7 pages

CS3481 SET 2 Split Up (1)

The document outlines various tasks related to database management, including creating and manipulating tables for a library, employee, movie, college, bank, account, customer, and supplier databases. It includes SQL queries, procedures, views, and triggers for operations such as retrieving data, updating records, and managing privileges. Each section has an aim and grading criteria for SQL query execution, procedures, and viva-voce assessments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

CS3481 SET 2 Split Up (1)

The document outlines various tasks related to database management, including creating and manipulating tables for a library, employee, movie, college, bank, account, customer, and supplier databases. It includes SQL queries, procedures, views, and triggers for operations such as retrieving data, updating records, and managing privileges. Each section has an aim and grading criteria for SQL query execution, procedures, and viva-voce assessments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Consider the following schema for a Library Database:

BOOK (Book_id, Title, Publisher_Name, Pub_Year,


No_of_copies) BOOK_AUTHORS (Book_id, Author_Name)
PUBLISHER (Name, Address, Phone)

a) Retrieve details of all books in the Book_id, title, name of publisher, authors
b) Get the particulars of borrowers who have borrowed more than 3 books, but from Jan
2017 to Jun2017.
c) Delete a book in BOOK table. Update the contents of other tables to reflect this data
Manipulation operations.

d) Create a view of all books and its number of copies that are currently available in the
Library.
e) Write a Pl/SQL procedure to display the book details of particular author.
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER

Create a table employee (S.No,Name,Desination,brach),


a) Alter the table by adding a column salary
b) Copy the table employee as Emp
c) Delete 2nd row from the table
d) Drop the table
e) Demonstrate the triggers for automatic updation.
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER


Create a table called Employee (Emp_no Emp_name, Emp_dept,Job ,Mgr ,Sal)
a) By using the group by clause, display the Emp_name who belongs
to Emp_dept=”xxx” along with salary
b) Display lowest paid employee details under each department
c) List the employee names in descending order.
d) Rename the column of Employee table using alter command
e) Insert row in employee table using Triggers.

Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER

Consider the following tables namely “DEPARTMENTS” and “EMPLOYEES”


Departments (dept_no , dept_ name , dept_location ),
Employees ( emp_id , emp_name , emp_salary,dept_no).

a) Develop a query to grant some privileges of employees table into departments table
b) Develop a query to revoke all privileges of employees table from departments table
c) Develop a query to revoke some privileges of employees table from departments table
d) Write a query to implement the save point.
e) Demonstrate the user defined procedure for the above employee database

Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER


Create the following tables,
Event (eventid, name, description,city)
Participant (playerid, name, eventid, gender,
year) Prizes (prizeid, prize-money, eventid,
rank,year) Winners (prizeid, playerid)
a) Choose appropriate primary keys and foreign keys for the tables.
b) Playerid should contain at least one digit character.
c) Retrieve the name of events where all prize winners are females
d) Create a non-updatable view to retrieve the names of all participants who won 1st prizes
along with their event names
e) Write a trigger to make sure that for every new event created, 3 prizes are created in
prizes table. (1st prize - 1500, 2nd - 1000, 3rd 500)
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER

Consider the schema for Movie Database:


ACTOR (Act_id, Act_Name, Act_Gender)
DIRECTOR (Dir_id, Dir_Name,
Dir_Phone)
MOVIES (Mov_id, Mov_Title, Mov_Year, Mov_Lang,
Dir_id) MOVIE_CAST (Act_id, Mov_id, Role)
a) List the titles of all movies directed by ‘XXXX’.
b) Find the movie names where one or more actors acted in two or more movies.
c) List all actors who acted in a movie before 2010 and also in a movie after 2015 (use JOIN
operation).
d) Create a view of movies with a particular actor with director.
e) Demonstrate the User defined function for the movie database.
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100
INTERNAL EXAMINER EXTERNAL EXAMINER
Consider the schema for College Database:
STUDENT (RegNo, StudName, Address, Phone,
Gender) SUBJECT (Subcode, Title, Sem, Credits)
MARKS (RegNo, Subcode, Test1, Test2, Test3, Finalmark)
a) Compute the total number of male and female students in each semester and in each
section.
b) Calculate the Finalmark (average of best two test marks) and update the corresponding
table for all students.
c) Categorize students based on the following
criterion: If Finalmark = 81 to 100 then CAT
= ‘Outstanding’ If Finalmark = 51 to 80 then
CAT = ‘Average’
If Finalmark < 51 then CAT = ‘Weak
d) Create a view of Test3 marks of particular student in all subjects.
e) Demonstrate the procedure for the above Database.
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER

Create table as Bank ( S.No,Cust_Name, Acc_No, Balance, Branch),

a) Select with where clause.


b) Select with comparison operator.
c) Update the balance in the second row.
d) Select with between in the field balance.
e) Write a trigger when balance is below 1000.
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER


Create a table Account (Account_No, Cust_Name, Branch_Name, Account_Balance,
Account_Type) Select an appropriate primary key.

a) Display the Cust_Name and Account_No of the customers of "Branch = XXXXX".


b) Display the names and account types of all the customers whose account balance is more than
10,000.
c) Add column Cust_Date_of Birth in the ACCOUNT table.
d) Display Account_No, Cust_Name and Branch of all the customers whose account balance is less
than 1,000.
e) Write a procedure for the above Database.
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER

Create the tables CUSTOMER (C_ID, Name, Address, City, Mobile_No) and
ORDER (C_ID, P_ID, P_Name, P_COST),

a) List the names and addresses of all the customers who have ordered products of
costmore than 500.
b) List the names of all the products ordered whose cost is 1,000 or more.
c) List the product names which are ordered by customers of "City = Delhi".
d) Add column "Email_id" in the CUSTOMER table.
e) Demonstrate the user defined function for the above tables.

Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER


Create an XML database for the student profile and validate it using XML schema.
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER

Create a Employee database and write SQL Triggers for insert, delete, and update operations in
a database table.
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER

Create a table Supplier (Sup_No, Sup_Name ,Item_Supplied , Item_Price , City)

a) Write sql query to display Suplier numbers and Supplier names whose name starts with ‘S’
b) Write sql query to add a new column called CONTACTNO.
c) Write sql query to display supplier numbers, Suplier names and item price for suppliers in
Chennai in the ascending order of item price.
d) Create a view on the table which displays only supplier numbers and supplier names.
e) Demonstrate the procedure for the supplier table.
Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

INTERNAL EXAMINER EXTERNAL EXAMINER

You might also like