Use the given database to output the results of the following SQL queries: For these queries you need the student, takes, section, and teaches tables. I gave you all the resources you need. a.) SELECT ∗ FROM Student AS S, Takes AS T WHERE S.ID = T.ID AND T.semester = 'Fall'; b.) (SELECT S.course id, S.semester, S.year FROM Section AS S WHERE S.room number = 101) INTERSECT (SELECT T.course id, T.semester, T.year FROM Teaches AS T WHERE T.ID = 83821); c.) SELECT T.course id FROM takes AS T WHERE T.semester IN (SELECT Z.semester FROM teaches AS Z WHERE Z.ID = 10101) OR T.semester IN (SELECT X.semester FROM section AS X WHERE X.time slot id ='B');
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
Use the given
For these queries you need the student, takes, section, and teaches tables. I gave you all the resources you need.
a.)
SELECT ∗
FROM Student AS S, Takes AS T
WHERE S.ID = T.ID AND T.semester = 'Fall';
b.)
(SELECT S.course id, S.semester, S.year
FROM Section AS S
WHERE S.room number = 101)
INTERSECT
(SELECT T.course id, T.semester, T.year
FROM Teaches AS T
WHERE T.ID = 83821);
c.)
SELECT T.course id
FROM takes AS T
WHERE T.semester IN
(SELECT Z.semester
FROM teaches AS Z
WHERE Z.ID = 10101)
OR
T.semester IN
(SELECT X.semester
FROM section AS X
WHERE X.time slot id ='B');
![4 /6 >
100% +
ab]
A.3 Sample Data 1279
dept name
Comp. Si.
Comp. Sci.
History
Finance
Physics
Physics
Williams Comp. Sci.
Music
ID
name
tot.cred
00128 Zhang
102
12345
Shankar
Brandt
32
80
19991
23121
Chavez
110
44553 Peltier
45678 Levy
54321
55739
56
46
54
Sanchez
38
70557
Snow
Physics
Comp. Sci.
Elec. Eng.
Bourikas Elec. Eng.
Biology
76543
76653
Brown
Aoi
58
60
98765
98
98988
Tanaka
120
Figure A.9 The student relation.
course id
00128 CS-101
sec.id semester
grade
ID
year
Fall
Fall
2009
A
00128 CS-347
12345 CS-101
CS-190
1
2009
A-
Fall
2009
12345
12345
Spring
1
Spring
Fall
2
2009
2010
A
CS-315
A
12345
CS-347
19991 HIS-351
23121 FIN-201
1
2009
A
Spring
1
Spring
1
2010
2010
В
C+
PHY-101
45678 CS-101
45678 CS-101
45678
44553
Fall
Fall
2009
F
B-
1
2009
Spring
1
2010
2010
В
2009
B+
CS-319
CS-101
Spring
Fall
54321
54321
1
A-
Spring
Spring
Fall
CS-190
2
2009
B+
55739
MU-199
1
2010
A-
A
76543
2009
CS-101
CS-319
EE-181
CS-101
CS-315
1
76543
2
Spring
2010
A
2009
76653
98765
Spring
1
Fall
2009
C-
98765
Spring
Summer
1
2010
B
BIO-101
BIO-301
98988
2009
98988
1
Summer 2010
null
Figure A.10 The takes relation.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3532d2ef-d989-410d-a6cb-002f0a4a790e%2Fc9851801-7054-4be5-8124-8af93c454ff3%2Fe0aejy9_processed.png&w=3840&q=75)


Trending now
This is a popular solution!
Step by step
Solved in 7 steps with 14 images









