This repository has been archived on 2025-12-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2024-09-20 14:17:13 +03:00

11 lines
2.4 KiB
HTML

<!doctype html>
<html>
<head>
<title>Homework 3 instructions</title>
<meta charset="utf-8">
</head>
<body>
<p dir="ltr" style="text-align: left;"></p><p dir="ltr">Your task is the following:<br></p><ol><li><strong>(1 %) Create an SQL database using the following data model:<br></strong><img src="data/Basic%20of%20DB%20ex%201-Page-4.drawio.png" alt="" role="presentation"><br><br><u>Remember to use PRIMARY KEY and FOREIGN KEY constraints.&nbsp;</u><br><br></li><li><strong><strong>(2 %)&nbsp;</strong>Create INSERT commands to insert the data given in the excel file within Topic 4 -section.<br></strong><br><strong><span>--- After this point, you can return the assignment at any time for some points if you do not want to do the rest of the homework. Jump to step 7.</span><br></strong><br></li><li><strong><strong><strong>(1 %)&nbsp;</strong></strong>Add ON DELETE CASCADE to all foreign key constraints.</strong></li><li><strong><strong><strong><strong><strong><strong>(2 %)</strong></strong></strong></strong>Create a view&nbsp;<span class="" style="color: rgb(152, 202, 62);">Comments_of_comments</span>&nbsp;that shows only comments associated with other comments in the following format and order the results by username:</strong><br><strong><span class="" style="color: rgb(239, 69, 64);">|User|Comment| Commented on |</span></strong><br></strong></li><li><strong><strong><strong><strong>(1 + 1 %)&nbsp;</strong></strong></strong>Create a trigger <span class="" style="color: rgb(152, 202, 62);">hashtag_not_allowed</span> that triggers before data is inserted into Hashtag- table. The trigger should raise an abort printing "Mayonnaise detected!" when hashtag content has the word <span class="" style="color: rgb(152, 202, 62);">mayonnaise</span></strong></li><li><strong><strong><strong><strong><strong>(1 + 1 %)&nbsp;</strong></strong></strong></strong>Create a view <span class="" style="color: rgb(152, 202, 62);">Tweets_and_tags</span>&nbsp;that shows all hashtags with the associated Tweet in the following format <strong><strong>and order the results by username</strong></strong>:</strong><br><strong><span class="" style="color: rgb(239, 69, 64);">|User|Tweet| Hashtag|</span></strong></li><li><strong>Return the sql statements for in one file.&nbsp;<span>Remember to have them in correct order so a table or entity does not reference something that does not yet exist.</span></strong></li></ol><br><br><br><br><br><p></p>
</body>
</html>