Assuming the table name is “rocscores”, first column name is “scorevalue” and another is…
- User
Assuming the table name is “roc_scores”, first column name is “score_value” and another is "code_user ", and the input score is stored in a variable called “my_score”, write a sql that display 11 records, including the 5 higher ranks from “my_score” and 5 lower ranks from “my_score” with their respective rank numbers and username. we have another table means “roc_users” with two columns means “code” (equal "code_user " columns key in “roc_scores” table) and “username”. sql in MYSQL 5.7
- Assistant
To display 11 records, including the 5 higher ranks from "my_score" and 5 lower ranks from "my_score" with their respective rank numbers and usernames, you can use the following SQL query in MySQL 5.7:
sql