LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

422 solutions found in database

Page 5 of 22
0 votes
1 ans
3 views
MySQL - Make an existing Field Unique

I have an already existing table with a field that should be unique but is not. I only know this because an entry was made into the table that had the same valu...

database Solved
LO
asked 1 month ago by Lothar
0 votes
1 ans
3 views
MYSQL Truncated incorrect DOUBLE value

When the SQL query below is executed: UPDATE shop_category SET name = 'Secolul XVI - XVIII' AND name_eng = '16th to 18th cent...

database Solved
EM
asked 1 month ago by Emanuel
0 votes
1 ans
3 views
MySQL load NULL values from CSV data

I have a file that can contain from 3 to 4 columns of numerical values which are separated by comma. Empty fields are defined with the exception when they are a...

database Solved
SP
asked 1 month ago by Spiros
0 votes
1 ans
3 views
Which is fastest? SELECT SQL_CALC_FOUND_ROWS FROM `table`, or SELECT COUNT(*)

When you limit the number of rows to be returned by a SQL query, usually used in paging, there are two methods to determine the total number of records: ###M...

database Solved
JR
asked 1 month ago by Jrgns
0 votes
1 ans
3 views
MySQL root access from all hosts

I've installed MySQL server on a remote Ubuntu machine. The `root` user is defined in the `mysql.user` table this way: mysql> SELECT host, user, pass...

database Solved
LO
asked 1 month ago by lorenzo-s
0 votes
1 ans
3 views
How can I use mySQL replace() to replace strings in multiple records?

We have a database that has a bunch of records with some bad data in one column, in which an embedded editor escaped some stuff that shouldn't have been esc...

database Solved
EM
asked 1 month ago by EmmyS
0 votes
1 ans
3 views
In MySQL, can I copy one row to insert into the same table?

insert into table select * from table where primarykey=1 I just want to copy one row to insert into the same table (i.e., I want to duplicate an existing...

database Solved
LI
asked 1 month ago by lina
0 votes
1 ans
3 views
Is it a good idea to index datetime field in mysql?

I am working on designing a large database. In my application I will have many rows for example I currently have one table with 4 million records. Most of my qu...

database Solved
JA
asked 1 month ago by Jaylen
0 votes
1 ans
3 views
How to define a custom ORDER BY order in mySQL

In MySQL how do I define a custom sorting order. To try to explain what I want consider this table: ID Language Text 0 ENU a 0 JPN b...

database Solved
MU
asked 1 month ago by Muleskinner
0 votes
1 ans
3 views
How to change the CHARACTER SET (and COLLATION) throughout a database?

Our previous programmer set the wrong collation in a table (Mysql). He set it up with Latin collation, when it should be UTF8, and now I have issues. Every reco...

database Solved
JE
asked 1 month ago by Jeg Bagus
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
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