Professional Documents
Culture Documents
Exam2024 01 25 9 1
Exam2024 01 25 9 1
Exam2024 01 25 9 1
Tasks
1. Find in the database data_2024_2.txt: (3 points)
the pair of products that generated the most revenue by the seller with the ID (ID is your ID in the
university). The solution is a view called sell_ID. It should look like
Product A Product B Number of products ID Value
2. Your data is in the salesman table. (3 points)
Check if your data is in the seller table, else use id=121212.
The table is in relation to the product table.
Who sold the same products?
The solution is a procedure sellers with default parameter (your ID)
3. Create a table as shown in the figure and use (write) triggers to update and insert data into the tables.
If you insert data into the table “From”, the Account_A and Account_B tables will be automatically
updated and the data will be automatically inserted into the To table. (3 points)
Prepare a script with the solution and save it in a file (ID_student_surname_name.TXT) with the TXT
extension.
Place the file on the Platon platform in: Training path elements - Introduction to Database Lab
exam_2_91
SQL code solution and database on SQL server
Total 9
Calculation of the final grade for the Exam2
Exam2= your score/9
If Exam2>= 0.9 Then grade = 5
If Exam2>= 0.8 And x < 0.9 Then grade = 4.5
If Exam2 >= 0.7 And x < 0.8 Then grade = 4
If Exam2 >= 0.6 And x < 0.7 Then grade = 3.5
If Exam2 >= 0.5 And x < 0.6 Then grade = 3
If Exam2< 0.5 Then grade = 2
1
2024-01-25 group 9_1
End of exam 2024-01-25 at 15:40.
SQL code solution and database on SQL server
Calculation of the final grade in the course
exam1 is a normalized value to the range 0 1
exam2 is a normalized value up to 0 1
exam3 is a normalized value up to 0 1
𝑒𝑥𝑎𝑚1 + 𝑒𝑥𝑎𝑚2
𝑥= × 0,6 + attendance ∗ 0,2 + activity ∗ 0,2
2
or