Recent questions tagged goclasses-da-dpp

0 0 votes
1 1 answer
34
34 views
Relevant relations are:$\mathrm{BUILDING(BID,\ BName,\ Address)}$$\mathrm{IN\_BUILDING(EID,\ BID)}$Which of the following queries correctly find the names of buildings wh...
0 0 votes
1 1 answer
20
20 views
Consider relations:$\mathrm{Product}$$\mathrm{Inventory}$where the underlined attributes in the original examination are primary keys.The following query returns product ...
0 0 votes
1 1 answer
19
19 views
Consider,SELECT DISTINCT TBL1.COL1 FROM TBL1 WHERE COL1 IN (SELECT COL1 FROM TBL2);Which SQL statement produces the same result?SELECT DISTINCT TBL1.COL1 FROM TBL1 UNION ...
1 1 vote
2 2 answers
25
25 views
Consider the relation $R(a,b)$. The relation may contain duplicate tuples.Which of the following queries are guaranteed not to contain duplicate tuples, regardless of the...
0 0 votes
1 1 answer
93
93 views
Three relations with the same schema are maintained for three regions:$\mathrm{TokyoProduct}$, $\mathrm{NagoyaProduct}$, and $\mathrm{OsakaProduct}$$\mathrm{ProductNo}$ i...
0 0 votes
1 1 answer
89
89 views
The database contains relations $\mathrm{animals}$ and $\mathrm{visits}$, with $\mathrm{aid}$ identifying an animal.Which SQL query returns the names of animals that visi...
0 0 votes
1 1 answer
69
69 views
Conceptually, in which order does SQL process the following three operations?$\mathrm{WHERE}\rightarrow\mathrm{HAVING}\rightarrow\mathrm{GROUP\ BY}$ $\mathrm{WHERE}\right...
0 0 votes
1 1 answer
78
78 views
The $\mathrm{Employee}$ relation contains:$$\begin{array}{|c|c|c|c|} \hline \mathrm{EmployeeNo} & \mathrm{Name} & \mathrm{DateOfBirth} & \mathrm{Department} \\ \hline 000...
0 0 votes
1 1 answer
74
74 views
The relation is:$\mathrm{Midterm}(\mathrm{ClassName},\mathrm{SubjectName},\mathrm{StudentNo},\mathrm{Name},\mathrm{Score})$.The objective is to calculate the average scor...
0 0 votes
1 1 answer
88
88 views
The relation $\mathrm{ExamResult}$ stores examination records for the previous three years:$\mathrm{ExamResult}(\mathrm{StudentNo},\mathrm{ExamDate},\mathrm{Score},\mathr...
2 2 votes
1 1 answer
190
190 views
Relation $\mathrm{R}(\mathrm{at1},\mathrm{at2},\mathrm{at3})$ contains: $$\begin{array}{|c|c|c|} \hline \mathrm{at1} & \mathrm{at2} & \mathrm{at3} \\ \hline 12 & 15 & 510...
0 0 votes
1 1 answer
105
105 views
A concert-ticket system contains $\mathrm{Sales}$ and $\mathrm{Payment}$.Relevant rules are:a row is placed in $\mathrm{Sales}$ when a purchase application is made; if pa...
2 2 votes
1 1 answer
101
101 views
Consider the relation: $$\begin{array}{c}\mathbf{EmployeeQualification} \\[4pt]\begin{array}{|c|c|}\hline\mathrm{EmployeeCode} & \mathrm{Qualification} \\\hline\mathrm{S0...
1 1 vote
1 1 answer
101
101 views
Consider the following tables.The following SQL query is executed:SELECT AVG(TotalSales) AS AverageSales FROM Product LEFT OUTER JOIN ProductSales ON Product.ProductCode ...
1 1 vote
1 1 answer
100
100 views
Consider,$\mathrm{Users}(\mathrm{userid},\mathrm{name},\mathrm{age})$$\mathrm{Dogs}(\mathrm{dogid},\mathrm{owner},\mathrm{name},\mathrm{breed},\mathrm{age})$$\mathrm{dogi...
1 1 vote
1 1 answer
91
91 views
Let $\mathrm{R}$ and $\mathrm{S}$ be relations.For which of the following relational operations is it not necessary that $\mathrm{R}$ and $\mathrm{S}$ be union-compatible...
0 0 votes
1 1 answer
97
97 views
The database contains:$\mathrm{Users}(\mathrm{uid},\mathrm{name},\mathrm{dob},\mathrm{user\_type})$$\mathrm{Posts}(\mathrm{pid},\mathrm{folder},\mathrm{summary})$$\mathrm...
3 3 votes
1 1 answer
111
111 views
The Adjacency List table stores the data for the tree structure shown below. Which SQL keyword should be inserted at $\mathbf{[a]}$ to retrieve the leaf nodes of the tree...
1 1 vote
1 1 answer
75
75 views
Consider:SQL Statement $\mathbf{1}$$\mathrm{SELECT\ *}$ $\mathrm{FROM\ R}$ $\mathrm{UNION}$ $\mathrm{SELECT\ *}$ $\mathrm{FROM\ R}$;SQL Statement $\mathbf{2}$$\mathrm{SEL...
1 1 vote
1 1 answer
93
93 views
Consider the following $\mathrm{Product}$ table:$$\begin{array}{|c|c|c|c|} \hline \mathrm{ProductID} & \mathrm{Product} & \mathrm{SupplierID} & \mathrm{UnitPrice} \\ \hli...
3 3 votes
1 1 answer
203
203 views
Given:$\mathrm{Homes}(\mathrm{home\_id},\mathrm{city},\mathrm{bedrooms},\mathrm{bathrooms},\mathrm{area})$$\mathrm{Transactions}(\mathrm{home\_id},\mathrm{buyer\_id},\mat...
0 0 votes
1 1 answer
124
124 views
Given the relation: $$\begin{array}{|c|c|c|c|} \hline \mathrm{Sname} & \mathrm{Sid} & \mathrm{Region} & \mathrm{Quota} \\ \hline \mathrm{Frances} & 25 & \mathrm{TX} & 100...
0 0 votes
1 1 answer
127
127 views
An auditing company was hired to analyze the database of the SUS (Unified Health System). Its first task is to identify pairs of registered doctors who have the same name...
0 0 votes
1 1 answer
103
103 views
Two tables are given below : $$\begin{array}{c@{\qquad}c}\mathrm{\mathbf{Orders}} & \mathrm{\mathbf{Products}} \\[4pt]\begin{array}{|c|c|c|}\hline\mathrm{Date} & \mathrm{...
0 0 votes
1 1 answer
117
117 views
A table $\mathrm{Scores}$ stores each student's marks in Japanese and Mathematics.Let,$A$ mean the student's Japanese score is at least the Japanese average.$B$ mean the ...
0 0 votes
1 1 answer
89
89 views
Consider the relation $\mathrm{Sailors}(\mathrm{sid},\mathrm{sname},\mathrm{rating},\mathrm{age})$ and the following TRC expression: $$\{S\mid \neg(S\in \mathrm{Sailors})...
0 0 votes
1 1 answer
68
68 views
Consider $\mathrm{Student}(\mathrm{sid},\mathrm{name},\mathrm{univ}),\mathrm{Enrollment}(\mathrm{sid},\mathrm{cid}).$Using the above schema, which condition correctly cha...
0 0 votes
1 1 answer
71
71 views
Consider$\mathrm{Course}(\mathrm{cid},\mathrm{name},\mathrm{year},\mathrm{duration})$$\mathrm{Student}(\mathrm{sid},\mathrm{name},\mathrm{univ})$$\mathrm{Instructor}(\mat...
1 1 vote
1 1 answer
67
67 views
Using the same $\mathrm{Manager}$, $\mathrm{Stores}$, $\mathrm{Sales}$, and $\mathrm{Products}$ schema from the exam, define:$\mathrm{NailSale}(S)$ = store $S$ sold more ...
1 1 vote
1 1 answer
77
77 views
Consider $\mathrm{Manager}(\mathrm{NAME})$ and $\mathrm{Stores}(\mathrm{STORE\_ID},\mathrm{ADDRESS},\mathrm{REGION},\mathrm{MANAGER})$.Which TRC expression correctly retu...