Non-registered mode. Register to save your course progress.
By exploring the course, you are agreeing to our Terms of Service and Privacy Policy. Please read them carefully.
<div class="xblock xblock-student_view xblock-student_view-vertical" data-runtime-class="LmsRuntime" data-init="VerticalStudentView" data-course-id="DB/SQL/SelfPaced" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_vertical;_vert-exercise-sql_social_query_core" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">SQL Social-Network Query Exercises</h2>
<div class="bookmark-button-wrapper">
<button class="btn btn-link bookmark-button "
aria-pressed="false"
data-bookmark-id="anon__JGBvnEpTHcUzBEksypf3r2xZ,i4x://DB/SQL/vertical/vert-exercise-sql_social_query_core"
data-bookmarks-api-url="/api/bookmarks/v1/bookmarks/">
<span class="bookmark-text">Bookmark this page</span>
</button>
</div>
<div class="vert-mod">
<div class="vert vert-0" data-id="i4x://DB/SQL/html/preamble-exercise-sql_social_query_core">
<div class="xblock xblock-student_view xblock-student_view-html xmodule_display xmodule_HtmlModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="html" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_html;_preamble-exercise-sql_social_query_core" data-type="HTMLModule" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p>Students at your hometown high school have decided to organize their social network using databases. So far, they have collected information about sixteen students in four grades, 9-12. Here's the schema: <br /> <br /> Highschooler ( ID, name, grade ) <br /> English: There is a high school student with unique <span style="font-style: italic;">ID</span> and a given <span style="font-style: italic;">first name</span> in a certain <span style="font-style: italic;">grade</span>. <br /> <br /> Friend ( ID1, ID2 ) <br /> English: The student with <span style="font-style: italic;">ID1</span> is friends with the student with <span style="font-style: italic;">ID2</span>. Friendship is mutual, so if (123, 456) is in the Friend table, so is (456, 123). <br /> <br /> Likes ( ID1, ID2 ) <br /> English: The student with <span style="font-style: italic;">ID1</span> likes the student with <span style="font-style: italic;">ID2</span>. Liking someone is not necessarily mutual, so if (123, 456) is in the Likes table, there is no guarantee that (456, 123) is also present. <br /> <br /> Your queries will run over a small data set conforming to the schema. <a href="/c4x/DB/SQL/asset/socialdata.html" target="_blank">View the database</a>. (You can also <a target="[object Object]" href="https://s3-us-west-2.amazonaws.com/prod-c2g/db/Winter2013/files/social.sql">download the schema and data</a>.) <br /> <br /> For your convenience, here is a graph showing the various connections between the students in our database. 9th graders are blue, 10th graders are green, 11th graders are yellow, and 12th graders are purple. Undirected black edges indicate friendships, and directed red edges indicate that one student likes another student.</p>
<div style="text-align: center;"><img style="width: 494px; height: 352px;" alt="Social graph" title="Social graph" src="/assets/courseware/v1/db2bd56806a9ee925f626a01600a97f9/c4x/DB/SQL/asset/social.png" /></div>
<p><br /> <br /> <b>Instructions:</b> <span style="line-height: 25.6px;">Each problem asks you to write a query in SQL. To run your query against our back-end sample database using SQLite, click the "Submit" button. You will see a display of your query result and the expected result. If the results match, your query will be marked "correct". You may run as many queries as you like for each question.</span><br /> <br /> <b>Important Notes:</b></p>
<ul>
<li style="margin-top: 1em;">Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.</li>
<li style="margin-top: 1em;">Unless a specific result ordering is asked for, you can return the result rows in any order.</li>
<li style="margin-top: 1em;"><i>You are to translate the English into a SQL query that computes the desired result over all possible databases.</i> All we actually check is that your query gets the right answer on the small sample database. Thus, even if your solution is marked as correct, it is possible that your query does not correctly reflect the problem at hand. (For example, if we ask for a complex condition that requires accessing all of the tables, but over our small data set in the end the condition is satisfied only by Star Wars, then the query "select title from Movie where title = 'Star Wars'" will be marked correct even though it doesn't reflect the actual question.) Circumventing the system in this fashion will get you a high score on the exercises, but it won't help you learn SQL. On the other hand, an incorrect attempt at a general solution is unlikely to produce the right answer, so you shouldn't be led astray by our checking system.</li>
</ul>
<p><br /> You may perform these exercises as many times as you like, so we strongly encourage you to keep working with them until you complete the exercises with full credit.</p>
</div>
</div>
<div class="vert vert-1" data-id="i4x://DB/SQL/problem/exercise-sql_social_query_core1">
<div class="xblock xblock-student_view xblock-student_view-problem xmodule_display xmodule_CapaModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="problem" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core1" data-type="Problem" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_i4x-DB-SQL-problem-exercise-sql_social_query_core1" class="problems-wrapper" role="group"
aria-labelledby="i4x-DB-SQL-problem-exercise-sql_social_query_core1-problem-title"
data-problem-id="i4x://DB/SQL/problem/exercise-sql_social_query_core1" data-url="/courses/DB/SQL/SelfPaced/xblock/i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core1/handler/xmodule_handler"
data-problem-score="0.0"
data-problem-total-possible="1.0"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="i4x-DB-SQL-problem-exercise-sql_social_query_core1-problem-title" aria-describedby="i4x://DB/SQL/problem/exercise-sql_social_query_core1-problem-progress" tabindex="-1">
Q1
</h3>
<div class="problem-progress" id="i4x://DB/SQL/problem/exercise-sql_social_query_core1-problem-progress"></div>
<div class="problem">
<div>
<span>
Find the names of all students who are friends with someone named Gabriel.
<br/>
<br/>
<b>Note:</b> Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.
<br/>
</span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="textbox_i4x-DB-SQL-problem-exercise-sql_social_query_core1_2_1" class="capa_inputtype textbox cminput">
<label class="sr problem-group-label" for="cm-textarea-i4x-DB-SQL-problem-exercise-sql_social_query_core1_2_1">Code Editor</label>
<textarea rows="10" cols="80" name="input_i4x-DB-SQL-problem-exercise-sql_social_query_core1_2_1" aria-label="sql editor" aria-describedby="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core1_2_1" id="input_i4x-DB-SQL-problem-exercise-sql_social_query_core1_2_1" tabindex="0" data-mode="sql" data-tabsize="4" data-linenums="true">Enter your SQL query here</textarea>
<span class="cm-editor-exit-message capa-message" id="cm-editor-exit-message-i4x-DB-SQL-problem-exercise-sql_social_query_core1_2_1">
Press ESC then TAB or click outside of the code editor to exit
</span>
<div class="grader-status" tabindex="-1">
<span class="status unanswered" id="status_i4x-DB-SQL-problem-exercise-sql_social_query_core1_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p class="debug">unanswered</p>
</div>
<span id="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core1_2_1"/>
<div class="external-grader-message">
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Q1" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core1" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core1">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core1-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core1-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core1-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-2" data-id="i4x://DB/SQL/problem/exercise-sql_social_query_core2">
<div class="xblock xblock-student_view xblock-student_view-problem xmodule_display xmodule_CapaModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="problem" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core2" data-type="Problem" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_i4x-DB-SQL-problem-exercise-sql_social_query_core2" class="problems-wrapper" role="group"
aria-labelledby="i4x-DB-SQL-problem-exercise-sql_social_query_core2-problem-title"
data-problem-id="i4x://DB/SQL/problem/exercise-sql_social_query_core2" data-url="/courses/DB/SQL/SelfPaced/xblock/i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core2/handler/xmodule_handler"
data-problem-score="0.0"
data-problem-total-possible="1.0"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="i4x-DB-SQL-problem-exercise-sql_social_query_core2-problem-title" aria-describedby="i4x://DB/SQL/problem/exercise-sql_social_query_core2-problem-progress" tabindex="-1">
Q2
</h3>
<div class="problem-progress" id="i4x://DB/SQL/problem/exercise-sql_social_query_core2-problem-progress"></div>
<div class="problem">
<div>
<span>
For every student who likes someone 2 or more grades younger than themselves, return that student's name and grade, and the name and grade of the student they like.
<br/>
<br/>
<b>Note:</b> Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.
<br/>
</span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="textbox_i4x-DB-SQL-problem-exercise-sql_social_query_core2_2_1" class="capa_inputtype textbox cminput">
<label class="sr problem-group-label" for="cm-textarea-i4x-DB-SQL-problem-exercise-sql_social_query_core2_2_1">Code Editor</label>
<textarea rows="10" cols="80" name="input_i4x-DB-SQL-problem-exercise-sql_social_query_core2_2_1" aria-label="sql editor" aria-describedby="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core2_2_1" id="input_i4x-DB-SQL-problem-exercise-sql_social_query_core2_2_1" tabindex="0" data-mode="sql" data-tabsize="4" data-linenums="true">Enter your SQL query here</textarea>
<span class="cm-editor-exit-message capa-message" id="cm-editor-exit-message-i4x-DB-SQL-problem-exercise-sql_social_query_core2_2_1">
Press ESC then TAB or click outside of the code editor to exit
</span>
<div class="grader-status" tabindex="-1">
<span class="status unanswered" id="status_i4x-DB-SQL-problem-exercise-sql_social_query_core2_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p class="debug">unanswered</p>
</div>
<span id="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core2_2_1"/>
<div class="external-grader-message">
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Q2" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core2" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core2">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core2-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core2-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core2-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-3" data-id="i4x://DB/SQL/problem/exercise-sql_social_query_core3">
<div class="xblock xblock-student_view xblock-student_view-problem xmodule_display xmodule_CapaModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="problem" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core3" data-type="Problem" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_i4x-DB-SQL-problem-exercise-sql_social_query_core3" class="problems-wrapper" role="group"
aria-labelledby="i4x-DB-SQL-problem-exercise-sql_social_query_core3-problem-title"
data-problem-id="i4x://DB/SQL/problem/exercise-sql_social_query_core3" data-url="/courses/DB/SQL/SelfPaced/xblock/i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core3/handler/xmodule_handler"
data-problem-score="0.0"
data-problem-total-possible="1.0"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="i4x-DB-SQL-problem-exercise-sql_social_query_core3-problem-title" aria-describedby="i4x://DB/SQL/problem/exercise-sql_social_query_core3-problem-progress" tabindex="-1">
Q3
</h3>
<div class="problem-progress" id="i4x://DB/SQL/problem/exercise-sql_social_query_core3-problem-progress"></div>
<div class="problem">
<div>
<span>
For every pair of students who both like each other, return the name and grade of both students. Include each pair only once, with the two names in alphabetical order.
<br/>
<br/>
<b>Note:</b> Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.
<br/>
</span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="textbox_i4x-DB-SQL-problem-exercise-sql_social_query_core3_2_1" class="capa_inputtype textbox cminput">
<label class="sr problem-group-label" for="cm-textarea-i4x-DB-SQL-problem-exercise-sql_social_query_core3_2_1">Code Editor</label>
<textarea rows="10" cols="80" name="input_i4x-DB-SQL-problem-exercise-sql_social_query_core3_2_1" aria-label="sql editor" aria-describedby="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core3_2_1" id="input_i4x-DB-SQL-problem-exercise-sql_social_query_core3_2_1" tabindex="0" data-mode="sql" data-tabsize="4" data-linenums="true">Enter your SQL query here</textarea>
<span class="cm-editor-exit-message capa-message" id="cm-editor-exit-message-i4x-DB-SQL-problem-exercise-sql_social_query_core3_2_1">
Press ESC then TAB or click outside of the code editor to exit
</span>
<div class="grader-status" tabindex="-1">
<span class="status unanswered" id="status_i4x-DB-SQL-problem-exercise-sql_social_query_core3_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p class="debug">unanswered</p>
</div>
<span id="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core3_2_1"/>
<div class="external-grader-message">
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Q3" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core3" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core3">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core3-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core3-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core3-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-4" data-id="i4x://DB/SQL/problem/exercise-sql_social_query_core4">
<div class="xblock xblock-student_view xblock-student_view-problem xmodule_display xmodule_CapaModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="problem" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core4" data-type="Problem" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_i4x-DB-SQL-problem-exercise-sql_social_query_core4" class="problems-wrapper" role="group"
aria-labelledby="i4x-DB-SQL-problem-exercise-sql_social_query_core4-problem-title"
data-problem-id="i4x://DB/SQL/problem/exercise-sql_social_query_core4" data-url="/courses/DB/SQL/SelfPaced/xblock/i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core4/handler/xmodule_handler"
data-problem-score="0.0"
data-problem-total-possible="1.0"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="i4x-DB-SQL-problem-exercise-sql_social_query_core4-problem-title" aria-describedby="i4x://DB/SQL/problem/exercise-sql_social_query_core4-problem-progress" tabindex="-1">
Q4
</h3>
<div class="problem-progress" id="i4x://DB/SQL/problem/exercise-sql_social_query_core4-problem-progress"></div>
<div class="problem">
<div>
<span>
Find all students who do not appear in the Likes table (as a student who likes or is liked) and return their names and grades. Sort by grade, then by name within each grade.
<br/>
<br/>
<b>Note:</b> Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.
<br/>
</span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="textbox_i4x-DB-SQL-problem-exercise-sql_social_query_core4_2_1" class="capa_inputtype textbox cminput">
<label class="sr problem-group-label" for="cm-textarea-i4x-DB-SQL-problem-exercise-sql_social_query_core4_2_1">Code Editor</label>
<textarea rows="10" cols="80" name="input_i4x-DB-SQL-problem-exercise-sql_social_query_core4_2_1" aria-label="sql editor" aria-describedby="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core4_2_1" id="input_i4x-DB-SQL-problem-exercise-sql_social_query_core4_2_1" tabindex="0" data-mode="sql" data-tabsize="4" data-linenums="true">Enter your SQL query here</textarea>
<span class="cm-editor-exit-message capa-message" id="cm-editor-exit-message-i4x-DB-SQL-problem-exercise-sql_social_query_core4_2_1">
Press ESC then TAB or click outside of the code editor to exit
</span>
<div class="grader-status" tabindex="-1">
<span class="status unanswered" id="status_i4x-DB-SQL-problem-exercise-sql_social_query_core4_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p class="debug">unanswered</p>
</div>
<span id="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core4_2_1"/>
<div class="external-grader-message">
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Q4" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core4" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core4">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core4-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core4-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core4-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-5" data-id="i4x://DB/SQL/problem/exercise-sql_social_query_core5">
<div class="xblock xblock-student_view xblock-student_view-problem xmodule_display xmodule_CapaModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="problem" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core5" data-type="Problem" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_i4x-DB-SQL-problem-exercise-sql_social_query_core5" class="problems-wrapper" role="group"
aria-labelledby="i4x-DB-SQL-problem-exercise-sql_social_query_core5-problem-title"
data-problem-id="i4x://DB/SQL/problem/exercise-sql_social_query_core5" data-url="/courses/DB/SQL/SelfPaced/xblock/i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core5/handler/xmodule_handler"
data-problem-score="0.0"
data-problem-total-possible="1.0"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="i4x-DB-SQL-problem-exercise-sql_social_query_core5-problem-title" aria-describedby="i4x://DB/SQL/problem/exercise-sql_social_query_core5-problem-progress" tabindex="-1">
Q5
</h3>
<div class="problem-progress" id="i4x://DB/SQL/problem/exercise-sql_social_query_core5-problem-progress"></div>
<div class="problem">
<div>
<span>
For every situation where student A likes student B, but we have no information about whom B likes (that is, B does not appear as an ID1 in the Likes table), return A and B's names and grades.
<br/>
<br/>
<b>Note:</b> Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.
<br/>
</span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="textbox_i4x-DB-SQL-problem-exercise-sql_social_query_core5_2_1" class="capa_inputtype textbox cminput">
<label class="sr problem-group-label" for="cm-textarea-i4x-DB-SQL-problem-exercise-sql_social_query_core5_2_1">Code Editor</label>
<textarea rows="10" cols="80" name="input_i4x-DB-SQL-problem-exercise-sql_social_query_core5_2_1" aria-label="sql editor" aria-describedby="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core5_2_1" id="input_i4x-DB-SQL-problem-exercise-sql_social_query_core5_2_1" tabindex="0" data-mode="sql" data-tabsize="4" data-linenums="true">Enter your SQL query here</textarea>
<span class="cm-editor-exit-message capa-message" id="cm-editor-exit-message-i4x-DB-SQL-problem-exercise-sql_social_query_core5_2_1">
Press ESC then TAB or click outside of the code editor to exit
</span>
<div class="grader-status" tabindex="-1">
<span class="status unanswered" id="status_i4x-DB-SQL-problem-exercise-sql_social_query_core5_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p class="debug">unanswered</p>
</div>
<span id="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core5_2_1"/>
<div class="external-grader-message">
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Q5" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core5" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core5">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core5-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core5-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core5-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-6" data-id="i4x://DB/SQL/problem/exercise-sql_social_query_core6">
<div class="xblock xblock-student_view xblock-student_view-problem xmodule_display xmodule_CapaModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="problem" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core6" data-type="Problem" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_i4x-DB-SQL-problem-exercise-sql_social_query_core6" class="problems-wrapper" role="group"
aria-labelledby="i4x-DB-SQL-problem-exercise-sql_social_query_core6-problem-title"
data-problem-id="i4x://DB/SQL/problem/exercise-sql_social_query_core6" data-url="/courses/DB/SQL/SelfPaced/xblock/i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core6/handler/xmodule_handler"
data-problem-score="0.0"
data-problem-total-possible="1.0"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="i4x-DB-SQL-problem-exercise-sql_social_query_core6-problem-title" aria-describedby="i4x://DB/SQL/problem/exercise-sql_social_query_core6-problem-progress" tabindex="-1">
Q6
</h3>
<div class="problem-progress" id="i4x://DB/SQL/problem/exercise-sql_social_query_core6-problem-progress"></div>
<div class="problem">
<div>
<span>
Find names and grades of students who only have friends in the same grade. Return the result sorted by grade, then by name within each grade.
<br/>
<br/>
<b>Note:</b> Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.
<br/>
</span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="textbox_i4x-DB-SQL-problem-exercise-sql_social_query_core6_2_1" class="capa_inputtype textbox cminput">
<label class="sr problem-group-label" for="cm-textarea-i4x-DB-SQL-problem-exercise-sql_social_query_core6_2_1">Code Editor</label>
<textarea rows="10" cols="80" name="input_i4x-DB-SQL-problem-exercise-sql_social_query_core6_2_1" aria-label="sql editor" aria-describedby="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core6_2_1" id="input_i4x-DB-SQL-problem-exercise-sql_social_query_core6_2_1" tabindex="0" data-mode="sql" data-tabsize="4" data-linenums="true">Enter your SQL query here</textarea>
<span class="cm-editor-exit-message capa-message" id="cm-editor-exit-message-i4x-DB-SQL-problem-exercise-sql_social_query_core6_2_1">
Press ESC then TAB or click outside of the code editor to exit
</span>
<div class="grader-status" tabindex="-1">
<span class="status unanswered" id="status_i4x-DB-SQL-problem-exercise-sql_social_query_core6_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p class="debug">unanswered</p>
</div>
<span id="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core6_2_1"/>
<div class="external-grader-message">
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Q6" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core6" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core6">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core6-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core6-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core6-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-7" data-id="i4x://DB/SQL/problem/exercise-sql_social_query_core7">
<div class="xblock xblock-student_view xblock-student_view-problem xmodule_display xmodule_CapaModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="problem" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core7" data-type="Problem" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_i4x-DB-SQL-problem-exercise-sql_social_query_core7" class="problems-wrapper" role="group"
aria-labelledby="i4x-DB-SQL-problem-exercise-sql_social_query_core7-problem-title"
data-problem-id="i4x://DB/SQL/problem/exercise-sql_social_query_core7" data-url="/courses/DB/SQL/SelfPaced/xblock/i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core7/handler/xmodule_handler"
data-problem-score="0.0"
data-problem-total-possible="1.0"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="i4x-DB-SQL-problem-exercise-sql_social_query_core7-problem-title" aria-describedby="i4x://DB/SQL/problem/exercise-sql_social_query_core7-problem-progress" tabindex="-1">
Q7
</h3>
<div class="problem-progress" id="i4x://DB/SQL/problem/exercise-sql_social_query_core7-problem-progress"></div>
<div class="problem">
<div>
<span>
For each student A who likes a student B where the two are not friends, find if they have a friend C in common (who can introduce them!). For all such trios, return the name and grade of A, B, and C.
<br/>
<br/>
<b>Note:</b> Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.
<br/>
</span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="textbox_i4x-DB-SQL-problem-exercise-sql_social_query_core7_2_1" class="capa_inputtype textbox cminput">
<label class="sr problem-group-label" for="cm-textarea-i4x-DB-SQL-problem-exercise-sql_social_query_core7_2_1">Code Editor</label>
<textarea rows="10" cols="80" name="input_i4x-DB-SQL-problem-exercise-sql_social_query_core7_2_1" aria-label="sql editor" aria-describedby="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core7_2_1" id="input_i4x-DB-SQL-problem-exercise-sql_social_query_core7_2_1" tabindex="0" data-mode="sql" data-tabsize="4" data-linenums="true">Enter your SQL query here</textarea>
<span class="cm-editor-exit-message capa-message" id="cm-editor-exit-message-i4x-DB-SQL-problem-exercise-sql_social_query_core7_2_1">
Press ESC then TAB or click outside of the code editor to exit
</span>
<div class="grader-status" tabindex="-1">
<span class="status unanswered" id="status_i4x-DB-SQL-problem-exercise-sql_social_query_core7_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p class="debug">unanswered</p>
</div>
<span id="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core7_2_1"/>
<div class="external-grader-message">
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Q7" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core7" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core7">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core7-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core7-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core7-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-8" data-id="i4x://DB/SQL/problem/exercise-sql_social_query_core8">
<div class="xblock xblock-student_view xblock-student_view-problem xmodule_display xmodule_CapaModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="problem" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core8" data-type="Problem" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_i4x-DB-SQL-problem-exercise-sql_social_query_core8" class="problems-wrapper" role="group"
aria-labelledby="i4x-DB-SQL-problem-exercise-sql_social_query_core8-problem-title"
data-problem-id="i4x://DB/SQL/problem/exercise-sql_social_query_core8" data-url="/courses/DB/SQL/SelfPaced/xblock/i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core8/handler/xmodule_handler"
data-problem-score="0.0"
data-problem-total-possible="1.0"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="i4x-DB-SQL-problem-exercise-sql_social_query_core8-problem-title" aria-describedby="i4x://DB/SQL/problem/exercise-sql_social_query_core8-problem-progress" tabindex="-1">
Q8
</h3>
<div class="problem-progress" id="i4x://DB/SQL/problem/exercise-sql_social_query_core8-problem-progress"></div>
<div class="problem">
<div>
<span>
Find the difference between the number of students in the school and the number of different first names.
<br/>
<br/>
<b>Note:</b> Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.
<br/>
</span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="textbox_i4x-DB-SQL-problem-exercise-sql_social_query_core8_2_1" class="capa_inputtype textbox cminput">
<label class="sr problem-group-label" for="cm-textarea-i4x-DB-SQL-problem-exercise-sql_social_query_core8_2_1">Code Editor</label>
<textarea rows="10" cols="80" name="input_i4x-DB-SQL-problem-exercise-sql_social_query_core8_2_1" aria-label="sql editor" aria-describedby="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core8_2_1" id="input_i4x-DB-SQL-problem-exercise-sql_social_query_core8_2_1" tabindex="0" data-mode="sql" data-tabsize="4" data-linenums="true">Enter your SQL query here</textarea>
<span class="cm-editor-exit-message capa-message" id="cm-editor-exit-message-i4x-DB-SQL-problem-exercise-sql_social_query_core8_2_1">
Press ESC then TAB or click outside of the code editor to exit
</span>
<div class="grader-status" tabindex="-1">
<span class="status unanswered" id="status_i4x-DB-SQL-problem-exercise-sql_social_query_core8_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p class="debug">unanswered</p>
</div>
<span id="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core8_2_1"/>
<div class="external-grader-message">
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Q8" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core8" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core8">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core8-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core8-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core8-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-9" data-id="i4x://DB/SQL/problem/exercise-sql_social_query_core9">
<div class="xblock xblock-student_view xblock-student_view-problem xmodule_display xmodule_CapaModule" data-runtime-class="LmsRuntime" data-init="XBlockToXModuleShim" data-block-type="problem" data-request-token="913f24d835f811e9bbb106cd177a39a0" data-runtime-version="1" data-usage-id="i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core9" data-type="Problem" data-course-id="DB/SQL/SelfPaced">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_i4x-DB-SQL-problem-exercise-sql_social_query_core9" class="problems-wrapper" role="group"
aria-labelledby="i4x-DB-SQL-problem-exercise-sql_social_query_core9-problem-title"
data-problem-id="i4x://DB/SQL/problem/exercise-sql_social_query_core9" data-url="/courses/DB/SQL/SelfPaced/xblock/i4x:;_;_DB;_SQL;_problem;_exercise-sql_social_query_core9/handler/xmodule_handler"
data-problem-score="0.0"
data-problem-total-possible="1.0"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="i4x-DB-SQL-problem-exercise-sql_social_query_core9-problem-title" aria-describedby="i4x://DB/SQL/problem/exercise-sql_social_query_core9-problem-progress" tabindex="-1">
Q9
</h3>
<div class="problem-progress" id="i4x://DB/SQL/problem/exercise-sql_social_query_core9-problem-progress"></div>
<div class="problem">
<div>
<span>
Find the name and grade of all students who are liked by more than one other student.
<br/>
<br/>
<b>Note:</b> Your queries are executed using SQLite, so you must conform to the SQL constructs supported by SQLite.
<br/>
</span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="textbox_i4x-DB-SQL-problem-exercise-sql_social_query_core9_2_1" class="capa_inputtype textbox cminput">
<label class="sr problem-group-label" for="cm-textarea-i4x-DB-SQL-problem-exercise-sql_social_query_core9_2_1">Code Editor</label>
<textarea rows="10" cols="80" name="input_i4x-DB-SQL-problem-exercise-sql_social_query_core9_2_1" aria-label="sql editor" aria-describedby="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core9_2_1" id="input_i4x-DB-SQL-problem-exercise-sql_social_query_core9_2_1" tabindex="0" data-mode="sql" data-tabsize="4" data-linenums="true">Enter your SQL query here</textarea>
<span class="cm-editor-exit-message capa-message" id="cm-editor-exit-message-i4x-DB-SQL-problem-exercise-sql_social_query_core9_2_1">
Press ESC then TAB or click outside of the code editor to exit
</span>
<div class="grader-status" tabindex="-1">
<span class="status unanswered" id="status_i4x-DB-SQL-problem-exercise-sql_social_query_core9_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p class="debug">unanswered</p>
</div>
<span id="answer_i4x-DB-SQL-problem-exercise-sql_social_query_core9_2_1"/>
<div class="external-grader-message">
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Q9" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core9" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_i4x-DB-SQL-problem-exercise-sql_social_query_core9">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core9-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core9-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="i4x-DB-SQL-problem-exercise-sql_social_query_core9-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
</div>
</div>
By exploring the course, you are agreeing to our Terms of Service and Privacy Policy. Please read them carefully.
© All Rights Reserved