This document is a laboratory manual for a database management systems course covering 5 exercises on modeling relational databases and writing SQL queries. It provides instructions to students on completing the exercises in an RDBMS environment and creating a front-end interface. The exercises involve designing tables, entering sample data, and writing queries over schemas for student records, airline data, books, banking information and more. Students are directed to properly define primary and foreign keys and write queries to return requested information from the different schemas.
Competition Gurukul is the brain Child of IIT Delhi & NSIT Aluminums to help the Students for preparing the competitive exams in the innovation way by classroom coaching & online Mode.
www.competitiongurukul.in
Call: 9015596280, 9313565406
This document contains information about a database management systems practical file submitted by Sachin for their fourth semester computer science course. It includes an index of experiments completed and sections covering database languages like DDL, DML, and DCL. It also discusses topics like data types in SQL, set operations, joins, query processing, and constraints.
The presentation focus on details regarding how distributed database work. Its issues and methodologies. Basic techniques on how to design distributed systems.
This document provides guidelines for conducting practical exercises for an Advanced Database Management Systems course. It includes 11 exercises covering concepts like SQL statements, functions, normalization, joins, views, and PL/SQL programming. Students are expected to complete the exercises over 12 sessions in 7 days under faculty guidance. Exercises are assessed and students must score a minimum of 40% combined on guided and unguided assessments to pass. The document outlines software and hardware requirements and provides instructions for completing the exercises and documenting the work.
The document discusses distributed database management systems. It begins by covering the evolution of distributed databases from centralized systems in the 1970s to more decentralized structures in the 1980s and 1990s driven by new technologies. The rest of the document covers key topics in distributed databases including definitions, architectures, data fragmentation techniques, distributed transparency, and considerations for distributed database design such as allocation of fragments.
This document describes an online reservation system created by Rakesh Kunwar for railway ticket reservations and cancellations. It allows passengers to reserve and cancel seats on trains through a computerized system, which is more efficient than handling the vast Indian railway system manually. The system securely stores train, passenger, and reservation information and generates tickets and reports.
The document provides information about a database management systems practical file submitted by a student. It includes an index listing 7 experiments conducted, including introductions to Oracle, SQL data types, commands, performance, permissions, joins, constraints, and functions. It then provides details on each of the listed topics, giving overviews and examples of key concepts like data definition language, data manipulation language, data control language, SQL data types, transaction statements, SQL commands like select, create table, alter table, and more.
Competition Gurukul is the brain Child of IIT Delhi & NSIT Aluminums to help the Students for preparing the competitive exams in the innovation way by classroom coaching & online Mode.
www.competitiongurukul.in
Call: 9015596280, 9313565406
This document contains information about a database management systems practical file submitted by Sachin for their fourth semester computer science course. It includes an index of experiments completed and sections covering database languages like DDL, DML, and DCL. It also discusses topics like data types in SQL, set operations, joins, query processing, and constraints.
The presentation focus on details regarding how distributed database work. Its issues and methodologies. Basic techniques on how to design distributed systems.
This document provides guidelines for conducting practical exercises for an Advanced Database Management Systems course. It includes 11 exercises covering concepts like SQL statements, functions, normalization, joins, views, and PL/SQL programming. Students are expected to complete the exercises over 12 sessions in 7 days under faculty guidance. Exercises are assessed and students must score a minimum of 40% combined on guided and unguided assessments to pass. The document outlines software and hardware requirements and provides instructions for completing the exercises and documenting the work.
The document discusses distributed database management systems. It begins by covering the evolution of distributed databases from centralized systems in the 1970s to more decentralized structures in the 1980s and 1990s driven by new technologies. The rest of the document covers key topics in distributed databases including definitions, architectures, data fragmentation techniques, distributed transparency, and considerations for distributed database design such as allocation of fragments.
This document describes an online reservation system created by Rakesh Kunwar for railway ticket reservations and cancellations. It allows passengers to reserve and cancel seats on trains through a computerized system, which is more efficient than handling the vast Indian railway system manually. The system securely stores train, passenger, and reservation information and generates tickets and reports.
The document provides information about a database management systems practical file submitted by a student. It includes an index listing 7 experiments conducted, including introductions to Oracle, SQL data types, commands, performance, permissions, joins, constraints, and functions. It then provides details on each of the listed topics, giving overviews and examples of key concepts like data definition language, data manipulation language, data control language, SQL data types, transaction statements, SQL commands like select, create table, alter table, and more.
This document describes a micro project to create a simple Oracle database to store course enrollment data for a university. It involves designing tables to model student, class, enrollment and other data; populating the tables with sample data; writing SQL queries to retrieve and analyze the data; and creating PL/SQL functions and procedures to generate reports on departments, students, and faculty. Key tasks include creating tables with primary keys and foreign keys, inserting records, writing queries to retrieve aggregated data on departments and their faculty/students, creating views to display related data, and procedures to output formatted reports.
Excel analysis assignment this is an independent assignment mejoney4
This document provides an Excel list of courses for the summer 2018 term including subject, course number, title, campus, schedule type, dates, times, locations, and other details. It shows accounting and business administration courses at the undergraduate level. The data could be used to analyze course enrollment trends, popularity of classes by concentration, and ratios of online versus on-campus courses.
1. The document contains SQL queries to perform operations on student and course tables like creating tables, inserting data, updating records, joining tables, aggregating data, and more.
2. Basic queries include creating the tables, inserting sample data, adding columns, applying constraints, updating records, deleting records, and selecting records based on conditions.
3. More advanced queries demonstrate using joins, aggregation, sorting, subqueries and other SQL features to retrieve and manipulate the data in various ways.
The document discusses database concepts including relational calculus queries, normalization, indexing, and hashing. It provides several examples and asks questions about normalizing relations to higher normal forms, designing indexes to optimize queries, calculating record sizes, and illustrating extendable hashing structures.
This document provides instructions for Project 3 of the CS348 course. Students will create PL/SQL functions and procedures to process data stored in Oracle database tables. The project involves setting up database tables, populating them with data, and creating 5 procedures to generate reports from the data. The procedures include generating department reports, student statistics, faculty statistics with histogram binning, and an enrollment report. Detailed descriptions and sample outputs are provided for each procedure.
This document provides instructions for completing Project 2 of the CS348 database course. Students are asked to:
1. Create five Oracle database tables based on a given schema using the CREATE statement.
2. Populate the tables with sample data using a provided data.sql file.
3. Write seven SQL queries to answer questions about the data, such as finding the faculty teaching the most classes or students enrolled in the most classes taught by a specific department.
This document provides instructions for a SQL query assignment. It includes:
1) The database schema containing university data across six relations for students, departments, professors, courses, majors, and enrollments.
2) Eleven queries to run on the database covering topics like professor departments, student GPAs, class averages, enrollments, student course loads, department majors, and student course combinations.
3) Questions about whether two SQL queries are always equivalent, providing examples if not.
4) A task to write a SQL query to find the cheapest flight costs between city pairs regardless of stops using SQL with a programming language.
SECTION D2)Display the item number and total cost for each order l.docxkenjordan97598
SECTION D
2)Display the item number and total cost for each order line (total cost = no of items X item cost). Name the calculated column TOTAL COST.
Answer:
SELECT item_number, no_of_items * item_cost “TOTAL COST”
FROM ORDER_LINE
4)Display the order number and client number from the ORDER table. Output the result in the format. Client <clientno> ordered <orderno>
Answer:
SELECT ‘Client ‘+ clientno+’ordered ‘+ orderno AS result
FROM ORDER
6)Display the client name and order date for all orders using the traditional method.
Answer:
SELECT name, order_date
FROM
CLIENT c INNER JOIN ORDER o
ON (c.clientno = o.clientno);
7)Repeat query (7) but also display all clients who have never ordered anything.
Answer:
SELECT name, order_date
FROM
CLIENT c LEFT OUTER JOIN ORDER o
ON (c.clientno = o.clientno);
8) Display the client name and order date for all orders using the natural join keywords.
SELECT name, order_date
FROM
CLIENT NATURAL JOIN ORDER;
9) Display the client name and order date for all orders using the JOIN . . . USING method.
SELECT name, order_date
FROM CLIENT c JOIN ORDER o
USING (clientno);
10) Display the client number, order date and shipping date for all orders where the shipping date is between three and six months after the order date.
SELECT clientno, order_date, shipping_date
FROM
CLIENT c,
ORDER o,
ORDER_LINE ol
WHERE c.clientno = o.clientno
AND o.orderno = ol.orderno
AND shipping_date BETWEEN ADD_MONTHS(shipping_date,3) AND ADD_MONTHS(shipping_date,6);
16) Display the order number, order line number and the shipping date. If the shipping date is null, display the string <not shipped yet>.
SELECT orderno, order_line_number, NVL(shipping_date,’<not shipped yet>’)
FROM ORDER_LINE
18)Display the clientno and total value for all orders placed by that client. Output the result in the following format: Client <clientno> has placed orders to the value of <total value>
SELECT ‘Client ‘+clientno+’ has placed order to the value of ‘+ SUM(no_of_items*item_cost)
FROM ORDER_LINE
GROUP BY clientno
19) Display all clients whose name begins with the letter J or contains the letter M anywhere or contains E as the third letter.
SELECT *
FROM CLIENT
WHERE UPPER(name) LIKE ‘J%’
OR upper(name) LIKE ‘%M%’
OR
Upper(name) LIKE ‘??E%’
20)Using a set operator, display the client number of all clients who have never placed an order.
Answer:
SELECT clientno
FROM CLIENT
MINUS
SELECT clientno
FROM ORDER
21)Using a set operator, display the client number of all clients who have ever placed an order and whose name does not contain the string Sm.
SELECT clientno
FROM CLIENT
WHERE INSTR(name,’Sm’) = 0
INTERSECT
SELECT clientno
FROM
ORDER
23)Display the client name for all clients who have placed an order where any order line has more than 3 items. Do not use a table join anywhere in your query.
SELECT name
FROM CLIENT c,
ORDER o,
ORDER_LINE ol
WHERE c.clientno = o.clientno
AND o.orderno = ol.orderno
AND ol.no_of_items> 3
26)Display the earli.
RANDOM TESTS COMBINING MATHEMATICA PACKAGE AND LATEX COMPILERijseajournal
This paper presents a competent and useful way to elaborate random exams by using Mathematica and
LATEX. With these two tools, the authors suggest how to generate, in an easy way, different PDF
documents containing different models of exams. The main idea is to provide a support to professors who
have to manage groups of large number of students that should take different exams along the term, or even
though not being groups of numerous students, it may be useful when different models of exams want to be
provided to the students. The underlying advantage in this paper is the use of the Mathematica package for
this purpose in a simple way, similarly as it has been done with alternative software. We present in this
paper, some models of exams produced in the context in which the authors work.
This document is a lab manual for the Compiler Design lab course at Swami Keshvanand Institute of Technology Management & Gramothan. It provides an overview of the course, including the list of experiments, lab instructions, assessment criteria, and details of each experiment. The experiments cover topics such as lexical analysis using Lex, syntax analysis using Yacc, symbol tables, and parsing context-free grammars. Background information on C language tokens and lexical elements is also presented to introduce students to the concepts covered in the course.
This document contains questions for a database engineering examination. It includes questions about data definition language commands, differences between file processing systems and database systems, weak entity sets, cardinality, foreign keys, hashing techniques, lock types, differences between object-oriented and object-relational databases, rollup, entity-relationship modeling, converting models, B+ tree operations, relational algebra queries, relational calculus queries, SQL queries, and more. Students are asked to answer one compulsory question with multiple parts, and five questions from the remaining list.
This document contains instructions for a computer programming lab assignment involving structures in C programming. It lists 5 programs to complete:
1. Define a cricket player structure and read information for 10 players into an array, printing a team-wise list of names and runs.
2. Define a person structure and read data for 10 people, printing details for those over 50kg and 40cm tall.
3. Write functions to display and calculate salary bonus for an employee structure containing name, designation, nested address, and salary.
4. Write a menu to read and count C keywords from the user, storing them in a structure array.
5. Define a symbol table structure to store constants of different types
Some important SQL queries and solutions are provided here.
Create, Update, Insertion, Deletion of Database.
Create table, Find, join, natural join, maximum, minimum, minus, grouping etc.
The document reviews database concepts like fields, attributes, data types, primary keys and validation rules. It provides examples of designing databases to store student information and sales data. It also discusses database objects like tables, queries, forms and reports. Entity-relationship diagrams are explained as a way to model relationships between entities like one-to-one, one-to-many and many-to-many. Examples are given of modeling relationships for students, forms, employees, projects and more.
Case Analysis Format 1. Title of Case a. Author of t.docxcowinhelen
Case Analysis Format
1. Title of Case
a. Author of the written case
b. Your name
c. Date
2. Executive Summary (5-6 sentences. Summarize situation. What is the name of the
company, what do they do? What is the problem definition? What are your
recommendations?
3. Introduction (Describe the company)
4. Background (Give the historical event review. Only use relevant events. Explain why
these are relevant to the case analysis.)
5. Problem Definition (2-3 sentences)
6. Top Management Team (Give degrees, universities, majors, prior work experience,
awards, titles, basically describe the credentials of these people.)
7. Competitors (List the competitors and define how they compete with the company being
analyzed. What products, services, ranking in industry…are competing?)
8. Discussion
a. Analysis (Use only those parts of these tools that are relevant to the case.).
Provide your own interpretation to the results of analysis from each tool.
i. SWOT
ii. PESTEL
iii. Porters 5 Forces
iv. Porters Diamond
v. VRIO
vi. Financials / Ratios (Always compare something to something relevant,
such as competitors or years. Explain why you choose to compare against
which companies over which years. Add your interpretation of the
compared numbers. This tool can be the most revealing and should be
used in most every case.)
vii. Others
9. Action Taken by Firm
10. Results of Overall Analysis and Interpretation of Results
11. Recommendations
a. How much will your recommendations impact the firm?
b. Are they feasible?
c. Which recommendations did firm follow?
12. Conclusion
Comments:
Critical Thinking is a very important skill in business. Critical thinking involves understanding
what key factors are important in a situation, using these factors in an appropriate analysis,
using the results of the analysis to build an argument, then presenting your conclusions and
recommendations based on the analysis results and your argument development. Everything
should flow logically, one stage to the next. Do not put information in the report that does not
relate to the Conclusion.
Managers today have little time for in-depth reading. To get your point across, use formatting to
help you organize your thoughts and allow managers to be selective in what parts of your report
that they read. Start with an Executive Summary that includes a synopsis of the situation,
analysis results, and your recs. Don’t force your reader to read your whole report in order to
understand your ideas. Follow with a concise Introduction, Background, Problem Definition,
Analysis, Results, Discussion, Recommendations, and Conclusion. The key here is to effectively
and efficiently communicate your analysis of the situation. Left justify unless you are an artsy
type and you want a stylish presentation.
BCS204 E Object Orient Programming Midterm
Note: Choose the best answer amo.
Case Analysis Format 1. Title of Case a. Author of t.docxjasoninnes20
Case Analysis Format
1. Title of Case
a. Author of the written case
b. Your name
c. Date
2. Executive Summary (5-6 sentences. Summarize situation. What is the name of the
company, what do they do? What is the problem definition? What are your
recommendations?
3. Introduction (Describe the company)
4. Background (Give the historical event review. Only use relevant events. Explain why
these are relevant to the case analysis.)
5. Problem Definition (2-3 sentences)
6. Top Management Team (Give degrees, universities, majors, prior work experience,
awards, titles, basically describe the credentials of these people.)
7. Competitors (List the competitors and define how they compete with the company being
analyzed. What products, services, ranking in industry…are competing?)
8. Discussion
a. Analysis (Use only those parts of these tools that are relevant to the case.).
Provide your own interpretation to the results of analysis from each tool.
i. SWOT
ii. PESTEL
iii. Porters 5 Forces
iv. Porters Diamond
v. VRIO
vi. Financials / Ratios (Always compare something to something relevant,
such as competitors or years. Explain why you choose to compare against
which companies over which years. Add your interpretation of the
compared numbers. This tool can be the most revealing and should be
used in most every case.)
vii. Others
9. Action Taken by Firm
10. Results of Overall Analysis and Interpretation of Results
11. Recommendations
a. How much will your recommendations impact the firm?
b. Are they feasible?
c. Which recommendations did firm follow?
12. Conclusion
Comments:
Critical Thinking is a very important skill in business. Critical thinking involves understanding
what key factors are important in a situation, using these factors in an appropriate analysis,
using the results of the analysis to build an argument, then presenting your conclusions and
recommendations based on the analysis results and your argument development. Everything
should flow logically, one stage to the next. Do not put information in the report that does not
relate to the Conclusion.
Managers today have little time for in-depth reading. To get your point across, use formatting to
help you organize your thoughts and allow managers to be selective in what parts of your report
that they read. Start with an Executive Summary that includes a synopsis of the situation,
analysis results, and your recs. Don’t force your reader to read your whole report in order to
understand your ideas. Follow with a concise Introduction, Background, Problem Definition,
Analysis, Results, Discussion, Recommendations, and Conclusion. The key here is to effectively
and efficiently communicate your analysis of the situation. Left justify unless you are an artsy
type and you want a stylish presentation.
BCS204 E Object Orient Programming Midterm
Note: Choose the best answer amo ...
CSC388 Online Programming Languages Homework 3 (due b.docxannettsparrow
CSC388 Online Programming Languages
Homework 3
(due by midnight on Sunday, April 30th)
HW3 must be submitted electronically. Your submission must include 2 files:
(a) The source code in R5RS,
(b) 1-2 page comparison of Java and Scheme. Based on the code from HW2 and HW3, write a
short comparison of Java and Scheme using the language evaluation criteria from Chapter 1.
How do they compare in terms readability, simplicity, orthogonality, and writability? For which
applications does Scheme seem better than Java, and for which applications would you prefer
Java over Scheme?
Pack all your files in a zip file. Use the following naming conventions. If your name is John
Smith, then your file name must be jsmith.zip. Homeworks which are not properly named or
packed will receive 0 points.
Write a function two-subsets in Scheme that takes a list L of positive integers (duplicates are
possible, zero is not considered a positive integer) and some auxiliary parameters of your choice.
The function two-subsets returns #t if the list L contains two subsets with equal sums of elements
and with equal numbers of elements. Otherwise (if two subsets satisfying the condition above do
not exist), the function returns #f. Assume that the list L contains at least two integers.
Note the difference from HW2: here, it is not required that the whole list be split into two subsets.
In HW3, some elements of the list could be left out from the two subsets. Therefore, every list,
which is a solution to HW2 is also be a solution to HW3. However, there are solutions to HW3
that are not solutions to HW2.
It is up to you to choose the auxiliary parameters that two-subsets takes. All auxiliary parameters
must be numeric (not lists) and should have initial values set to zero. For example, if L is ‘(1 2 3)
and if you decide to use two additional auxiliary parameters, then two-subsets must be called as
follows:
(two-subsets '(1 2 3) 0 0)
If there are three auxiliary parameters, then the function must be called:
(two-subsets '(1 2 3) 0 0 0) and so on.
Note that the function must be called two-subsets. Other names will not be accepted. The list must
precede the auxiliary parameters, which are initially set to zeroes.
There is no need to optimize your code. Try to come up with a working solution.
Examples (for the sake of illustration, two auxiliary parameters are used):
(two-subsets '(7 7) 0 0) returns #t. The two subsets are {7} and {7}.
(two-subsets '(7 7 1) 0 0) returns #t. The two subsets are {7} and {7}.
(two-subsets '(5 3 2 4) 0 0) returns #t. The two subsets are {2, 5} and {3, 4}.
(two-subsets '(5 3 21 2 4) 0 0) returns #t. The two subsets are {2, 5} and {3, 4}.
(two-subsets '(2 13 7 5 16 11) 0 0) returns #t. The two subsets are {7, 11} and
{5, 13}.
(two-subsets '(1 2 3 6 9) 0 0) returns #f.
(two-subsets '(10 4 7 102 36 6 17 54) 0 0) returns #f.
The whole solution must be packed in one recursive functio.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
This document describes a micro project to create a simple Oracle database to store course enrollment data for a university. It involves designing tables to model student, class, enrollment and other data; populating the tables with sample data; writing SQL queries to retrieve and analyze the data; and creating PL/SQL functions and procedures to generate reports on departments, students, and faculty. Key tasks include creating tables with primary keys and foreign keys, inserting records, writing queries to retrieve aggregated data on departments and their faculty/students, creating views to display related data, and procedures to output formatted reports.
Excel analysis assignment this is an independent assignment mejoney4
This document provides an Excel list of courses for the summer 2018 term including subject, course number, title, campus, schedule type, dates, times, locations, and other details. It shows accounting and business administration courses at the undergraduate level. The data could be used to analyze course enrollment trends, popularity of classes by concentration, and ratios of online versus on-campus courses.
1. The document contains SQL queries to perform operations on student and course tables like creating tables, inserting data, updating records, joining tables, aggregating data, and more.
2. Basic queries include creating the tables, inserting sample data, adding columns, applying constraints, updating records, deleting records, and selecting records based on conditions.
3. More advanced queries demonstrate using joins, aggregation, sorting, subqueries and other SQL features to retrieve and manipulate the data in various ways.
The document discusses database concepts including relational calculus queries, normalization, indexing, and hashing. It provides several examples and asks questions about normalizing relations to higher normal forms, designing indexes to optimize queries, calculating record sizes, and illustrating extendable hashing structures.
This document provides instructions for Project 3 of the CS348 course. Students will create PL/SQL functions and procedures to process data stored in Oracle database tables. The project involves setting up database tables, populating them with data, and creating 5 procedures to generate reports from the data. The procedures include generating department reports, student statistics, faculty statistics with histogram binning, and an enrollment report. Detailed descriptions and sample outputs are provided for each procedure.
This document provides instructions for completing Project 2 of the CS348 database course. Students are asked to:
1. Create five Oracle database tables based on a given schema using the CREATE statement.
2. Populate the tables with sample data using a provided data.sql file.
3. Write seven SQL queries to answer questions about the data, such as finding the faculty teaching the most classes or students enrolled in the most classes taught by a specific department.
This document provides instructions for a SQL query assignment. It includes:
1) The database schema containing university data across six relations for students, departments, professors, courses, majors, and enrollments.
2) Eleven queries to run on the database covering topics like professor departments, student GPAs, class averages, enrollments, student course loads, department majors, and student course combinations.
3) Questions about whether two SQL queries are always equivalent, providing examples if not.
4) A task to write a SQL query to find the cheapest flight costs between city pairs regardless of stops using SQL with a programming language.
SECTION D2)Display the item number and total cost for each order l.docxkenjordan97598
SECTION D
2)Display the item number and total cost for each order line (total cost = no of items X item cost). Name the calculated column TOTAL COST.
Answer:
SELECT item_number, no_of_items * item_cost “TOTAL COST”
FROM ORDER_LINE
4)Display the order number and client number from the ORDER table. Output the result in the format. Client <clientno> ordered <orderno>
Answer:
SELECT ‘Client ‘+ clientno+’ordered ‘+ orderno AS result
FROM ORDER
6)Display the client name and order date for all orders using the traditional method.
Answer:
SELECT name, order_date
FROM
CLIENT c INNER JOIN ORDER o
ON (c.clientno = o.clientno);
7)Repeat query (7) but also display all clients who have never ordered anything.
Answer:
SELECT name, order_date
FROM
CLIENT c LEFT OUTER JOIN ORDER o
ON (c.clientno = o.clientno);
8) Display the client name and order date for all orders using the natural join keywords.
SELECT name, order_date
FROM
CLIENT NATURAL JOIN ORDER;
9) Display the client name and order date for all orders using the JOIN . . . USING method.
SELECT name, order_date
FROM CLIENT c JOIN ORDER o
USING (clientno);
10) Display the client number, order date and shipping date for all orders where the shipping date is between three and six months after the order date.
SELECT clientno, order_date, shipping_date
FROM
CLIENT c,
ORDER o,
ORDER_LINE ol
WHERE c.clientno = o.clientno
AND o.orderno = ol.orderno
AND shipping_date BETWEEN ADD_MONTHS(shipping_date,3) AND ADD_MONTHS(shipping_date,6);
16) Display the order number, order line number and the shipping date. If the shipping date is null, display the string <not shipped yet>.
SELECT orderno, order_line_number, NVL(shipping_date,’<not shipped yet>’)
FROM ORDER_LINE
18)Display the clientno and total value for all orders placed by that client. Output the result in the following format: Client <clientno> has placed orders to the value of <total value>
SELECT ‘Client ‘+clientno+’ has placed order to the value of ‘+ SUM(no_of_items*item_cost)
FROM ORDER_LINE
GROUP BY clientno
19) Display all clients whose name begins with the letter J or contains the letter M anywhere or contains E as the third letter.
SELECT *
FROM CLIENT
WHERE UPPER(name) LIKE ‘J%’
OR upper(name) LIKE ‘%M%’
OR
Upper(name) LIKE ‘??E%’
20)Using a set operator, display the client number of all clients who have never placed an order.
Answer:
SELECT clientno
FROM CLIENT
MINUS
SELECT clientno
FROM ORDER
21)Using a set operator, display the client number of all clients who have ever placed an order and whose name does not contain the string Sm.
SELECT clientno
FROM CLIENT
WHERE INSTR(name,’Sm’) = 0
INTERSECT
SELECT clientno
FROM
ORDER
23)Display the client name for all clients who have placed an order where any order line has more than 3 items. Do not use a table join anywhere in your query.
SELECT name
FROM CLIENT c,
ORDER o,
ORDER_LINE ol
WHERE c.clientno = o.clientno
AND o.orderno = ol.orderno
AND ol.no_of_items> 3
26)Display the earli.
RANDOM TESTS COMBINING MATHEMATICA PACKAGE AND LATEX COMPILERijseajournal
This paper presents a competent and useful way to elaborate random exams by using Mathematica and
LATEX. With these two tools, the authors suggest how to generate, in an easy way, different PDF
documents containing different models of exams. The main idea is to provide a support to professors who
have to manage groups of large number of students that should take different exams along the term, or even
though not being groups of numerous students, it may be useful when different models of exams want to be
provided to the students. The underlying advantage in this paper is the use of the Mathematica package for
this purpose in a simple way, similarly as it has been done with alternative software. We present in this
paper, some models of exams produced in the context in which the authors work.
This document is a lab manual for the Compiler Design lab course at Swami Keshvanand Institute of Technology Management & Gramothan. It provides an overview of the course, including the list of experiments, lab instructions, assessment criteria, and details of each experiment. The experiments cover topics such as lexical analysis using Lex, syntax analysis using Yacc, symbol tables, and parsing context-free grammars. Background information on C language tokens and lexical elements is also presented to introduce students to the concepts covered in the course.
This document contains questions for a database engineering examination. It includes questions about data definition language commands, differences between file processing systems and database systems, weak entity sets, cardinality, foreign keys, hashing techniques, lock types, differences between object-oriented and object-relational databases, rollup, entity-relationship modeling, converting models, B+ tree operations, relational algebra queries, relational calculus queries, SQL queries, and more. Students are asked to answer one compulsory question with multiple parts, and five questions from the remaining list.
This document contains instructions for a computer programming lab assignment involving structures in C programming. It lists 5 programs to complete:
1. Define a cricket player structure and read information for 10 players into an array, printing a team-wise list of names and runs.
2. Define a person structure and read data for 10 people, printing details for those over 50kg and 40cm tall.
3. Write functions to display and calculate salary bonus for an employee structure containing name, designation, nested address, and salary.
4. Write a menu to read and count C keywords from the user, storing them in a structure array.
5. Define a symbol table structure to store constants of different types
Some important SQL queries and solutions are provided here.
Create, Update, Insertion, Deletion of Database.
Create table, Find, join, natural join, maximum, minimum, minus, grouping etc.
The document reviews database concepts like fields, attributes, data types, primary keys and validation rules. It provides examples of designing databases to store student information and sales data. It also discusses database objects like tables, queries, forms and reports. Entity-relationship diagrams are explained as a way to model relationships between entities like one-to-one, one-to-many and many-to-many. Examples are given of modeling relationships for students, forms, employees, projects and more.
Case Analysis Format 1. Title of Case a. Author of t.docxcowinhelen
Case Analysis Format
1. Title of Case
a. Author of the written case
b. Your name
c. Date
2. Executive Summary (5-6 sentences. Summarize situation. What is the name of the
company, what do they do? What is the problem definition? What are your
recommendations?
3. Introduction (Describe the company)
4. Background (Give the historical event review. Only use relevant events. Explain why
these are relevant to the case analysis.)
5. Problem Definition (2-3 sentences)
6. Top Management Team (Give degrees, universities, majors, prior work experience,
awards, titles, basically describe the credentials of these people.)
7. Competitors (List the competitors and define how they compete with the company being
analyzed. What products, services, ranking in industry…are competing?)
8. Discussion
a. Analysis (Use only those parts of these tools that are relevant to the case.).
Provide your own interpretation to the results of analysis from each tool.
i. SWOT
ii. PESTEL
iii. Porters 5 Forces
iv. Porters Diamond
v. VRIO
vi. Financials / Ratios (Always compare something to something relevant,
such as competitors or years. Explain why you choose to compare against
which companies over which years. Add your interpretation of the
compared numbers. This tool can be the most revealing and should be
used in most every case.)
vii. Others
9. Action Taken by Firm
10. Results of Overall Analysis and Interpretation of Results
11. Recommendations
a. How much will your recommendations impact the firm?
b. Are they feasible?
c. Which recommendations did firm follow?
12. Conclusion
Comments:
Critical Thinking is a very important skill in business. Critical thinking involves understanding
what key factors are important in a situation, using these factors in an appropriate analysis,
using the results of the analysis to build an argument, then presenting your conclusions and
recommendations based on the analysis results and your argument development. Everything
should flow logically, one stage to the next. Do not put information in the report that does not
relate to the Conclusion.
Managers today have little time for in-depth reading. To get your point across, use formatting to
help you organize your thoughts and allow managers to be selective in what parts of your report
that they read. Start with an Executive Summary that includes a synopsis of the situation,
analysis results, and your recs. Don’t force your reader to read your whole report in order to
understand your ideas. Follow with a concise Introduction, Background, Problem Definition,
Analysis, Results, Discussion, Recommendations, and Conclusion. The key here is to effectively
and efficiently communicate your analysis of the situation. Left justify unless you are an artsy
type and you want a stylish presentation.
BCS204 E Object Orient Programming Midterm
Note: Choose the best answer amo.
Case Analysis Format 1. Title of Case a. Author of t.docxjasoninnes20
Case Analysis Format
1. Title of Case
a. Author of the written case
b. Your name
c. Date
2. Executive Summary (5-6 sentences. Summarize situation. What is the name of the
company, what do they do? What is the problem definition? What are your
recommendations?
3. Introduction (Describe the company)
4. Background (Give the historical event review. Only use relevant events. Explain why
these are relevant to the case analysis.)
5. Problem Definition (2-3 sentences)
6. Top Management Team (Give degrees, universities, majors, prior work experience,
awards, titles, basically describe the credentials of these people.)
7. Competitors (List the competitors and define how they compete with the company being
analyzed. What products, services, ranking in industry…are competing?)
8. Discussion
a. Analysis (Use only those parts of these tools that are relevant to the case.).
Provide your own interpretation to the results of analysis from each tool.
i. SWOT
ii. PESTEL
iii. Porters 5 Forces
iv. Porters Diamond
v. VRIO
vi. Financials / Ratios (Always compare something to something relevant,
such as competitors or years. Explain why you choose to compare against
which companies over which years. Add your interpretation of the
compared numbers. This tool can be the most revealing and should be
used in most every case.)
vii. Others
9. Action Taken by Firm
10. Results of Overall Analysis and Interpretation of Results
11. Recommendations
a. How much will your recommendations impact the firm?
b. Are they feasible?
c. Which recommendations did firm follow?
12. Conclusion
Comments:
Critical Thinking is a very important skill in business. Critical thinking involves understanding
what key factors are important in a situation, using these factors in an appropriate analysis,
using the results of the analysis to build an argument, then presenting your conclusions and
recommendations based on the analysis results and your argument development. Everything
should flow logically, one stage to the next. Do not put information in the report that does not
relate to the Conclusion.
Managers today have little time for in-depth reading. To get your point across, use formatting to
help you organize your thoughts and allow managers to be selective in what parts of your report
that they read. Start with an Executive Summary that includes a synopsis of the situation,
analysis results, and your recs. Don’t force your reader to read your whole report in order to
understand your ideas. Follow with a concise Introduction, Background, Problem Definition,
Analysis, Results, Discussion, Recommendations, and Conclusion. The key here is to effectively
and efficiently communicate your analysis of the situation. Left justify unless you are an artsy
type and you want a stylish presentation.
BCS204 E Object Orient Programming Midterm
Note: Choose the best answer amo ...
CSC388 Online Programming Languages Homework 3 (due b.docxannettsparrow
CSC388 Online Programming Languages
Homework 3
(due by midnight on Sunday, April 30th)
HW3 must be submitted electronically. Your submission must include 2 files:
(a) The source code in R5RS,
(b) 1-2 page comparison of Java and Scheme. Based on the code from HW2 and HW3, write a
short comparison of Java and Scheme using the language evaluation criteria from Chapter 1.
How do they compare in terms readability, simplicity, orthogonality, and writability? For which
applications does Scheme seem better than Java, and for which applications would you prefer
Java over Scheme?
Pack all your files in a zip file. Use the following naming conventions. If your name is John
Smith, then your file name must be jsmith.zip. Homeworks which are not properly named or
packed will receive 0 points.
Write a function two-subsets in Scheme that takes a list L of positive integers (duplicates are
possible, zero is not considered a positive integer) and some auxiliary parameters of your choice.
The function two-subsets returns #t if the list L contains two subsets with equal sums of elements
and with equal numbers of elements. Otherwise (if two subsets satisfying the condition above do
not exist), the function returns #f. Assume that the list L contains at least two integers.
Note the difference from HW2: here, it is not required that the whole list be split into two subsets.
In HW3, some elements of the list could be left out from the two subsets. Therefore, every list,
which is a solution to HW2 is also be a solution to HW3. However, there are solutions to HW3
that are not solutions to HW2.
It is up to you to choose the auxiliary parameters that two-subsets takes. All auxiliary parameters
must be numeric (not lists) and should have initial values set to zero. For example, if L is ‘(1 2 3)
and if you decide to use two additional auxiliary parameters, then two-subsets must be called as
follows:
(two-subsets '(1 2 3) 0 0)
If there are three auxiliary parameters, then the function must be called:
(two-subsets '(1 2 3) 0 0 0) and so on.
Note that the function must be called two-subsets. Other names will not be accepted. The list must
precede the auxiliary parameters, which are initially set to zeroes.
There is no need to optimize your code. Try to come up with a working solution.
Examples (for the sake of illustration, two auxiliary parameters are used):
(two-subsets '(7 7) 0 0) returns #t. The two subsets are {7} and {7}.
(two-subsets '(7 7 1) 0 0) returns #t. The two subsets are {7} and {7}.
(two-subsets '(5 3 2 4) 0 0) returns #t. The two subsets are {2, 5} and {3, 4}.
(two-subsets '(5 3 21 2 4) 0 0) returns #t. The two subsets are {2, 5} and {3, 4}.
(two-subsets '(2 13 7 5 16 11) 0 0) returns #t. The two subsets are {7, 11} and
{5, 13}.
(two-subsets '(1 2 3 6 9) 0 0) returns #f.
(two-subsets '(10 4 7 102 36 6 17 54) 0 0) returns #f.
The whole solution must be packed in one recursive functio.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
Leveraging Generative AI to Drive Nonprofit InnovationTechSoup
In this webinar, participants learned how to utilize Generative AI to streamline operations and elevate member engagement. Amazon Web Service experts provided a customer specific use cases and dived into low/no-code tools that are quick and easy to deploy through Amazon Web Service (AWS.)
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Diana Rendina
Librarians are leading the way in creating future-ready citizens – now we need to update our spaces to match. In this session, attendees will get inspiration for transforming their library spaces. You’ll learn how to survey students and patrons, create a focus group, and use design thinking to brainstorm ideas for your space. We’ll discuss budget friendly ways to change your space as well as how to find funding. No matter where you’re at, you’ll find ideas for reimagining your space in this session.
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
Liberal Approach to the Study of Indian Politics.pdf
10 csl57 dbms lab
1. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
Laboratory Manual
on
DATABASE MANAGEMENT SYSTEMS LABORATORY
[10CSL 57]
By
Mr. R. RAJKUMAR
Assistant Professor
Department of Information Science & Engineering
For V Semester CSE / ISE
Session: Aug – Nov 2012
RNS Institute of Technology
Rajarajeshwarinagar Post, Channasandra,
Bengaluru – 560098
Department of Information Science
-1-
RNSIT, Bengaluru
2. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
DATABASE APPLICATIONS LABORATORY
Subject Code: 10CSL57
Hours/Week : 03
Total Hours : 42
I.A. Marks : 25
Exam Hours: 03
Exam Marks: 50
1. Consider the following relations:
Student (snum: integer, sname: string, major: string, level: string, age: integer)
Class (name: string, meets at: string, room: string, fid: integer)
Enrolled (snum: integer, cname: string)
Faculty (fid: integer, fname: string, deptid: integer)
The meaning of these relations is straightforward; for example, Enrolled has one record per student-class pair
such that the student is enrolled in the class. Level is a two character code with 4 different values (example:
Junior: JR etc)
Write the following queries in SQL. No duplicates should be printed in any of the answers.
i. Find the names of all Juniors (level = JR) who are enrolled in a class taught by Prof. Harshith
ii. Find the names of all classes that either meet in room R128 or have five or more Students enrolled.
iii. Find the names of all students who are enrolled in two classes that meet at the same time.
iv. Find the names of faculty members who teach in every room in which some class is taught.
v. Find the names of faculty members for whom the combined enrollment of the courses that they teach is less
than five.
2. The following relations keep track of airline flight information:
Flights (no: integer, from: string, to: string, distance: integer, Departs: time, arrives: time, price: real)
Aircraft (aid: integer, aname: string, cruisingrange: integer)
Certified (eid: integer, aid: integer)
Employees (eid: integer, ename: string, salary: integer)
Note that the Employees relation describes pilots and other kinds of employees as well; Every pilot is certified
for some aircraft, and only pilots are certified to fly.
Write each of the following queries in SQL:
i. Find the names of aircraft such that all pilots certified to operate them have salaries more than Rs.80, 000.
ii. For each pilot who is certified for more than three aircrafts, find the eid and the maximum cruisingrange of
the aircraft for which she or he is certified.
iii. Find the names of pilots whose salary is less than the price of the cheapest route from Bengaluru to Frankfurt.
iv. For all aircraft with cruisingrange over 1000 Kms,. Find the name of the aircraft and the average salary of all
pilots certified for this aircraft.
v. Find the names of pilots certified for some Boeing aircraft.
vi. Find the aids of all aircraft that can be used on routes from Bengaluru to New Delhi.
3. Consider the following database of student enrollment in courses & books adopted for each course.
STUDENT (regno: string, name: string, major: string, bdate:date)
COURSE (course #:int, cname:string, dept:string)
ENROLL ( regno:string, course#:int, sem:int, marks:int)
BOOK _ ADOPTION (course# :int, sem:int, book-ISBN:int)
TEXT (book-ISBN:int, book-title:string, publisher:string, author:string)
i. Create the above tables by properly specifying the primary keys and the foreign keys.
ii. Enter at least five tuples for each relation.
iii. Demonstrate how you add a new text book to the database and make this book be adopted by some
department.
Department of Information Science
-2-
RNSIT, Bengaluru
3. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
iv. Produce a list of text books (include Course #, Book-ISBN, Book-title) in the alphabetical order for courses
offered by the ‘CS’ department that use more than two books.
v. List any department that has all its adopted books published by a specific publisher.
vi. Generate suitable reports.
vii. Create suitable front end for querying and displaying the results.
4. The following tables are maintained by a book dealer.
AUTHOR (author-id:int, name:string, city:string, country:string)
PUBLISHER (publisher-id:int, name:string, city:string, country:string)
CATALOG (book-id:int, title:string, author-id:int, publisher-id:int, category-id:int, year:int, price:int)
CATEGORY (category-id:int, description:string)
ORDER-DETAILS (order-no:int, book-id:int, quantity:int)
i. Create the above tables by properly specifying the primary keys and the foreign keys.
ii. Enter at least five tuples for each relation.
iii. Give the details of the authors who have 2 or more books in the catalog and the price of the books is greater
than the average price of the books in the catalog and the year of publication is after 2000.
iv. Find the author of the book which has maximum sales.
v. Demonstrate how you increase the price of books published by a specific publisher by 10%.
vi. Generate suitable reports.
vii. Create suitable front end for querying and displaying the results.
5. Consider the following database for a banking enterprise
BRANCH(branch-name:string, branch-city:string, assets:real)
ACCOUNT(accno:int, branch-name:string, balance:real)
DEPOSITOR(customer-name:string, accno:int)
CUSTOMER(customer-name:string, customer-street:string, customer-city:string)
LOAN(loan-number:int, branch-name:string, amount:real)
BORROWER(customer-name:string, loan-number:int)
i. Create the above tables by properly specifying the primary keys and the foreign keys
ii. Enter at least five tuples for each relation
iii. Find all the customers who have at least two accounts at the Main branch.
iv. Find all the customers who have an account at all the branches located in a specific city.
v. Demonstrate how you delete all account tuples at every branch located in a specific city.
vi. Generate suitable reports.
vii. Create suitable front end for querying and displaying the results.
Instructions:
1. The exercises are to be solved in an RDBMS environment like Oracle or DB2.
2. Suitable tuples have to be entered so that queries are executed correctly.
3. Front end may be created using either VB or VAJ or any other similar tool.
4. The student need not create the front end in the examination. The results of the queries may be displayed
directly.
5. Relevant queries other than the ones listed along with the exercises may also be asked in the examination.
6. Questions must be asked based on lots.
Department of Information Science
-3-
RNSIT, Bengaluru
4. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
1. Consider the following relations:
Student (snum: integer, sname: string, major: string, level: string, age: integer)
Class (name: string, meets_at: string, room: string, fid: integer)
Enrolled (snum: integer, cname: string)
Faculty (fid: integer, fname: string, deptid: integer)
The meaning of these relations is straightforward; for example, Enrolled has one record per student-class pair
such that the student is enrolled in the class. Level is a two character code with 4 different values (Junior: JR,
Senior:SR, Super Senior: SS, Fresher: FR)
CREATE TABLE STUDENT
(SNUM
INTEGER
NOT NULL,
SNAME
VARCHAR (15),
MAJOR
VARCHAR (10),
SLEVEL
CHAR (2)
NOT NULL,
AGE
NUMBER (3),
PRIMARY KEY (SNUM));
CREATE TABLE FACULTY
(FID
INTEGER
NOT NULL,
FNAME
VARCHAR (12) NOT NULL,
DEPTID
NUMBER (3),
PRIMARY KEY (FID));
CREATE TABLE CLASS
(NAME
VARCHAR (12) NOT NULL,
MEETS_AT VARCHAR (10),
ROOM
VARCHAR (5),
FID
INTEGER,
PRIMARY KEY (NAME),
FOREIGN KEY (FID) REFERENCES FACULTY (FID));
CREATE TABLE ENROLLED
(SNUM
INTEGER
NOT NULL,
CNAME
VARCHAR (12) NOT NULL,
PRIMARY KEY (SNUM, CNAME),
FOREIGN KEY (SNUM) REFERENCES STUDENT (SNUM),
FOREIGN KEY (CNAME) REFERENCES CLASS (NAME));
INSERT INTO STUDENT VALUES (&SNUM, ‘&SNAME’, ‘&MAJOR’, ‘&SLEVEL’, &AGE);
INSERT INTO FACULTY VALUES (&FID, ‘&FNAME’, &DEPTID);
INSERT INTO CLASS VALUES (‘&CNAME’, ‘&MEETS_AT’, ‘&ROOM’, &FID);
INSERT INTO ENROLLED VALUES (&SNUM, ‘&CNAME’);
Write the following queries in SQL. No duplicates should be printed in any of the answers.
i) Find the names of all Juniors (level = JR) who are enrolled in a class taught by Prof. Harshith
SELECT DISTINCT S.SNAME
FROM STUDENT S, CLASS C, ENROLLED E, FACULTY F
WHERE S.SNUM = E.SNUM AND E.CNAME = C.NAME AND C.FID = F.FID AND
F.FNAME = ‘Prof. Harshith’ AND S.LEVEL = ‘JR’;
Department of Information Science
-4-
RNSIT, Bengaluru
5. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
ii) Find the names of all classes that either meet in room R128 or have five or more Students enrolled.
SELECT C.NAME
FROM CLASS C
WHERE C.ROOM = ‘R128’
OR C.NAME IN (SELECT E.CNAME
FROM ENROLLED E
GROUP BY E.CNAME
HAVING COUNT (*) >= 5);
iii) Find the names of all students who are enrolled in two classes that meet at the same time.
SELECT DISTINCT S.SNAME
FROM STUDENT S
WHERE S.SNUM IN (SELECT E1.SNUM
FROM ENROLLED E1, ENROLLED E2, CLASS C1, CLASS C2
WHERE E1.SNUM = E2.SNUM AND E1.CNAME <> E2.CNAME
AND E1.CNAME = C1.NAME
AND E2.CNAME = C2.NAME AND C1.MEETS_AT = C2.MEETS_AT);
iv) Find the names of faculty members who teach in every room in which some class is taught.
SELECT DISTINCT F.FNAME
FROM FACULTY F
WHERE NOT EXISTS (( SELECT *
FROM CLASS C
EXCEPT
(SELECT C1.ROOM
FROM CLASS C1
WHERE C1.FID = F.FID));
v) Find the names of faculty members for whom the combined enrollment of the courses that they teach is less
than five.
SELECT
FROM
WHERE
DISTINCT F.FNAME
FACULTY F
5 > (SELECT COUNT (E.SNUM)
FROM
CLASS C, ENROLLED E
WHERE C.CNAME = E.CNAME
AND
C.FID = F.FID);
2. The following relations keep track of airline flight information:
Flights (flno: integer, from: string, to: string, distance: integer, Departs: time, arrives: time, price: real)
Aircraft (aid: integer, aname: string, cruisingrange: integer)
Certified (eid: integer, aid: integer)
Employees (eid: integer, ename: string, salary: integer)
Note that the Employees relation describes pilots and other kinds of employees as well; Every pilot is certified
for some aircraft, and only pilots are certified to fly.
Department of Information Science
-5-
RNSIT, Bengaluru
6. Database Management Systems Lab Manual
CREATE TABLE FLIGHTS
(FLNO
INTEGER
FFROM
VARCHAR(15)
TTO
VARCHAR(15)
DISTANCE
INTEGER,
DEPARTS
TIMESTAMP,
ARRIVES
TIMESTAMP,
PRICE
NUMBER(10,2));
Session: Aug – Nov 2012
V Semester
PRIMARY KEY,
NOT NULL,
NOT NULL,
CREATE TABLE AIRCRAFT
(AID
INTEGER
PRIMARY KEY,
ANAME
VARCHAR(10),
CRUISINGRANGE
INTEGER);
CREATE TABLE EMPLOYEES
(EID
INTEGER
PRIMARY KEY,
ENAME
VARCHAR(15),
SALARY
NUMBER(10,2));
CREATE TABLE CERTIFIED
(EID INTEGER NOT NULL,
AID
INTEGER NOT NULL,
PRIMARY KEY (EID, AID),
FOREIGN KEY (EID) REFERENCES EMPLOYEES (EID),
FOREIGN KEY (AID) REFERENCES AIRCRAFT (AID));
INSERT INTO FLIGHTS VALUES (&FLNO, ‘&FFROM’, ‘&TTO’, &DISTANCE, ‘&DEPARTS’,
‘&ARRIVES’, &PRICE);
INSERT INTO AIRCRAFT VALUES (&AID, ‘&ANAME’, &CRUISRANGE);
INSERT INTO EMPLOYEES VALUES (&EID, ‘&ENAME’, &SALARY);
INSERT INTO CERTIFIED VALUES (&EID, &AID);
Write each of the following queries in SQL:
i) Find the names of aircraft such that all pilots certified to operate them have salaries more than Rs.80,000.
SELECT
FROM
WHERE
DISTINCT A.ANAME
AIRCRAFT A
A.AID IN
(SELECT
FROM
WHERE
NOT EXISTS
C.AID
CERTIFIED C, EMPLOYEES E
C.EID = E.EID AND
(SELECT
*
FROM
EMPLOYEES E1
WHERE
E1.EID = E.EID AND E1.SALARY < 80000));
ii) For each pilot who is certified for more than three aircrafts, find the eid and the maximum cruisingrange of
the aircraft for which she or he is certified.
SELECT
FROM
WHERE
GROUP BY
HAVING
C.EID, MAX (A.CRUISINGRANGE)
CERTIFIED C, AIRCRAFT A
C.AID = A.AID
C.EID
COUNT (*) > 3;
Department of Information Science
-6-
RNSIT, Bengaluru
7. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
iii) Find the names of pilots whose salary is less than the price of the cheapest route from Bengaluru to
Frankfurt.
SELECT
FROM
WHERE
DISTINCT E.ANAME
EMPLOYEE E
E.SALARY < ( SELECT MIN (F.PRICE)
FROM FLIGHTS F
WHERE F.FFROM = ‘Bengaluru’ AND F.TTO = ‘Frankfurt’);
iv) For all aircraft with cruisingrange over 1000 Kms,. Find the name of the aircraft and the average salary of all
pilots certified for this aircraft.
Observe that aid is the key for Aircraft, but the question asks for aircraft names; we deal with this complication
by using an intermediate relation Temp;
SELECT
FROM
TEMP.NAME, TEMP.AVGSALARY
(SELECT
A.AID, A.ANAME AS NAME,
AVG (E.SALARY) AS AVGSALARY
FROM
AIRCRAFT A, CERTIFIED C, EMPLOYEES E
WHERE
A.AID = C.AID AND
C.EID = E.EID AND A.CRUISINGRANGE > 1000
GROUP BY
A.AID, A.ANAME) AS TEMP;
v) Find the names of pilots certified for some Boeing aircraft.
SELECT
FROM
WHERE
DISTINCT E.ENAME
EMPLOYEES E, CERTIFIED C, AIRCRAFT A
E.EID = C.EID AND
C.AID = A.AID AND
A.ANAME = ‘Boeing’;
vi) Find the aids of all aircraft that can be used on routes from Bengaluru to New Delhi.
SELECT A.AID
FROM AIRCRAFT A
WHERE A.CRUISINGRANGE
>
(SELECT MIN (F.DISTANCE)
FROM FLIGHTS F
WHERE F.FFROM = ‘Bengaluru’ AND F.TTO = ‘New Delhi’);
3. Consider the following database of student enrollment in courses & books adopted for each course.
STUDENT (regno: string, name: string, major: string, bdate:date)
COURSE (course:int, cname:string, dept:string)
ENROLL ( regno:string, course:int, sem:int, marks:int)
BOOK _ ADOPTION (course:int, sem:int, book-ISBN:int)
TEXT (book-ISBN:int, book-title:string, publisher:string, author:string)
i. Create the above tables by properly specifying the primary keys and the foreign keys.
CREATE TABLE SSTUDENT
(RREGNO
VARCHAR(30)
NAME
VARCHAR(30)
Department of Information Science
PRIMARY KEY,
NOT NULL,
-7-
RNSIT, Bengaluru
8. Database Management Systems Lab Manual
MAJOR
BDATE
VARCHAR(30)
DATE
Session: Aug – Nov 2012
V Semester
NOT NULL,
NOT NULL);
CREATE TABLE CCOURSE
(COURSE
INTEGER
PRIMARY KEY,
CCNAME
VARCHAR(30) NOT NULL,
DEPT
VARCHAR(30) NOT NULL);
CREATE TABLE EENROLL
(RREGNO
VARCHAR(30) NOT NULL,
COURSE
INTEGER
NOT NULL,
SEM
INTEGER
NOT NULL,
MARKS
INTEGER
NOT NULL,
PRIMARY KEY (RREGNO, COURSE, SEM),
FOREIGN KEY (RREGNO) REFERENCES SSTUDENT(RREGNO),
FOREIGN KEY (COURSE) REFERENCES CCOURSE(COURSE));
CREATE TABLE TTEXT
(BOOKISBN INTEGER
BOOKTITLE VARCHAR(30)
PUBLISHER VARCHAR(30)
AUTHOR
VARCHAR(30)
PRIMARY KEY,
NOT NULL,
NOT NULL,
NOT NULL);
CREATE TABLE BBOOKADOPTION
(COURSE
INTEGER
NOT NULL,
SEM
INTEGER
NOT NULL,
BOOKISBN INTEGER
NOT NULL,
PRIMARY KEY (COURSE, SEM, BOOKISBN),
FOREIGN KEY (COURSE) REFERENCES CCOURSE (COURSE),
FOREIGN KEY (BOOKISBN) REFERENCES TTEXT (BOOKISBN));
ii. Enter at least five tuples for each relation.
INSERT INTO SSTUDENT VALUES('1RN10IS012','ANN','DATBASE','15-JAN-84');
INSERT INTO SSTUDENT VALUES('1 RN10CS012','MARY','DMS','25-FEB-84');
INSERT INTO SSTUDENT VALUES('1 RN10TC012','TOM','SSDT','11-DEC-84');
INSERT INTO SSTUDENT VALUES('1 RN10EE012','EVE','POWER GENERATION','1-APR-84');
INSERT INTO SSTUDENT VALUES('1 RN10EC012','GEORGE','POWER ELECTRONICS','5-NOV-84');
INSERT INTO CCOURSE VALUES(1,'DATABASE','CS');
INSERT INTO CCOURSE VALUES(2,'DMS','CS');
INSERT INTO CCOURSE VALUES(3,'SSDT','TC');
INSERT INTO CCOURSE VALUES(4,'POWER GENERATION','EE');
INSERT INTO CCOURSE VALUES(5,'POWER ELECTRONICS','EC');
INSERT INTO CCOURSE VALUES(6,'DATASTRUCTURE','CS');
INSERT INTO TTEXT VALUES(1,'DATABASE A SYSTEMATIC APPROACH','JOHN WILEY','R ASHOK KUMAR');
INSERT INTO TTEXT VALUES(2,'DMS FOR DUMMIES','JOHN WILEY','MADHUPRIYA');
INSERT INTO TTEXT VALUES(3,'SSDT NO ONE CAN TEACH BETTER','PEARSON','GAURA');
INSERT INTO TTEXT VALUES(4,'POWER GENERATION BIBLE','TMH','MEENA');
INSERT INTO TTEXT VALUES(5,'POWER OF POWER ELECTRONICS','O REILLY','GG THE GREAT');
INSERT INTO TTEXT VALUES(6,'POWER OF DATASTRUCTURES','JOHN WILEY','DENNISRITCHIE');
Department of Information Science
-8-
RNSIT, Bengaluru
9. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
INSERT INTO TTEXT VALUES(7,'ELEMENTARY DATASTUCTURES1','JOHN WILEY','HERBERT SHIELD');
INSERT INTO TTEXT VALUES(8,'ELEMENTARY DATASTUCTURES2','JOHN WILEY','HERBERT SHIELD');
INSERT INTO TTEXT VALUES(9,'DATABASE','JOHN WILEY','MAYOR');
INSERT INTO EENROLL VALUES ('1RN10IS012', 1, 5, 98);
INSERT INTO EENROLL VALUES ('1RN10CS012', 2, 3, 88);
INSERT INTO EENROLL VALUES ('1RN10TC012', 3, 5, 88);
INSERT INTO EENROLL VALUES ('1RN10EE012', 4, 5, 88);
INSERT INTO EENROLL VALUES ('1RN10EC012', 5, 5, 88);
INSERT INTO BBOOKADOPTION VALUES (1, 5, 1);
INSERT INTO BBOOKADOPTION VALUES (1, 4, 9);
INSERT INTO BBOOKADOPTION VALUES (2, 3, 2);
INSERT INTO BBOOKADOPTION VALUES (3, 5, 3);
INSERT INTO BBOOKADOPTION VALUES (4, 5, 4);
INSERT INTO BBOOKADOPTION VALUES (5, 5, 5);
INSERT INTO BBOOKADOPTION VALUES (6, 4, 6);
INSERT INTO BBOOKADOPTION VALUES (6, 4, 7);
INSERT INTO BBOOKADOPTION VALUES (6, 4, 8);
iii. Demonstrate how you add a new text book to the database and make this book be adopted by some
department.
INSERT INTO TTEXT VALUES (10, 'DATABASE FUNDAS', 'PEARSON', 'SCHIELD');
INSERT INTO BBOOKADOPTION VALUES (1, 3, 10);
iv. Produce a list of text books (include Course #, Book-ISBN, Book-title) in the alphabetical order for courses
offered by the ‘CS’ department that use more than two books.
SELECT
FROM
WHERE
C.COURSE, T.BOOKISBN, T.BOOKTITLE
CCOURSE C, BBOOKADOPTION BA, TTEXT T
C.COURSE=BA.COURSE AND
BA.BOOKISBN=T.BOOKISBN
AND C.DEPT='CS' AND
EXISTS
(SELECT
COUNT (COURSE)
FROM
BBOOKADOPTION
WHERE
COURSE=C.COURSE
GROUP BY COURSE
HAVING
COUNT (COURSE)>=2)
ORDER BY T.BOOKTITLE;
v. List any department that has all its adopted books published by a specific publisher.
SELECT
FROM
WHERE
C.DEPT, T.BOOKTITLE, T.PUBLISHER
CCOURSE C, TTEXT T, BBOOKADOPTION BA
C.COURSE=BA.COURSE AND T.BOOKISBN=BA.BOOKISBN
AND
T.PUBLISHER ='JOHN WILEY'AND
T.PUBLISHER= ALL (SELECT
T1.PUBLISHER
FROM
CCOURSE C1, BBOOKADOPTION BA1, TTEXT T1
WHERE
BA1.BOOKISBN=T1.BOOKISBN AND
Department of Information Science
-9-
RNSIT, Bengaluru
10. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
BA1.COURSE=C1.COURSE AND
C.DEPT=C1.DEPT);
vi. Generate suitable reports.
vii. Create suitable front end for querying and displaying the results.
4. The following tables are maintained by a book dealer.
AUTHOR (author-id:int, name:string, city:string, country:string)
PUBLISHER (publisher-id:int, name:string, city:string, country:string)
CATALOG (book-id:int, title:string, author-id:int, publisher-id:int, category-id:int, year:int, price:int)
CATEGORY (category-id:int, description:string)
ORDER-DETAILS (order-no:int, book-id:int, quantity:int)
i. Create the above tables by properly specifying the primary keys and the foreign keys.
CREATE TABLE AAUTHOR
( AUTHORID
INTEGER
PRIMARY KEY,
NAME
VARCHAR(30) NOT NULL,
CITY
VARCHAR(30) NOT NULL,
COUNTRY
VARCHAR(30) NOT NULL);
CREATE TABLE PPUBLISHER
(PUBLISHERID
INTEGER
PRIMARY KEY,
NAME
VARCHAR(30) NOT NULL,
CITY
VARCHAR(30) NOT NULL,
COUNTRY
VARCHAR(30) NOT NULL);
CREATE TABLE BOOKCATEGORY
(CATEGORYID
INTEGER
PRIMARY KEY,
DESCRIPTION
VARCHAR(30) NOT NULL);
CREATE TABLE CCATALOG
(BOOKID INTEGER PRIMARY KEY,
TITLE
VARCHAR(30) NOT NULL,
AUTHORID
INTEGER
NOT NULL,
PUBLISHERID
INTEGER
NOT NULL,
CATEGORYID
INTEGER
NOT NULL,
YEAROFPUBLISH INTEGER
NOT NULL,
PRICE
INTEGER
NOT NULL,
FOREIGN KEY (AUTHORID) REFERENCES AAUTHOR(AUTHORID),
FOREIGN KEY (PUBLISHERID) REFERENCES PPUBLISHER(PUBLISHERID),
FOREIGN KEY (CATEGORYID) REFERENCES BOOKCATEGORY(CATEGORYID));
CREATE TABLE OORDERDETAILS
(ORDERNO INTEGER
PRIMARY KEY,
BOOKID
INTEGER
NOT NULL,
QUANTITY INTEGER
NOT NULL,
FOREIGN KEY (BOOKID) REFERENCES CCATALOG(BOOKID));
ii. Enter at least five tuples for each relation.
INSERT INTO AAUTHOR VALUES (1,'NAVATHE','ARLINGTON','USA');
INSERT INTO AAUTHOR VALUES (2,'RAGHU RAMAKRISHNAN','CALIFORNIA','USA');
Department of Information Science
-10-
RNSIT, Bengaluru
11. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
INSERT INTO AAUTHOR VALUES (3,'DHAMDHERE','MUMBAI','INDIA');
INSERT INTO AAUTHOR VALUES (4,'BJARNE','NEW JERSY','USA');
INSERT INTO AAUTHOR VALUES (5,'TANENBAUM','AMSTERDAM','NETHERLAND');
INSERT INTO PPUBLISHER VALUES (1,'JOHN WILEY','NEW YORK','USA');
INSERT INTO PPUBLISHER VALUES (2,'PEARSON','BANGALORE','INDIA');
INSERT INTO PPUBLISHER VALUES (3,'O REILLY','NEW JERSY','USA');
INSERT INTO PPUBLISHER VALUES (4,'TMH','CALCUTTA','INDIA');
INSERT INTO PPUBLISHER VALUES (5,'JOHN WILEY','NEW DELHI','INDIA');
INSERT INTO BOOKCATEGORY VALUES (1,'DATABASE MANAGEMENT');
INSERT INTO BOOKCATEGORY VALUES (2,'OPERATING SYSTEMS');
INSERT INTO BOOKCATEGORY VALUES (3,'C++');
INSERT INTO BOOKCATEGORY VALUES (4,'COMPUTER NETWORKS');
INSERT INTO BOOKCATEGORY VALUES (5,'C');
INSERT INTO CCATALOG VALUES (1,'FUNDAMENTALS OF DBMS',1,2,1,2004,500);
INSERT INTO CCATALOG VALUES (2,'PRINCIPLES OF DBMS',2,1,1,2004,400);
INSERT INTO CCATALOG VALUES (3,'OPERATING SYSTEMS',3,4,2,2004,200);
INSERT INTO CCATALOG VALUES (4,'C++ BIBLE',4,5,3,2003,500);
INSERT INTO CCATALOG VALUES (5,'COMPUTER NETWORKS',5,3,4,2002,250);
INSERT INTO CCATALOG VALUES (6,'FUNDAMENTALS OF C',1,2,5,2004,700);
INSERT INTO CCATALOG VALUES (7,'OPERATING SYSTEMS 2',3,2,2,2001,600);
INSERT INTO OORDERDETAILS VALUES (1,1,1);
INSERT INTO OORDERDETAILS VALUES (2,2,1);
INSERT INTO OORDERDETAILS VALUES (3,3,1);
INSERT INTO OORDERDETAILS VALUES (4,4,1);
INSERT INTO OORDERDETAILS VALUES (5,5,1);
INSERT INTO OORDERDETAILS VALUES (6,6,7);
INSERT INTO OORDERDETAILS VALUES (7,7,9);
iii. Give the details of the authors who have 2 or more books in the catalog and the price of the books is greater
than the average price of the books in the catalog and the year of publication is after 2000.
SELECT
FROM
WHERE
*
AAUTHOR A
EXISTS
(SELECT
FROM
WHERE
A1.AUTHORID,COUNT(A1.AUTHORID)
AAUTHOR A1,CCATALOG C
A1.AUTHORID=C.AUTHORID AND
A.AUTHORID=A1.AUTHORID AND
C.YEAROFPUBLISH > 2000 AND
C.PRICE > (SELECT
AVG(PRICE)
FROM
CCATALOG)
GROUP BY
A1.AUTHORID
HAVING
COUNT(A1.AUTHORID) >=2);
iv. Find the author of the book which has maximum sales.
SELECT
FROM
DISTINCT A.NAME
AAUTHOR A, CCATALOG C, OORDERDETAILS ODM
Department of Information Science
-11-
RNSIT, Bengaluru
12. Database Management Systems Lab Manual
WHERE
Session: Aug – Nov 2012
V Semester
A.AUTHORID=C.AUTHORID AND ODM.BOOKID=C.BOOKID AND
EXISTS
(SELECT
OD.BOOKID,SUM(OD.QUANTITY)
FROM
OORDERDETAILS OD
WHERE
OD.BOOKID=ODM.BOOKID
GROUP BY
BOOKID
HAVING
SUM(OD.QUANTITY)>= ALL
(SELECT
SUM(QUANTITY)
FROM
OORDERDETAILS
GROUP BY
BOOKID));
v. Demonstrate how you increase the price of books published by a specific publisher by 10%.
UPDATE
SET
WHERE
CCATALOG
PRICE = (1.1) * PRICE
AUTHORID = (SELECT
AUTHORID
FROM
AAUTHOR
WHERE
NAME = 'NAVATHE');
vi. Generate suitable reports.
vii. Create suitable front end for querying and displaying the results
5. Consider the following database for a banking enterprise
BRANCH(branch-name:string, branch-city:string, assets:real)
ACCOUNT(accno:int, branch-name:string, balance:real)
DEPOSITOR(customer-name:string, accno:int)
CUSTOMER(customer-name:string, customer-street:string, customer-city:string)
LOAN(loan-number:int, branch-name:string, amount:real)
BORROWER(customer-name:string, loan-number:int)
i. Create the above tables by properly specifying the primary keys and the foreign keys
CREATE TABLE BBRANCH
(BRANCHNAME
VARCHAR(30)
BRANCHCITY
VARCHAR(30)
ASSETS
NUMBER(10,2)
PRIMARY KEY,
NOT NULL,
NOT NULL);
CREATE TABLE BBANKACCOUNT
(ACCNO
NUMBER(5)
PRIMARY KEY,
BRANCHNAME
VARCHAR(30)
NOT NULL,
BALANCE
NUMBER(10,2),
FOREIGN KEY (BRANCHNAME) REFERENCES BBRANCH (BRANCHNAME));
CREATE TABLE BBANKCUSTOMER
(CUSTOMERNAME VARCHAR(30)
CUSTOMERSTREET VARCHAR(30)
CUSTOMERCITY
VARCHAR(30)
PRIMARY KEY,
NOT NULL,
NOT NULL);
CREATE TABLE DDEPOSITOR
(CUSTOMERNAME VARCHAR(30)
NOT NULL,
ACCNO
NUMBER(5)
NOT NULL,
PRIMARY KEY (CUSTOMERNAME, ACCNO),
FOREIGN KEY (CUSTOMERNAME) REFERENCES BBANKCUSTOMER (CUSTOMERNAME),
FOREIGN KEY (ACCNO) REFERENCES BBANKACCOUNT (ACCNO) ON DELETE CASCADE);
Department of Information Science
-12-
RNSIT, Bengaluru
13. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
CREATE TABLE LLOAN
(LOANNUMBER
INTEGER
PRIMARY KEY,
BRANCHNAME
VARCHAR(30)
NOT NULL,
AMOUNT
NUMBER(10,2)
NOT NULL,
FOREIGN KEY (BRANCHNAME) REFERENCES BBRANCH (BRANCHNAME));
CREATE TABLE BBORROWER
(CUSTOMERNAME VARCHAR(30)
NOT NULL,
LOANNUMBER
INTEGER
NOT NULL,
PRIMARY KEY (CUSTOMERNAME, LOANNUMBER),
FOREIGN KEY (CUSTOMERNAME) REFERENCES BBANKCUSTOMER (CUSTOMERNAME),
FOREIGN KEY (LOANNUMBER) REFERENCES LLOAN (LOANNUMBER));
ii. Enter at least five tuples for each relation
INSERT INTO BBRANCH VALUES('CHAMRAJPET','BANGALORE',50000);
INSERT INTO BBRANCH VALUES('RESIDENCY ROAD','BANGALORE',10000);
INSERT INTO BBRANCH VALUES('M G ROAD','BANGALORE',100000);
INSERT INTO BBRANCH VALUES('CP','DELHI',100000);
INSERT INTO BBRANCH VALUES('JANTARMANTAR','DELHI',100000);
INSERT INTO BBANKACCOUNT VALUES(1,'CHAMRAJPET',2000);
INSERT INTO BBANKACCOUNT VALUES(2,'RESIDENCY ROAD',5000);
INSERT INTO BBANKACCOUNT VALUES(3,'M G ROAD',6000);
INSERT INTO BBANKACCOUNT VALUES(4,'CP',9999);
INSERT INTO BBANKACCOUNT VALUES(5,'JANTARMANTAR',999);
INSERT INTO BBANKACCOUNT VALUES(6,'M G ROAD',999);
INSERT INTO BBANKACCOUNT VALUES(8,'RESIDENCY ROAD',999);
INSERT INTO BBANKACCOUNT VALUES(9,'CP',10000);
INSERT INTO BBANKACCOUNT VALUES(10,'RESIDENCY ROAD',5000);
INSERT INTO BBANKACCOUNT VALUES(11,'JANTARMANTAR',9999);
INSERT INTO BBANKCUSTOMER VALUES('ANNE','BULL TEMPLE ROAD','BANGALORE');
INSERT INTO BBANKCUSTOMER VALUES('DANNY','BANNERGATTA ROAD','BANGALORE');
INSERT INTO BBANKCUSTOMER VALUES('TOM','J C ROAD','BANGALORE');
INSERT INTO BBANKCUSTOMER VALUES('NICK','CP','DELHI');
INSERT INTO BBANKCUSTOMER VALUES('ROVER','JANTARMANTAR','DELHI');
INSERT INTO DDEPOSITOR VALUES('ANNE',1);
INSERT INTO DDEPOSITOR VALUES('DANNY',2);
INSERT INTO DDEPOSITOR VALUES('TOM',3);
INSERT INTO DDEPOSITOR VALUES('NICK',4);
INSERT INTO DDEPOSITOR VALUES('ROVER',5);
INSERT INTO DDEPOSITOR VALUES('ANNE',6);
INSERT INTO DDEPOSITOR VALUES('ANNE',8);
INSERT INTO DDEPOSITOR VALUES('NICK',9);
INSERT INTO DDEPOSITOR VALUES('DANNY',10);
INSERT INTO DDEPOSITOR VALUES('NICK',11);
INSERT INTO LLOAN VALUES(1,'CHAMRAJPET',1000);
INSERT INTO LLOAN VALUES(2,'RESIDENCY ROAD',2000);
INSERT INTO LLOAN VALUES(3,'M G ROAD',3000);
Department of Information Science
-13-
RNSIT, Bengaluru
14. Database Management Systems Lab Manual
Session: Aug – Nov 2012
V Semester
INSERT INTO LLOAN VALUES(4,'CP',4000);
INSERT INTO LLOAN VALUES(5,'JANTARMANTAR',5000);
INSERT INTO BBORROWER VALUES('ANNE',1);
INSERT INTO BBORROWER VALUES('ANNE',2);
INSERT INTO BBORROWER VALUES('TOM',3);
INSERT INTO BBORROWER VALUES('NICK',4);
INSERT INTO BBORROWER VALUES('ROVER',5);
iii. Find all the customers who have at least two accounts at the Main branch.
SELECT
*
FROM
BBANKCUSTOMER C
WHERE EXISTS
(SELECT
DP.CUSTOMERNAME, COUNT (DP.CUSTOMERNAME)
FROM
DDEPOSITOR DP,BBANKACCOUNT BA
WHERE
DP.ACCNO=BA.ACCNO AND
C.CUSTOMERNAME=DP.CUSTOMERNAME AND
BA.BRANCHNAME='RESIDENCY ROAD'
GROUP BY DP.CUSTOMERNAME
HAVING
COUNT(DP.CUSTOMERNAME)>=2);
iv. Find all the customers who have an account at all the branches located in a specific city.
SELECT
FROM
WHERE
*
BBANKCUSTOMER BC
NOT EXISTS
(SELECT
BRANCHNAME
FROM
BBRANCH
WHERE
BRANCHCITY='DELHI'
MINUS
SELECT
BA.BRANCHNAME
FROM
DDEPOSITOR D,BBANKACCOUNT BA
WHERE
D.ACCNO=BA.ACCNO AND
BC.CUSTOMERNAME=D.CUSTOMERNAME );
v. Demonstrate how you delete all account tuples at every branch located in a specific city.
DELETE FROM
WHERE
BBANKACCOUNT
BRANCHNAME IN
(SELECT BRANCHNAME
FROM BBRANCH
WHERE BRANCHCITY='BANGALORE');
vi. Generate suitable reports.
vii. Create suitable front end for querying and displaying the results.
Department of Information Science
-14-
RNSIT, Bengaluru