The document outlines an external practical examination for the Department of MCA at Dhanalakshmi Srinivasan University. It includes a schema for a Library Database and specifies five SQL queries to be written: retrieving book details, borrower particulars, deleting a book, partitioning the BOOK table, and creating a view of available books. The document is structured for students to demonstrate their understanding of SQL in relation to the library database.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
10 views26 pages
DPMS QP
The document outlines an external practical examination for the Department of MCA at Dhanalakshmi Srinivasan University. It includes a schema for a Library Database and specifies five SQL queries to be written: retrieving book details, borrower particulars, deleting a book, partitioning the BOOK table, and creating a view of available books. The document is structured for students to demonstrate their understanding of SQL in relation to the library database.
Consider the following schema for a Library Database:
BOOK(Book_id, Title, Publisher_Name, Pub_Year) BOOK_AUTHORS(Book_id, Author_Name) PUBLISHER(Name, Address, Phone) BOOK_COPIES(Book_id, Programme_id, No-of_Copies) BOOK_LENDING(Book_id, Programme_id, Card_No, Date_Out, Due_Date) LIBRARY_PROGRAMME(Programme_id, Programme_Name, Address) Write SQL queries to 1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library. DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
Consider the following schema for a Library Database:
BOOK(Book_id, Title, Publisher_Name, Pub_Year) BOOK_AUTHORS(Book_id, Author_Name) PUBLISHER(Name, Address, Phone) BOOK_COPIES(Book_id, Programme_id, No-of_Copies) BOOK_LENDING(Book_id, Programme_id, Card_No, Date_Out, Due_Date) LIBRARY_PROGRAMME(Programme_id, Programme_Name, Address) Write SQL queries to 1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
Consider the following schema for a Library Database:
BOOK(Book_id, Title, Publisher_Name, Pub_Year) BOOK_AUTHORS(Book_id, Author_Name) PUBLISHER(Name, Address, Phone) BOOK_COPIES(Book_id, Programme_id, No-of_Copies) BOOK_LENDING(Book_id, Programme_id, Card_No, Date_Out, Due_Date) LIBRARY_PROGRAMME(Programme_id, Programme_Name, Address) Write SQL queries to 1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
Consider the following schema for a Library Database:
BOOK(Book_id, Title, Publisher_Name, Pub_Year) BOOK_AUTHORS(Book_id, Author_Name) PUBLISHER(Name, Address, Phone) BOOK_COPIES(Book_id, Programme_id, No-of_Copies) BOOK_LENDING(Book_id, Programme_id, Card_No, Date_Out, Due_Date) LIBRARY_PROGRAMME(Programme_id, Programme_Name, Address) Write SQL queries to 1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
Consider the following schema for a Library Database:
BOOK(Book_id, Title, Publisher_Name, Pub_Year) BOOK_AUTHORS(Book_id, Author_Name) PUBLISHER(Name, Address, Phone) BOOK_COPIES(Book_id, Programme_id, No-of_Copies) BOOK_LENDING(Book_id, Programme_id, Card_No, Date_Out, Due_Date) LIBRARY_PROGRAMME(Programme_id, Programme_Name, Address) Write SQL queries to 1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
Consider the following schema for a Library Database:
BOOK(Book_id, Title, Publisher_Name, Pub_Year) BOOK_AUTHORS(Book_id, Author_Name) PUBLISHER(Name, Address, Phone) BOOK_COPIES(Book_id, Programme_id, No-of_Copies) BOOK_LENDING(Book_id, Programme_id, Card_No, Date_Out, Due_Date) LIBRARY_PROGRAMME(Programme_id, Programme_Name, Address) Write SQL queries to 1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
Consider the following schema for a Library Database:
BOOK(Book_id, Title, Publisher_Name, Pub_Year) BOOK_AUTHORS(Book_id, Author_Name) PUBLISHER(Name, Address, Phone) BOOK_COPIES(Book_id, Programme_id, No-of_Copies) BOOK_LENDING(Book_id, Programme_id, Card_No, Date_Out, Due_Date) LIBRARY_PROGRAMME(Programme_id, Programme_Name, Address) Write SQL queries to 1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. Retrieve details of all books in the library – id, title, name of publisher, authors, number of copies in each Programme, etc. 2. Get the particulars of borrowers who have borrowed more than 3 books, but from Jan 2017 to Jun 2017. 3. Delete a book in BOOK table. Update the contents of other tables to reflect this data manipulation operation. 4. Partition the BOOK table based on year of publication. Demonstrate its working with a simple query. 5. Create a view of all books and its number of copies that are currently available in the Library.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
SALESMAN(Salesman_id, Name, City, Commission) CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id) ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id) Write SQL queries to 1. Count the customers with grades above Bangalore’s average. 2. Find the name and numbers of all salesman who had more than one customer. 3. List all the salesman and indicate those who have and do not have customers in their cities (Use UNION operation.) 4. Create a view that finds the salesman who has the customer with the highest order of a day. 5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also be deleted
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION Z REGISTER NO. : ___________________ DATE : _____________ SEMESTER : ___________________ SECTION: ______________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5 DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EX AMINATION
REGISTER NO. : ___________________ DATE : _____________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5 DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5 DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
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) RATING(Mov_id, Rev_Stars) Write SQL queries to 1. List the titles of all movies directed by ‘Hitchcock’. 2. Find the movie names where one or more actors acted in two or more movies. 3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use JOIN operation). 4. Find the title of movies and number of stars for each movie that has at least one rating and find the highest number of stars that movie received. Sort the result by movie title. 5. Update rating of all movies directed by ‘Steven Spielberg’ to 5 DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students. DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students. DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students. DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students. DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students. DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students. DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students.
DHANALAKSHMI SRINIVASAN UNIVERSITY, TRICHY
SCHOOL OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA EXTERNAL PRACTICAL EXAMINATION
REGISTER NO. : ___________________ DATE : _____________
1. List all the student details studying in fourth semester ‘C’ section. 2. Compute the total number of male and female students in each semester and in each section. 3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all Courses. 4. Calculate the FinalIA (average of best two test marks) and update the corresponding table for all students. 5. Categorize students based on the following criterion: If FinalIA = 17 to 20 then CAT = ‘Outstanding’ If FinalIA = 12 to 16 then CAT = ‘Average’ If FinalIA< 12 then CAT = ‘Weak’ Give these details only for 8th semester A, B, and C section students.