I recommend using a select to check if there are such parameters previously registered, being as follows:
SELECT count(desc) as 'qtdDesc' FROM table WHERE desc = 'descAserInserida' AND grau = 'grauAserInserido';
Then just check if 'qtdDesc' > 0, so do not register, otherwise you will register.
How do I use this when entering data into the table?
Use as follows, example with mysqli
$conn = new mysqli ("localhost", "USUARIO", "SENHA", "nome_DB");
$result = $conn->query("SELECT count(descricao) as 'qtdDesc' FROM table WHERE descricao = '$descAserInserida' AND grau = '$grauAserInserido'");
$row = $result->fetch_row();
if ($row[0] > 0) {
//existe, não insere
echo "existe";
} else {
echo "não existe";
$sql = "INSERT INTO table (descricao,grau) VALUES('$descAserInserida','$grauAserInserido')";
$result = mysqli_query($conn,$sql);
}
$conn->close();