mysql

Determine whether a point falls into a circle

Good afternoon. The database stores the coordinates of a point (float type) from google-maps. When getting such coordinates, ... er 6, 6 falls into the circle. The question seems not complicated, but I can't figure out how to calculate all this correctly

Optional parameters in MySQL stored procedures

How can I set optional parameters for a mysql stored procedure? Or specify the default parameter values

SQL injection of the form on the site

Hello everyone, I got the task to write a simple form of registration and authorization on the site, I successfully coped, no ... submit" name="close" value="Выйти" class="btn"> </form> </div> </body> </html>

Checking for null RedBean php

Tell me how to make a check for 0 that would prevent the publication of empty lines <?php $sql = R::getAll('SELECT * FROM ... it myself and it turned out that if at least 1 line = 0, then nothing is published at all and not specifically 1 empty line.

Write 2 sql queries

1.What is the percentage of orders with a discount? 2. What is the most popular discount (name) and what is the total cost of ... Database are given: 1.orders (id, disc_id) 2.discounts (id, name, count) Name-name of the discount count-discount in rubles

CallableStatement Guide

Tell me a normal guide where you can read about stored procedures, how to create and call them. And then I had a problem when ... is fine - it is created, but when I write this command in the Statement object of the driver JDBC, the command does not work.

I can't do partitioning of the table by month

There is a table: CREATE TABLE `Send-mail` ( `id` int(11) NOT NULL, `email` varchar(150) CHARACTER SET c ... s('2017-04-01')), PARTITION pmaxval VALUES LESS THAN MAXVALUE ); I changed it for myself, but I still don't like it...

Mysql partitioning. How do I split a table by list and date?

Hello everyone. There is the following table (simplified): CREATE TABLE `routes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `use ... n - I understand why. How to properly split a table in this way, so that the query above takes a specific part of the table ?

Database manipulation (sqlite, mysql) via C++

I'm trying to find a way to create/edit/delete a database (sqlite, mysql) from the C++program code. At the moment, I want to ... Who has any thoughts? UPD: I was prompted to work within QT. Can anyone know about the problem when working within pure C++?

Should I use a database or storage for images?

Hello everyone I'm starting to plan the architecture of a web application, and I have a question about storing images. In th ... ase, which one to choose? I don't have an answer to the question of how many images there will be, but I have a lot of plans.

Count the number of records for 2018 SQL

Hello everyone, I ran into a small problem. There are related tables, the data from them I got, but I need to count the recor ... nce the date is in full format, it counts only one record at a time. I need an output of type 2018 | 4. How do I do this?

Protection against XSS attacks

Hello everyone, if there is such a vulnerability on the site: site.com/index.php?page=1<script>alert("XSS")</script& ... yourself from it? Please elaborate. Admit: <? if(isset($_GET['page'])) { getInfo($_GET['page']); } ?>

How to delete a record from the database-via an adjacent table with the relation-belongsTo - in Laravel

I have two tables-articles and downloads The relationship between them is as follows in the Article- public function downlo ... н']; } } And how do I make sure that the record that is linked to this Article in the downloads table is also deleted?

Suggest a convenient Mysql client for remote connection

The main requirement is the ease of working with strings and multiple row addition and selection.

How does BETWEEN work in MySQL?

Faced with a dilemma. In some situations, the BETWEEN statement includes the second date BEFORE, and in some it does not. Why ... происходит по двум датам за 28 и 29 (Field date in the database in DATE format, created_at in DATETIME) How does it work?

SafeMySQL Access denied, how to fix it?

Error:Fatal error: SafeMySQL: 1045 Access denied for user 'root'@'localhost' (using password: YES). Error initiated in /sites/***/page.php on line 7, thrown in /sites/***/apanel/db.mysql.php on line 892 How to fix it?

CURRENT TIMESTAMP for MySQL

If the field has the format DATE, can you do something like auto insert of the current date by muscle forces like CURRENT_TIMESTAMP for TIMESTAMP?

Example of a Mysql trigger

Who can give an example of a trigger when in the UPDATE table table1, the updated record information is added to the table2 t ... erRecordstouser, to = NEW.IdUserRecordstouser, status = 0, id_record = NEW.IdRecordstouser; END; $$ DELIMITER ;

Are identical aliases possible in SQL?

For example: NAME AS nm, NAME_BIG as nm?

Types of relationships in the database and their graphical representation

What is the difference in the relations depicted by a solid and dotted line (in the EPD diagram, etc., etc.)? The ratio of one to many is implied. It doesn't matter, but... diagram from ERwin, dbForge Studio MySQL.