Recent questions tagged sql

114 114 votes
5 answers 5 answers
39.5k
39.5k views
Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL. S2: Given the table $R(a,b,c)$ where $a$ an...
32 32 votes
9 answers 9 answers
10.5k
10.5k views
Suppose we have a database consisting of the following three relations.$\text{FREQUENTS (student, parlor)}$ giving the parlors each student visits.$\text{SERVES (parlor, ...
71 71 votes
3 answers 3 answers
23.4k
23.4k views
Consider the following relational schema.Students(rollno: integer, sname: string)Courses(courseno: integer, cname: string)Registration(rollno: integer, courseno: integer,...
27 27 votes
5 answers 5 answers
17.8k
17.8k views
Consider the set of relationsEMP (Employee-no. Dept-no, Employee-name, Salary)DEPT (Dept-no. Dept-name, Location)Write an SQL query to:Find all employees names who work i...
54 54 votes
5 answers 5 answers
29.2k
29.2k views
Which of the following is/are correct?An SQL query automatically eliminates duplicatesAn SQL query will not work if there are no indexes on the relationsSQL permits attri...
110 110 votes
6 answers 6 answers
44.2k
44.2k views
The relation book (title, price) contains the titles and prices of different books. Assuming that no two books have the same price, what does the following SQL query list...
111 111 votes
13 answers 13 answers
58.3k
58.3k views
Consider the following relational schema:$\text{Suppliers}(\underline{\text{sid:integer}},\text{ sname:string, city:string, street:string})$ $\text{Parts}(\underline{\tex...
112 112 votes
7 answers 7 answers
44.0k
44.0k views
Consider the table employee(empId, name, department, salary) and the two queries $Q_1, \, Q_2$ below. Assuming that department $5$ has more than one employee, and we want...
57 57 votes
4 answers 4 answers
18.5k
18.5k views
The employee information in a company is stored in the relationEmployee (name, sex, salary, deptName)Consider the following SQL querySelect deptName From Employee Where s...
66 66 votes
7 answers 7 answers
25.0k
25.0k views
Consider the set of relations shown below and the SQL query that follows.Students: (Roll_number, Name, Date_of_birth)Courses: (Course_number, Course_name, Instructor)Grad...
47 47 votes
8 8 answers
11.6k
11.6k views
A university placement center maintains a relational database of companies that interview students on campus and make job offers to those successful in the interview. The...
86 86 votes
9 answers 9 answers
21.5k
21.5k views
Consider a relation geq which represents "greater than or equal to", that is, $(x,y) \in $ geq only if $y \geq x$.create table geq ( ib integer not null, ub integer not n...
14 14 votes
2 2 answers
4.5k
4.5k views
Consider a bank database with only one relation transaction (transno, acctno, date, amount)The amount attribute value is positive for deposits and negative for withdrawa...
89 89 votes
9 answers 9 answers
29.1k
29.1k views
In SQL, relations can contain null values, and comparisons with null values are treated as unknown. Suppose all comparisons with a null value are treated as false. Which ...
83 83 votes
5 answers 5 answers
26.2k
26.2k views
Given relations r(w, x) and s(y, z) the result ofselect distinct w, x from r, s is guaranteed to be same as r, provided.r has no duplicates and s is non-emptyr and s have...
32 32 votes
6 answers 6 answers
6.4k
6.4k views
Suppose a database consist of the following relations:SUPPLIER (SCODE,SNAME,CITY). PART (PCODE,PNAME,PDESC,CITY). PROJECTS (PRCODE,PRNAME,PRCITY). SPPR (SCODE,PCODE,PRCOD...
92 92 votes
8 answers 8 answers
58.4k
58.4k views
Which of the following statements are TRUE about an SQL query?P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clauseQ : An SQL query can ...