LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 31 of 106
0 votes
1 ans
3 views
How to get database structure in MySQL via query?

Is it possible to somehow get structure of MySQL database, or just some table with simple query? Or is there another way, how can I do it?

database Solved
JA
asked 1 month ago by Jakub Arnold
0 votes
1 ans
3 views
Best data type for storing currency values in a MySQL database

What is the best SQL data type for currency values? I'm using MySQL but would prefer a database independent type.

database Solved
BR
asked 1 month ago by Brian Fisher
0 votes
1 ans
3 views
Possible to do a MySQL foreign key to one of two possible tables?

Well here's my problem I have three tables; regions, countries, states. Countries can be inside of regions, states can be inside of regions. Regions are t...

database Solved
AN
asked 1 month ago by Andrew G. Johnson
0 votes
2 ans
3 views
Bulk insert with SQLAlchemy ORM

Is there any way to get SQLAlchemy to do a bulk insert rather than inserting each individual object. i.e., doing: INSERT INTO `foo` (`bar`) VALUES (1)...

database Solved
NI
asked 1 month ago by Nick Holden
0 votes
1 ans
3 views
Delete sql rows where IDs do not have a match from another table

I'm trying to delete orphan entries in a mysql table. I have 2 tables like this: Table `files`: id | .... ----|------ 1 | .... 2 | .... 7...

database Solved
MA
asked 1 month ago by Martin
0 votes
1 ans
3 views
Search for all occurrences of a string in a mysql database

I'm trying to figure out how to locate all occurrences of a url in a database. I want to search all tables and all fields. But I have no idea where to start...

database Solved
GR
asked 1 month ago by gregh
0 votes
1 ans
3 views
Alter a MySQL column to be AUTO_INCREMENT

I’m trying to modify a table to make its primary key column `AUTO_INCREMENT` after the fact. I have tried the following SQL, but got a syntax error notificatio...

database Solved
C.
asked 1 month ago by C. Ross
0 votes
1 ans
3 views
How to start MySQL server from command line on Mac OS Lion?

I installed mySQL on my Mac. Beside starting the SQL server with mySQL.prefPane tool installed in System Preferences, I want to know the instructions to start f...

server-admin Solved
VI
asked 1 month ago by vietstone
0 votes
1 ans
3 views
Set user variable from result of query

Is it possible to set a user variable based on the result of a query in MySQL? What I want to achieve is something like this (we can assume that both `USER`...

database Solved
AV
asked 1 month ago by Avada Kedavra
0 votes
1 ans
3 views
First-time database design: am I overengineering?

# Background # I'm a first year CS student and I work part time for my dad's small business. I don't have any experience in real world applicatio...

database Solved
BO
asked 1 month ago by bob esponja
0 votes
1 ans
3 views
How do I get the "id" after INSERT into MySQL database with Python?

I execute an INSERT INTO statement cursor.execute("INSERT INTO mytable(height) VALUES(%s)",(height)) and I want to get the primary key. M...

database Solved
TI
asked 1 month ago by TIMEX
0 votes
1 ans
3 views
Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in

I'm trying to connect to my MySQL DB with the Terminal on my Apple (With PHP). Yesterday it worked fine, and now I suddenly get the error in the title....

database Solved
NR
asked 1 month ago by Nr 28
0 votes
1 ans
3 views
MySQL indexes - what are the best practices?

I've been using indexes on my MySQL databases for a while now but never properly *learnt* about them. Generally I put an index on any fields that I will be...

database Solved
HA
asked 1 month ago by Haroldo
0 votes
1 ans
3 views
how to customize `show processlist` in mysql?

I want to order by Time,but seems no way to do that ? mysql> show processlist; +--------+-------------+--------------------+------+---------+----...

server-admin Solved
OM
asked 1 month ago by omg
0 votes
1 ans
3 views
MySQL's now() +1 day

I'm using `now()` in MySQL query. INSERT INTO table SET data = '$data', date = now() But I want to add 1 day to this date (so that `date...

database Solved
QI
asked 1 month ago by Qiao
0 votes
1 ans
3 views
MySQL, better to insert NULL or empty string?

I have a form on a website which has a lot of different fields. Some of the fields are optional while some are mandatory. In my DB I have a table which holds al...

database Solved
RO
asked 1 month ago by roflwaffle
0 votes
1 ans
3 views
GROUP_CONCAT ORDER BY

I've [a table][1] like: +-----------+-------+------------+ | client_id | views | percentage | +-----------+-------+------------+ |...

general-dev Solved
RO
asked 1 month ago by ronquiq
0 votes
1 ans
3 views
Fastest Way to Find Distance Between Two Lat/Long Points

I currently have just under a million locations in a mysql database all with longitude and latitude information. I am trying to find the distance between one...

general-dev Solved
RY
asked 1 month ago by Ryan Detzel
0 votes
1 ans
3 views
How do I add more members to my ENUM-type column in MySQL?

The MySQL reference manual does not provide a clearcut example on how to do this. I have an ENUM-type column of country names that I need to add more countri...

database Solved
ZA
asked 1 month ago by Zaid
0 votes
1 ans
3 views
Group by date only on a Datetime column

Having a table with a column like: `mydate DATETIME` ... I have a query such as: SELECT SUM(foo), mydate FROM a_table GROUP BY a_table.mydate; This...

general-dev Solved
FM
asked 1 month ago by fmsf