29 questions from the last 30 days
4
votes
3
answers
91
views
Create a trigger to update a column on a table after deleting an entry in another table
I'm making a very simple webpage for an animal shelter (school project) and I want to create a trigger where, if I delete a row in he 'adoptions' HTML table, it sets the situation of the adopted ...
3
votes
1
answer
110
views
bash script concat() in prepared statement for mysql
This gives a syntax error:
read -p "entry: " entry
sql="select concat('entry ', id) from mytbl where id = ?";
$mysql_conn "prepare stmnt from '${sql}'; set @id='${entry}';
...
2
votes
1
answer
65
views
Join Query with an Aggregate Function (number of bowl games won for colleges that have won at least once)
I'm working through my Data Management Applications labs and I'm stumped on one particular lab. I'm definitely missing something incredibly obvious, and I'd rather look dumb on the Internet than look ...
Best practices
1
vote
6
replies
122
views
Best way to get a number of list elements whose sum of values equal a constant value
I have a list which consists of numeric values.
In Python, it is written as:
[959, 3480, 9346, 8367, 2847, 8330, 6946, 9586, 9722, 2775]
Or in the case of MySQL:
create table testtb(n int);
insert ...
1
vote
1
answer
65
views
Is it possible to force mysql server authentication using django.db.backends.mysql?
it's my first question on stack overflow because I can't find relevant information in Django documentation. Is it possible to force mysql server authentication with ssl using django.db.backends.mysql? ...
1
vote
0
answers
40
views
SQLAlchemy Base.metadata.create_all(bind=engine) doesn't create table [duplicate]
So I have been trying to create 2 tables using MySQL and SQLAlchemy, but it keeps firing error: sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'chatbot_db.sessions' ...
Advice
0
votes
8
replies
130
views
How to make it so a parent NEEDS its children to exist in MySQL?
I am designing a DB where basically parent can't exist without two children. E.g: Entity set Marriage, CAN'T exist without entity set Man and entity set Woman, but neither Man or Woman need Marriage ...
Best practices
0
votes
8
replies
138
views
Should I generally use a LIMIT clause when testing my SQL queries to a database?
I am learning SQL from a class online.
I wanted to ask if it's generally best to use LIMIT in my queries to make them run faster, or at least until I have them tested and pulling the right data.
If ...
0
votes
1
answer
125
views
Make MySQL evaluate subquery first
SELECT tt.trans_type_name AS transaction_type,
trans.transaction_time,
a.trans_action_name AS transaction_action_name,
trans.transaction_notes
FROM(SELECT Cast(...
Advice
0
votes
8
replies
138
views
MySQL dump from Ionos server not compatible with dockered MySQL db
I am trying to set up a development and testing environment for the software of my new employer.
The data is quite complex and due to some shortcuts/bad architecture decisions of the company that ...
0
votes
0
answers
32
views
MYSQL generate row for month data without entry [duplicate]
I'm writing a program to count attendance, and I have a table (att_events) containing the holidays in this format:
Date | Description | Poster ID
2025-01-01 New Year Admin
by using the ...
-1
votes
1
answer
59
views
Dictionary memory allocated and buffer pool in mysql
What is the dictionary memory and where does it stores, is it uses the memory of buffer pool or a seperate memory, does buffer pool stores metadata pages also or only user table and indexes, in both ...
-2
votes
0
answers
27
views
Access denied for user to a database? [migrated]
A user I'm supporting is getting the error. The user has grants to various tables in mydb, but when he tries to access them, he gets the error:
Access denied for user 'myuser'@'myhost' to database '...
-3
votes
0
answers
20
views
Where can I manage my database when running Laravel without XAMPP? [duplicate]
I just realized that Laravel can run without starting XAMPP, which confuses me. I’m used to monitoring my database through phpMyAdmin, but since I don’t run XAMPP when using Laravel, I’m not sure ...
-8
votes
1
answer
120
views
ERROR 1064 (42000): You have an error in your SQL syntax; Getting error for adding foreign key after creating table [closed]
I created 2 tables students and course, in course I want to add student_id as foreign key but I am adding the key after creating the table and it is showing error. Need help in solving this thing.
...