Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged sql
0
votes
0
answers
301
Sql Practice
Given the following Relations: Product(pid,name,description,price,quantity) Customer(cid,name,address,phone,email) Invoice(id,cid,pid,quantity,state,datetime) Where state can be: paid, delivered, pending, or canceled. Product, Customer and Invoice schema with PRIMARY and ... List name(s) of customer(s) in decreasing order of total amount spent. 3.List the total sales for each month.
Given the following Relations:Product(pid,name,description,price,quantity)Customer(cid,name,address,phone,email)Invoice(id,cid,pid,quantity,state,datetime) Where state ca...
Pavan Kumar Munnam
2.0k
views
Pavan Kumar Munnam
asked
Aug 13, 2017
Databases
databases
sql
+
–
1
votes
0
answers
302
sql assertion
Pavan Kumar Munnam
250
views
Pavan Kumar Munnam
asked
Aug 7, 2017
Databases
databases
sql
+
–
2
votes
2
answers
303
Aggregate function
Can we apply min and max (aggregate function in sql) on strings and date datatype ? Query :SELECT max(Name) FROM EMPLOYEE what will be the result ?
Can we apply min and max (aggregate function in sql) on strings and date datatype ?Query :SELECT max(Name) FROM EMPLOYEEwhat will be the result ?
set2018
1.5k
views
set2018
asked
Jul 21, 2017
Databases
sql
databases
self-doubt
+
–
7
votes
0
answers
304
#SQL-DBMS
Q.consider following relation; supplier(sid,sname,rating)/sid is the p.k parts(pid,pname,color)/pid is the p.k catalog(sid,pid,cost)/sid,pid is the p.k Write SQL command for : retrieve sid supplied every red parts but not any green parts.
Q.consider following relation;supplier(sid,sname,rating)/sid is the p.kparts(pid,pname,color)/pid is the p.kcatalog(sid,pid,cost)/sid,pid is the p.kWrite SQL command for ...
junaid ahmad
287
views
junaid ahmad
asked
Jul 20, 2017
Databases
databases
sql
+
–
2
votes
0
answers
305
dbms query
how min() and max() work with non numeric value?
how min() and max() work with non numeric value?
akankshadewangan24
259
views
akankshadewangan24
asked
Jul 17, 2017
Databases
databases
sql
+
–
2
votes
0
answers
306
SQL Duplicate columns
Assume i have two tables R(A,B) and S(A,D) 1. Select * from R,S 2. Select * from R,S where R.A>S.A What will be the name/number of columns on both of these cases?
Assume i have two tables R(A,B) and S(A,D)1. Select * from R,S2. Select * from R,S where R.A>S.AWhat will be the name/number of columns on both of these cases?
rahul sharma 5
539
views
rahul sharma 5
asked
Jul 13, 2017
Databases
databases
sql
+
–
2
votes
1
answer
307
sql aggregate function
Given a column consisting of 12,19,12,13,14,NULL,NULL. What will be the answer 1.If we apply count on the column. 2.If we apply sum on the column. 3.If we apply avg on the column. 4.If we apply count(*) on the column. Please provide the explanation whether to count null or not.
Given a column consisting of 12,19,12,13,14,NULL,NULL. What will be the answer1.If we apply count on the column.2.If we apply sum on the column.3.If we apply avg on the ...
rohan mishra
1.4k
views
rohan mishra
asked
Jul 8, 2017
Databases
databases
sql
+
–
1
votes
1
answer
308
Query
Hi Let the table be as, id Name 1102 n_1102/abc 1102 n_1102/xyz 1102 n_1102/pqr Please help to get the following data from the table, for each id, we have many names, but from the name, the first part ie. before '/' is common for all, so if i query as " ... the names. i.e by executing a query for id = 1102, then i should i get name as n_1102 as a single row in the result set.
Hi Let the table be as,idName1102n_1102/abc1102n_1102/xyz1102n_1102/pqrPlease help to get the following data from the table,for each id, we have many names, but from the ...
AnilGoudar
291
views
AnilGoudar
asked
Jul 3, 2017
Databases
databases
sql
+
–
0
votes
1
answer
309
DBMS SQL
Trigger code written in SQL or PL/SQL???? Please explain it
Trigger code written in SQL or PL/SQL???? Please explain it
Harikesh Kumar
814
views
Harikesh Kumar
asked
May 25, 2017
Databases
sql
databases
+
–
9
votes
2
answers
310
ISRO2017-7
... Employee, Department from Overtime_allowance) natural join (select Department, OT_allowance from Overtime_allowance) as T); $16$ $4$ $8$ None of the above
$\begin{array}{|l|l|l|l|l|} \hline \textbf{Employee} & \textbf{Department} & \textbf{OT_allowance} \\ \hline \text{RAMA} & \text{Mechanical} & \text{5000} \\\hline \text{...
sh!va
6.3k
views
sh!va
asked
May 7, 2017
Databases
isro2017
databases
sql
+
–
0
votes
2
answers
311
#newgradiance #dbms #sql #joins Q5
Suppose relations R(A,B) and S(B,C,D) have the tuples shown below: R = A B 1 2 3 4 5 6 S = B C D 2 4 6 4 6 8 4 7 9 Compute the result of the join query: SELECT A, R.B, C, D FROM R, S WHERE R.B = S.B Then, identify which of the following tuples is in the result. a) (1,4,7,9) b) (5,6,4,6) c) (3,4,7,9) d) (3,4,2,6)
Suppose relations R(A,B) and S(B,C,D) have the tuples shown below:R =AB123456S =BCD246468479Compute the result of the join query:SELECT A, R.B, C, D FROM R, S WHERE R.B =...
Mubashirulislam
1.2k
views
Mubashirulislam
asked
May 5, 2017
Databases
newgradiance
databases
sql
joins
+
–
0
votes
1
answer
312
#newgradiance #dbms #sql #joins Q4
Suppose relations R(A,B) and S(B,C,D) have the tuples shown below: R = A B 1 2 3 4 5 6 S = B C D 2 4 6 4 6 8 4 7 9 Compute the result of the join query: SELECT A, R.B, S.B, C, D FROM R, S WHERE R.A < S.C AND R.B < S.D Then, identify one of the tuples in the result from the list below. a) (1,2,2,6,8) b) (1,2,2,4,6) c) (3,4,4,7,8) d) (3,4,5,7,9)
Suppose relations R(A,B) and S(B,C,D) have the tuples shown below:R =AB123456S =BCD246468479Compute the result of the join query:SELECT A, R.B, S.B, C, D FROM R, S WHERE ...
Mubashirulislam
456
views
Mubashirulislam
asked
May 5, 2017
Databases
newgradiance
databases
sql
joins
+
–
0
votes
2
answers
313
#newgradiance #dbms #sql #joins Q3
Here are two relations, R(A,B) and S(C,D). Their current values are: R = A B 1 2 3 4 5 6 7 8 S = C D 2 10 4 12 6 14 8 16 Compute the result of the query: SELECT A, D FROM R, S WHERE B+C = 10 Identify, in the list below, the row that appears in the result. a) (7,10) b) (1,10) c) (1,12) d) (3,10)
Here are two relations, R(A,B) and S(C,D). Their current values are:R =AB12345678S =CD210412614816Compute the result of the query:SELECT A, D FROM R, S WHERE B+C = 10Iden...
Mubashirulislam
416
views
Mubashirulislam
asked
May 5, 2017
Databases
newgradiance
databases
sql
joins
+
–
0
votes
2
answers
314
#newgradiance #dbms #sql #joins Q2
Here are three relations, R(a,b), S(a,b), and T(a,b). Their current values are: R S T a b 0 0 0 1 1 0 1 1 a b 0 0 0 1 1 0 1 1 a b 0 0 0 1 1 0 1 1 Compute the result of the query: SELECT R.a, R.b, S.b, T.b FROM R, S, T WHERE R.b = S ... times it appears. a) (1,0,0,1) appears once. b) (0,0,1,1) appears twice. c) (0,1,1,1) does not appear. d) (1,1,1,0) appears once.
Here are three relations, R(a,b), S(a,b), and T(a,b). Their current values are:RSTab00011011ab00011011ab00011011Compute the result of the query:SELECT R.a, R.b, S.b, T.b ...
Mubashirulislam
804
views
Mubashirulislam
asked
May 5, 2017
Databases
newgradiance
databases
sql
joins
+
–
0
votes
0
answers
315
#newgradiance #dbms #sql #joins Q1
The latest scores from the Japanese Baseball League are in the table with schema Scores(Team, Opponent, RunsFor, RunsAgainst) The data in this table is as follows: Team Opponent RunsFor RunsAgainst Dragons Tigers 5 3 Carp Swallows 4 6 Bay Stars Giants 2 ... , a row of the result. a) Ham Fighters Lions b) Bay Stars Buffaloes c) Lions Marines d) Golden Eagles Lions
The latest scores from the Japanese Baseball League are in the table with schemaScores(Team, Opponent, RunsFor, RunsAgainst)The data in this table is as follows:TeamOppon...
Mubashirulislam
624
views
Mubashirulislam
asked
May 5, 2017
Databases
newgradiance
databases
sql
joins
+
–
0
votes
0
answers
316
ISI-JRF
Consider the relations r1(A, B, C), r2(C, D, E) and r3(E, F). Assume that the set of all attributes constitutes the primary keys of these relations, rather than the individual ones. Let V (C, r1) be 500, V (C, r2) be 1000, V (E, r2) be ... has 1500 tuples, and r3 has 750 tuples, then give the ordering of the natural join of r1, 2 and r3 for its efficient computation. Justify your answer.
Consider the relations r1(A, B, C), r2(C, D, E) and r3(E, F). Assume that the set of all attributes constitutes the primary keys of these relations, rather than the indiv...
kauray
594
views
kauray
asked
Apr 20, 2017
Databases
sql
natural-join
databases
+
–
0
votes
0
answers
317
ISI-JRF
Two queries equivalent to each other are specified for a relation R(A, B, C, D, E, F). The queries are: πA,B,C(σB>500(R)) σB>500(πA,B,C(R)) The system maintains a B+ tree index for (A, B, C) on R. However, ... the two queries will be preferred by the query optimizer for minimum cost of execution. The cost of query execution is primarily dependent on the number of disk accesses.
Two queries equivalent to each other are specified for a relation R(A, B, C, D, E, F).The queries are: • πA,B,C(σB>500(R))• σB>500(πA,B,C(R))The system maintains ...
kauray
481
views
kauray
asked
Apr 19, 2017
Databases
sql
indexing
+
–
1
votes
1
answer
318
SQL query
Which of the following queries has better performance while displaying the details of the employees who are managed by the same manager and work in the same department as the employees with identification numbers 174 and 178 ? (A) SELECT employee_id, manager_id, ... 174) AND a.manager_id = b.manager_id AND a.department_id = b.department_id AND a.employee_id NOT IN (178, 174)
Which of the following queries has better performance while displaying thedetails of the employees who are managed by the same manager and workin the same department as t...
Beyonder
612
views
Beyonder
asked
Mar 5, 2017
Databases
databases
sql
+
–
0
votes
2
answers
319
ISI 2016 PCB C4
Commodity items have some positive or negative changes in their prices each week. Each trading company picks a portfolio of com- modity items, that is, they have one or more items and they own some non-zero quantity of each one. The database table for this ... other items and there exists at least one company selling that item only (i.e., not selling any other item) in that week
Commodity items have some positive or negative changes in theirprices each week. Each trading company picks a portfolio of com-modity items, that is, they have one or mor...
Devasish Ghosh
607
views
Devasish Ghosh
asked
Mar 2, 2017
Databases
databases
nested-query-with-correlation
query
sql
+
–
44
votes
3
answers
320
GATE CSE 2017 Set 2 | Question: 46
Consider the following database table named $\text{top_scorer}$ ... tc.goals FROM top_scorer AS tc WHERE tc.country='Germany') The number of tuples returned by the above SQL query is ______
Consider the following database table named $\text{top_scorer}$.$$\overset{\text{top_scorer}}{\begin{array}{|c|c|c|}\hline\\\textbf{player}& \textbf{country}& \textbf...
Arjun
16.2k
views
Arjun
asked
Feb 14, 2017
Databases
gatecse-2017-set2
databases
sql
numerical-answers
+
–
48
votes
2
answers
321
GATE CSE 2017 Set 1 | Question: 23
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: ... SELECT DeptName, COUNT(EmpId) AS EC(DeptName, Num) FROM EMP GROUP BY DeptName) The output of executing the SQL query is _____________ .
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:$$\overset{\text{...
Arjun
13.6k
views
Arjun
asked
Feb 14, 2017
Databases
gatecse-2017-set1
databases
sql
numerical-answers
+
–
1
votes
1
answer
322
Test by Bikram | Mock GATE | Test 3 | Question: 2
Which of the following statements are TRUE? An SQL query automatically eliminates duplicates. An SQL query will not work if there are no indexes on the relations. SQL permits attribute names not to be repeated in the same relation. I and III II only III only I and II only
Which of the following statements are TRUE? An SQL query automatically eliminates duplicates. An SQL query will not work if there are no indexes on the relations. S...
Bikram
533
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
databases
sql
+
–
3
votes
4
answers
323
How many tuples are returned by SQL Query
Consider the following relation instance myTable num1 num2 100 100 100 NULL NULL 100 NULL NULL Query 1: SELECT * FROM myTable WHERE num1 = 100; Query 2: SELECT * FROM myTable WHERE num1 <> 100; If Query 1 returns p tuples and Query 2 returns q tuples, then 10p+q will be _____________
Consider the following relation instance myTablenum1num2100100100NULLNULL100NULLNULL Query 1:SELECT *FROM myTableWHERE num1 = 100;Query 2:SELECT *FROM myTableWHERE num1 <...
sh!va
1.8k
views
sh!va
asked
Feb 8, 2017
Databases
databases
sql
+
–
1
votes
3
answers
324
Predict the number of tuples in SQL result
Consider the following relation instance myTable num1 num2 100 100 100 NULL NULL 100 NULL NULL Query 1: SELECT * FROM myTable WHERE num1 != NULL; Query 2: SELECT * FROM myTable WHERE num1 = NULL; If Query 1 returns m tuples and Query 2 returns n tuples, then 10m+n will be _____________
Consider the following relation instance myTablenum1num2100100100NULLNULL100NULLNULL Query 1:SELECT *FROM myTableWHERE num1 != NULL;Query 2:SELECT *FROM myTableWHERE num1...
sh!va
1.2k
views
sh!va
asked
Feb 8, 2017
Databases
databases
sql
+
–
1
votes
1
answer
325
Count(*) when one of the tuple has null values in all column?
Ideally Count(*) will count no of rows in which atleast one column is Non NULL otherwise discard that row. Is this statement true? But when I am trying practically it is returning the count including the null tuple where all columns ... // Returning 2 rows which is correct select count(*) from stud; // Returning 4 rows. Is this correct?
Ideally Count(*) will count no of rows in which atleast one column is Non NULL otherwise discard that row. Is this statement true?But when I am trying practically it is ...
yg92
1.5k
views
yg92
asked
Feb 8, 2017
Databases
databases
sql
+
–
3
votes
1
answer
326
MadeEasy Subject Test: Databases - Sql
varun singh
665
views
varun singh
asked
Feb 6, 2017
Databases
made-easy-test-series
databases
sql
+
–
3
votes
1
answer
327
SQL query
how is q1 right it only shows sid for students with rank less than everyone
how is q1 right it only shows sid for students with rank less than everyone
Pankaj Joshi
2.3k
views
Pankaj Joshi
asked
Feb 6, 2017
Databases
databases
sql
+
–
0
votes
0
answers
328
MadeEasy Subject Test: Databases - Sql
vaishali jhalani
426
views
vaishali jhalani
asked
Jan 30, 2017
Databases
made-easy-test-series
databases
sql
+
–
0
votes
2
answers
329
Predict the result of SQL query
Create table Employee(Emp_id numeric not null, Name varchar(20) , dept_name varchar(20), Salary numeric unique(Emp_id,Name)); What will be the result of the query? insert into Employee values(1002, 'Ross', 'CSE', 10000) ... ;Ted','Finance', ); d) Error in insert into Employee values(1008,'Ross','Sales',20000);
Create table Employee(Emp_id numeric not null, Name varchar(20) , dept_name varchar(20), Salary numeric unique(Emp_id,Name));What will be the result of the query?insert i...
sh!va
3.2k
views
sh!va
asked
Jan 30, 2017
Databases
databases
sql
+
–
0
votes
2
answers
330
MadeEasy Subject Test: Databases - Sql
Arnabi
397
views
Arnabi
asked
Jan 28, 2017
Databases
databases
sql
made-easy-test-series
+
–
Page:
« prev
1
...
6
7
8
9
10
11
12
13
14
15
16
17
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register