Exam2024 01 25 9 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

2024-01-25 group 9_1

End of exam 2024-01-25 at 15:40.


SQL code solution and database on SQL server
An incorrect database name on the server will disqualify the task. (148.81.196.51\LABSQLSVR01,50067).
Create a database named E2_9_1_ID
ID is your ID at the university
The task is valid when executed on SQL server.

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

Normalized attendance k/12


Normalized activity is kk/36

𝑒𝑥𝑎𝑚1 + 𝑒𝑥𝑎𝑚2
𝑥= × 0,6 + attendance ∗ 0,2 + activity ∗ 0,2
2

or

𝑒𝑥𝑎𝑚1 + 𝑒𝑥𝑎𝑚2 + 𝑒𝑥𝑎𝑚3


𝑥= × 0,6 + attendance ∗ 0,2 + activity ∗ 0,2
3
Activity rated from 3 to 5, but in Plato max is 4 (5 corresponds to 4 points)
A maximum of 36 points can be obtained and this will be normalized
Final grade calculation

If x > = 0.9 Then rating = 5


If x > = 0.8 and x < 0.9 Then rating = 4.5
If x > = 0.7 and x < 0.8 Then rating = 4
If x > = 0.6 and x < 0.7 Then rating = 3.5
If x > = 0.5 and x < 0.6 Then rating = 3
If x < 0.5 Then rating = 2

You might also like