-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathweek3quiz.html
89 lines (61 loc) · 3.15 KB
/
week3quiz.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!doctype html>
<!-- this is a comment for human! -->
<html lang="en">
<header>
<!-- change the name to yours! -->
<title>SQL for Data-Science </title>
<!-- link to the master cascading stylesheet -->
<link rel="stylesheet" href="css/master.css">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="name" content="SQL for Data-science">
</header>
<body>
<!-- add the name for the website -->
<h1>SQL for Data-science Coursera Assignment Answers</h1>
<!-- add a section called "About Me" -->
<h2>Week 3 Quiz</h2>
<!-- add a few paragraph lines to describe you -->
<p><h5> 1. Which of the following statements is true regarding subqueries?</h5></p> <!-- where do you live? -->
<p>Answers:</p> <!-- Where studying/studied? -->
<p> Subqueries always process the innermost query first and the work outward. </p>
<p><h5> 2. If you can accomplish the same outcome with a join or a subquery, which one should you always choose?</h5></p>
<p>Answers:</p>
<p> Joins are usually faster, but subqueries can be more reliable, so it depends on your situation.</p>
<p><h5> 3. The following diagram is a depiction of what type of join? </h5></p>
<p>Answers:</p>
<p>Inner Join</p>
<p><h5> 4. Select which of the following statements are true regarding inner joins. (Select all that apply).</h5></p>
<p>Answers:</p>
<p> Inner joins are one of the most popular types of joins use </p>
<p> There is no limit to the number of table you can join with an inner join. </p>
<p> Performance will most likely worsen with the more joins you make </p>
<p><h5> 5. Which of the following is true regarding Aliases?</h5></p>
<p>Answers:</p>
<p> Aliases are often used to make column names more readable. </p>
<p> SQL aliases are used to give a table, or a column in a table, a temporary name. </p>
<p> An alias only exists for the duration of the query. </p>
<p><h5> 6. What is wrong with the following query?.</h5></p>
<p>Answers:</p>
<p> Should be using an inner join rather than a left join </p>
<p> Column names do not have an alias </p>
<p><h5> 7. What is the difference between a left join and a right join?.</h5></p>
<p>Answers:</p>
<p> The only difference between a left and right join is the order in which the tables are relating. </p>
<p><h5> 8. If you perform a cartesian join on a table with 10 rows and a table with 20 rows, how many rows will there be in the output table?</h5></p>
<p>Answers:</p>
<p> 200 </p>
<p><h5> 9. Which of the following statements is true? (select all that apply).</h5></p>
<p>Answers:</p>
<P> Each SELECT statement within UNION must have the same number of columns </p>
<p> The UNION operator is used to combine the result-set of two or more SELECT statements </p>
<p> The columns must also have similar data types </p>
<p><h5> 10. Data scientists need to use joins in order to: (select the best answer)</h5></p>
<p>Answers:</p>
<p> Retrieve data from multiple tables. </p>
</body>
<footer>
<hr>
<!-- change the name to yours! -->
<code>Copyright (C) 2020 Mayank Pathak</code>
</footer>
</html>