Recent questions tagged goclasses-databases-practice-questions

1 1 vote
1 1 answer
71
71 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
33
33 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
30
30 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
26
26 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
42
42 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
29
29 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
16
16 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
19
19 views
Consider$\mathrm{Course}(\mathrm{cid},\mathrm{name},\mathrm{year},\mathrm{duration})$$\mathrm{Student}(\mathrm{sid},\mathrm{name},\mathrm{univ})$$\mathrm{Instructor}(\mat...
0 0 votes
1 1 answer
18
18 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 ...
0 0 votes
1 1 answer
22
22 views
Consider $\mathrm{Manager}(\mathrm{NAME})$ and $\mathrm{Stores}(\mathrm{STORE\_ID},\mathrm{ADDRESS},\mathrm{REGION},\mathrm{MANAGER})$.Which TRC expression correctly retu...
1 1 vote
1 1 answer
136
136 views
Consider$\mathrm{STUDENT}(\mathrm{name},\mathrm{regno},\mathrm{gpa},\mathrm{level},\mathrm{dept})$$\mathrm{COURSE}(\mathrm{cno},\mathrm{cname},\mathrm{dept})$$\mathrm{TAK...
1 1 vote
1 1 answer
87
87 views
Consider$\mathrm{Product}(\mathrm{pid},\mathrm{name},\mathrm{brand},\mathrm{price},\mathrm{color})$.The SQL query is:SELECT DISTINCT name FROM Product p WHERE color = 'gr...
1 1 vote
1 1 answer
50
50 views
Consider$\mathrm{Store}(\mathrm{sid},\mathrm{store\_name},\mathrm{parent\_company})$$\mathrm{Branch}(\mathrm{sid},\mathrm{city},\mathrm{open24})$$\mathrm{Has\_Fruit}(\mat...
0 0 votes
1 1 answer
49
49 views
Consider$\mathrm{Breeders}(\mathrm{brdr\_id},\mathrm{brdr\_name},\mathrm{age})$$\mathrm{Breeds}(\mathrm{br\_id},\mathrm{br\_name},\mathrm{friendliness})$$\mathrm{Pedigree...
1 1 vote
1 1 answer
49
49 views
Consider $\mathrm{Pets}(\mathrm{pid},\mathrm{pname},\mathrm{weight})$.Which TRC expression returns only the weights of all pets whose name is $\mathrm{Tiny}$?$\{t\mid \ex...
0 0 votes
1 1 answer
114
114 views
Consider $\mathrm{Flights}(\mathrm{num},\mathrm{src},\mathrm{dst})$, where each tuple represents a directed flight from $\mathrm{src}$ to $\mathrm{dst}$.Let $\mathrm{F}_1...
0 0 votes
1 1 answer
74
74 views
Consider $\mathrm{Employee}(\mathrm{eid},\mathrm{name},\mathrm{salary})$, $\mathrm{Project}(\mathrm{pid},\mathrm{title},\mathrm{budget})$, and $\mathrm{WorksOn}(\mathrm{e...
1 1 vote
1 1 answer
67
67 views
Consider $\mathrm{Locations}(\mathrm{locationid},\mathrm{name},\mathrm{state},\mathrm{altitude})$$\mathrm{TreeCoverage}(\mathrm{locationid},\mathrm{treetype},\mathrm{year...
1 1 vote
1 1 answer
57
57 views
Consider $\mathrm{X}(\mathrm{A},\mathrm{B})$ and $\mathrm{Y}(\mathrm{B},\mathrm{C})$.Which expression is equivalent to $\sigma_{\mathrm{A}<15\land\mathrm{C}\geq10}(\mathr...
1 1 vote
1 1 answer
80
80 views
Consider two relations $\mathrm{r}$ and $\mathrm{s}$ with schemas $\mathrm{R(A,B,C)}$ and $\mathrm{S(A,B,D)}$, respectively.The query is $\pi_{\mathrm{A}}(\sigma_{\mathrm...
0 0 votes
1 1 answer
51
51 views
Consider $\mathrm{A}(\mathrm{c1},\mathrm{c2},\mathrm{c3})$ and $\mathrm{B}(\mathrm{c1},\mathrm{c2},\mathrm{c3})$, where $\mathrm{c1}$ is the primary key of each relation....
1 1 vote
1 1 answer
44
44 views
Let $\mathrm{R}(\mathrm{A},\mathrm{B})$ and $\mathrm{S}(\mathrm{A},\mathrm{B})$ be relations under set semantics.Which expression is not always equivalent to the others?$...
0 0 votes
1 1 answer
41
41 views
Consider :$$\begin{aligned}\begin{gathered}\mathrm{Customer} \\[-2pt]\begin{array}{|c|c|}\hline\mathrm{cid} & \mathrm{name} \\\hline1 & \mathrm{Joe} \\2 & \mathrm{Betty} ...
0 0 votes
1 1 answer
46
46 views
Consider $\mathrm{Homes}(\mathrm{home\_id},\mathrm{city},\ldots)$ and $\mathrm{Transactions}(\mathrm{home\_id},\mathrm{sale\_price},\ldots)$.We want every home in Berkele...
0 0 votes
3 3 answers
73
73 views
Consider $ \mathrm{MEMBER}(\mathrm{personName}, \mathrm{groupName}) $ and $ \mathrm{PICTURE}(\mathrm{groupName}, \mathrm{picture}) $.Every person belongs to at least one ...
1 1 vote
1 1 answer
158
158 views
Consider$\mathrm{Player}(\mathrm{playerID}, \mathrm{name}, \mathrm{position}, \mathrm{height}, \mathrm{weight}, \mathrm{team})$$\mathrm{Game}(\mathrm{gameID}, \mathrm{hom...
0 0 votes
2 2 answers
97
97 views
Consider$\mathrm{Student}(\mathrm{sid}, \mathrm{sname}, \mathrm{major})$$\mathrm{EnrolledIn}(\mathrm{sid}, \mathrm{cid}, \mathrm{grade})$$\mathrm{Course}(\mathrm{cid}, \m...
0 0 votes
1 1 answer
71
71 views
Let $\mathrm{R}(\mathrm{X},\mathrm{Y})$ and $\mathrm{S}(\mathrm{Y})$.Which expression is equivalent to $\mathrm{R} \div \mathrm{S}$ without using the division operator?$\...
0 0 votes
1 1 answer
67
67 views
Consider$\mathrm{Suppliers}(\mathrm{SID}, \mathrm{sname}, \mathrm{address})$$\mathrm{Parts}(\mathrm{PID}, \mathrm{pname}, \mathrm{color})$$\mathrm{Catalog}(\mathrm{SID}, ...
0 0 votes
1 1 answer
61
61 views
Consider$\mathrm{Student}(\mathrm{snum},\mathrm{sname},\mathrm{major},\mathrm{level},\mathrm{age})$$\mathrm{Class}(\mathrm{name},\mathrm{meets\_at},\mathrm{room},\mathrm{...