Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Test: Relational Algebra, Tuple Calculus & SQL- 2 - Computer Science Engineering (CSE) MCQ

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Computer Science Engineering (CSE) MCQ


Test Description

15 Questions MCQ Test - Test: Relational Algebra, Tuple Calculus & SQL- 2

Test: Relational Algebra, Tuple Calculus & SQL- 2 for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Test: Relational Algebra, Tuple Calculus & SQL- 2 questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Relational Algebra, Tuple Calculus & SQL- 2 MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Relational Algebra, Tuple Calculus & SQL- 2 below.
Solutions of Test: Relational Algebra, Tuple Calculus & SQL- 2 questions in English are available as part of our course for Computer Science Engineering (CSE) & Test: Relational Algebra, Tuple Calculus & SQL- 2 solutions in Hindi for Computer Science Engineering (CSE) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Relational Algebra, Tuple Calculus & SQL- 2 | 15 questions in 45 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 1

Given relations R(w, x) and S(y, z), the result of
SELECT DISTINCT w,x
FROM R, S
Is guaranteed to be same as R, if

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 1

The given query
SELECT DISTINCT W, X
FROM R, S
Is guaranteed to be same as R, if R has no duplicates and ‘S’ is non-empty.
Since, if R is having a duplicates, then the tuples selected by SELECT operation of the R and the given query will not be same also if ‘S’ is empty then the given query outputs null.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 2

Branch-scheme = (Branch - name, assets, branch- city)
Customer-scheme = (Customer-name, street, customer- city)
Deposit-scheme = (Branch-name, account-number, customer-name, balance)
Borrow-scheme = (Branch-name, loan-number, customer-name, amount)
Client-scheme = (Customer-name, banker-name)
Using relational algebra, the query that finds customers who have a balance of over 1000 is

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 2

From the relation DEPOSIT first we have to select the those entries in which balance is over 1000. This can be obtained by  (Deposit), Now, we have to select those customers name who have balance over 1000 which can be obtained by simply projecting customer name in above subquery.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 3

​Branch-scheme = (Branch - name, assets, branch- city)
Customer-scheme = (Customer-name, street, customer- city)
Deposit-scheme = (Branch-name, account-number, customer-name, balance)
Borrow-scheme = (Branch-name, loan-number, customer-name, amount)
Client-scheme = (Customer-name, banker-name)
Which of the following queries finds the clients of banker Agassi and the city they live in?

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 3

Clients of Bankers Agassi can be obtained by using the relation client_scheme while the corresponding customer_city can be obtained -using customer_scheme.
Hence cross product of client and customer must be taken. This can be achieved in two ways.
(i) First taking the Bankers Agassi clients and then checking their name in customer relation and projecting their customer city.
(ii) First taking all the customers and matching them in customer_scheme, then finding out the customers who have the Agassi as the Banker, finally projecting the customer_city of the respective customers.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 4

​Branch-scheme = (Branch - name, assets, branch- city)
Customer-scheme = (Customer-name, street, customer- city)
Deposit-scheme = (Branch-name, account-number, customer-name, balance)
Borrow-scheme = (Branch-name, loan-number, customer-name, amount)
Client-scheme = (Customer-name, banker-name)

Which of the following tuple relational calculus finds all customers who have a loan amount of more than 1200?

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 4

We have to find all customers in the relation Borrow, this can be achieved by
 borrow (t [custome _name ])=s [customer_name]
The s here is bound variable and the condition of checking Ioan-amount more than 1200 is to be checked with each customer name condition.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 5

Branch-scheme = (Branch - name, assets, branch- city)
Customer-scheme = (Customer-name, street, customer- city)
Deposit-scheme = (Branch-name, account-number, customer-name, balance)
Borrow-scheme = (Branch-name, loan-number, customer-name, amount)
Client-scheme = (Customer-name, banker-name)
Which of the following Domain relational calculus finds all customers who have a loan amount of over 1200?

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 5

All customers who have a lone amount of over 1200

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 6

Consider the set of relations given below and the SQL query that follows:
Students: (Roll_number, Name, date_of_birth)
Courses: (Course_number, Course_name, Instructor)
Grades: (RolL_number, Course_number, Grade)
SELECT DISTINCT Name
FROM Students, Courses, Grades
WHERE Students. RolLnumber = Grades.
RolLnumber
ANDCourse.lnstructor = Korth
AND Courses.Course_number =. Grades. Course_number AND Grades.Grade = A
Which of the following sets is computed by the above query?

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 6

The WHERE condition checks for the Grade = ‘A' and matching of course-number in the courses and Grades, where the instructor must be ‘Korth’. Overall it checks for students to whom ‘Korth’ has instructed and they have received Grade = ‘A in atleast one of the courses taught by ‘Korth’.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 7

Consider the following relational schema pertaining to a students database.
Student: (rollno. name, address)
Enroll: (rollno. courseno. coursename) Where the primary keys are shown underlined. The number of tuples in the Student and the Enroll tables are 120 and 8 respectively. What are the maximum and the minimum number of tuples that can be present in (Student * Enroll), where * denotes natural join?

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 7

Student: (rollno, name, address)

  • Primary Key: rollno
  • Number of tuples: 120

Enroll: (rollno, courseno, coursename)

  • Primary Key: (rollno, courseno)
  • Number of tuples: 8

Natural Join

A natural join between the Student and Enroll tables will combine rows from both tables based on the common attribute rollno.

Minimum Number of Tuples

The minimum number of tuples in the natural join occurs when there are no matching rollno values between the two tables. However, in practice, we need at least one match for the join to yield results.

If no rollno from Enroll matches any rollno in Student, the join will produce zero tuples.

If there are matches, the minimum number of tuples is determined by the table with fewer tuples, which is Enroll in this case. Each Enroll entry needs at least one matching Student entry to form a tuple in the join.

So, the practical minimum number of tuples is 0 if no matches, otherwise at least 1, but technically, based on the fewest tuples in Enroll, the minimum could still be up to 8.

Maximum Number of Tuples

The maximum number of tuples occurs when each Enroll tuple can match multiple Student tuples, but since rollno in Student is unique, each rollno in Enroll can match only one Student tuple.

However, since we consider every tuple in Enroll can potentially join with a unique rollno in Student, and given each student (120) can enroll in multiple courses, the maximum number of tuples in the join is a product of all students and enrollments, provided the rollno in Enroll matches those in Student.

Calculations

  • Minimum: 0 (if no rollno matches between Enroll and Student), but practically considering matching scenarios, up to 8.
  • Maximum: If each of the 120 students is enrolled in multiple courses and each match is counted, the theoretical max is the product of the total rows in both tables (120 students * 8 enrollments each = 960), assuming all rollno in Enroll are present in Student.

Thus, the maximum number of tuples that can be present in the natural join is 960, and the practical minimum, considering enrollment existence, is up to 8.

Thus, the correct answer is: 960, 8

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 8

The employee information in a company is stored in the relation. Assume name is the primary key:
Employee: (name, sex, salary, deptName)
Consider the SQL query;
SELECT deptName
FROM Employee
WHERE sex = M
GROUP By deptName
HAVING avg(salary) > (SELECT avg(salary)
FROM Employee)
It returns the names of the departments in which the average salary. 

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 8

The given query first calculates the average salary from the relation Employee, then it selects the department name where employees who have average salary more than the average salary of the company.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 9

Choose the correct statements:

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 9

Relation algebra is procedural query language while relational calculus is non-procedural query language.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 10

The SQL expression :
SELECT distinct 7.branch_name
FROM branch T, branch S
WHERE T.assets >S.assets and S.branch_city = "PONDICHERRY”
Finds the names of

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 10

The condition T. assets > S. assets and S. branch_city = “PONDICHERRY” checks for the all those branch-name who have greater assets than any branch located in Pondicherry. The keyword distinct removes the duplicacy of branch_name satisfy the given condition.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 11

If P and Q are predicates and P is the relational algebra expression, then which of the following equivalence are valid?

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 11

All of the given option valid:

They simply find and selects the tuples which are common to both P and Q.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 12

Which of the following query transformation (i.e. replacing the LHS expression by the RHS expression) is incorrect? R1 and R2, are relations, C1 C2 are selection conditions and A1 A2 are attributes of R1.

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 12


The conditions c1 and c2 may not be same.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 13

Consider a following declaration:

Then to find the customers who appears in r2, with every branch name in r1 the query is:

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 13

Find the customers who appears in r2 with every branch name in r1
So, it is represented by division query: 

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 14

With the help of which of the following relations operation set we can perform division on relations?

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 14

With the help of {π, x, -} we can perform division operation.
Note: Division operator produces a relation R(X) that includes all tuples t[x] in R(z) that appear in R in combination with every tuple from R2y) when Z = X ∪ Y.

Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 15

Which of the following relational calculas expressions is not safe?

Detailed Solution for Test: Relational Algebra, Tuple Calculus & SQL- 2 - Question 15

A relational calculus expression may contain infinite tuples that are not in the relation, R1.

Hence, the above expression is not safe.

Information about Test: Relational Algebra, Tuple Calculus & SQL- 2 Page
In this test you can find the Exam questions for Test: Relational Algebra, Tuple Calculus & SQL- 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Relational Algebra, Tuple Calculus & SQL- 2, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)