GATE CS Tuple Calculus and SQL questions
Practise Tuple Calculus and SQL questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.
Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.
20 on this page
Consider a relational database schema with two relations and . Let be a tuple relational calculus expression. Which one of the following relational algebraic expressions is equivalent to ?
Consider two relations describing teams and players in a sports league: teams(tid, tname): tid, tname are team-id and team-name, respectively players(pid,pname,tid): pid, pname, and tid denote player-id, playername and the team-id of the player, respectively Which ONE of the following tuple relational calculus queries returns the name of the players who play …
Consider the following database tables of a sports league. player (pid, pname, age) team(tid, tname, city, cid) coach (cid, cname) members (pid,tid) An instance of the table and an SQL query are given. …
Consider the following relational schema: Students ( name: string, age: integer, cgpa: real) Courses ( cname: string, credits: integer) Enrolled ( grade: string) Which of the following options is/are …
Consider the following table named in a relational database. The primary key of this table is …
Consider the relational database with the following four schemas and their respective instances. Student(sNo, sName, dNo) Dept(dNo, dName) Course(cNo, cName, dNo) Register(sNo, cNo) …
A relation in a relational database has tuples. The attribute has integer values ranging from to , and the attribute has integer values ranging from to . Assume that the attributes and are independently distributed. The estimated number of tuples in the output of …
The relation scheme given below is used to store information about the employees of a company, where is the key and indicates the department to which the employee is assigned. Each employee is assigned to exactly one department. Consider the …
Consider a relational database containing the following schemas. …
A relational database contains two tables Student and Performance as shown below: …
Consider the following two tables and four queries in SQL. Book (isbn, bname), Stock(isbn, copies) Query 1: SELECT B.isbn, S.copies FROM Book B INNER JOIN Stock S ON B.isbn=S.isbn; Query 2: SELECT B.isbn, S.copies FROM Book B LEFT OUTER JOIN Stock S ON B.isbn=S.isbn; Query 3: SELECT B.isbn, S,copies FROM Book B RIGHT OUTER JOIN Stock S ON B.isbn=S.isbn Query …
Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus. { | u EMP(t[EmpName] = u[EmpName] v …
Consider a database that has the relation schema EMP (EmpId, EmpName, and DeptName). An instance of the schema EMP and a SQL query on it are given below: …
Consider the following database table named . …
Consider the following database table named water_schemes: …
Consider the following relation: …
SELECT operation in SQL is equivalent to
Consider the following relation Cinema() Which of the following options will be needed at the end of the SQL query SELECT P1.address FROM Cinema P1 such that it always finds the addresses of theaters with maximum capacity?
Given the following schema: employees(emp-id, first-name, last-name, hire-date, dept-id, salary) departments(dept-id, dept-name, manager-id, location-id) You want to display the last names and hire dates of all latest hires in their respective departments in the location You issue the following query: SQL>SELECT last-name, hire-date …
Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL. S2: Given the table where and together form the primary key, the following is a valid table definition. CREATE TABLE S ( a INTEGER, d INTEGER, e INTEGER, PRIMARY KEY (d), FOREIGN KEY (a) references R) Which …
