sql

Finding the shortest path in a graph in SQL

Writing SQL code to find the shortest path(From ' S ' to 'Y'), I stopped at calculating the total cost of with recursive tem ... if you do not count the total weight (price), all it works. Note: The graph is oriented, the direction is from par_id to id

Update via a While loop

Tell me please: There is a table t1 in it there are fields let's say ID, FirstValue, secondValue ID FirstValue SecondVal ... ры 1.2 партнеры 5 1.2 партнеры Газпром 6 1.2 партнеры USA Tell me how? it is possible in words)

sql grouping with conditions

Http://sqlfiddle.com/#!9/aef5ce/7 In the example, 2 queries are made to the table. The requests are the same, the only diffe ... isplayed in the example as the result of the 1st query is returned (that is, the value for the string with format_id = null).

The library is not registered. (Exception from HRESULT: 0x8002801D (TYPE E LIBNOTREGISTERED))

When you try to create a query and a stored procedure in SQL Server 2014, Management Studio returns that the library is not r ... pData\Local\Temp\FixDotNet_HKLM_Installer.regdump Tried the latest update for 2014. And all. I don't know what to do next.

Semantic meaning and relationship of data schema elements

Please help me understand the data schema in Figure QUESTIONS Difference between Ticket and TicketFlies Is it possible to ... g the plane before the flight or something else?) FareConditions - tariff conditions (please provide, please, an example)?

The if condition in the sql query. Is it possible?

There is a request of the form: $result = mysql_query("SELECT id, title, (SELECT mark FROM table_mark WHERE table_marks.id ... s.par = ".$_SESSION["user"]["id_user"].") AS mark Execute only if $_SESSION["user"]["id_user"] {[4 exists]} Is it feasible?

Selecting a date without a time

Prompt a request to select only the date from the database. There is a row in the table of the TIMESTAMP format 0000-0-0 00:00:00, so here's how to make the screen display only the date and not the date with time ???

Php Language Selector

We have such a selector, When you click on the flag, for example, #US is added to the domain. Example - site.com/index.php ... ( or make another file,), I'm just wondering how to do this substitution of the language. What is used in this situation. ?

Single quote in the php text field

There is a text field named nickname. From it, the value is passed to the database. $insert = mysqli_query($link,"INSERT IN ... POST[game_class]','$_POST[Eternal]')"); But if the value contains a single quote, it outputs an error. Invalid sql syntax.

Optimal database architecture for an online store

A hackneyed question, but still. There is an online store of computer equipment. A well-known problem is the properties and p ... perience. P.S. Please do not write about NOSQL in advance. I can't believe that all the small online shops are on mongo, etc.

How do I pass the value of a variable from the go code to a stored procedure?

Go code: func main() { psqlInfo := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable", ... lpgsql AS $function$ begin return query (select * from mytable where id=i); return; end $function$ ;

How to delete a row from a DataGrid and delete it from a SQL database

At the expense of questions similar to StackOverflow. They are indeed similar, but there is no exact answer to the question, ... 40"/> </Grid> How do I implement deletion when clicking on the "Delete" button using the SelectionChanged event

Auto-increment of id in PostgreSQL

The table contains two columns: id | description How do I make it so that when a new line is added, the user ID will grow itself? That is, INSERT INTO users DEFAULT VALUES; Will give (1,), (2, ) , and so on.

SQL convert rows to columns

There is a table in the string view: You need to get the following view: Example of table initialization - SQL Fiddle I tried to implement it using UNPIVOT, but nothing comes out. Testing on MS SQL Server 2017

The PDO execute() method doesn't work, and it doesn't throw any errors

Hi everyone, heh. In general, if it is not difficult to tell me what the problem may be, the execute method does not save any ... RAM_INT); if ($result->execute()) { return $db->lastInsertId(); } return 0; }

Inserting data into multiple linked tables at the same time

I would like to know how to add data to linked tables in a single query. The figure shows the database schema. How do I add an author and a book so that their ID is added to the central table? Database on MySQL.

How do I create an sql Trigger to delete data from tables?

There are tables: dbo_student(kod_stud(primary key),Name_ini,SName,Name,FName,N_in_group,Kod_group dbo_groups(Kod_group(prima ... roup from dbo_groups q where not exists ( select g.Kod_stud,q.Kod_group from dbo_student g where q.Kod_group = g.Kod_group))

error creating the "near" database \")\": syntax error Unable to execute statement"

I can't understand where the database creation error came from. "near \")\": syntax error Unable to execute statement" He ... return true; } return false; } I deleted one line. I can't understand why the error occurred and how to fix it ??

An SQL query that outputs max (count (...)) and other table fields corresponding to the max parameter

The following tables are available: Person(поля Nom и др.) - информация о людях, Profit(поля ID, Source, Moneys) - источники ... rom profit, have_d, person where profit.id = have_d.id and have_d.nom = person.nom group by source)

Update the table via a complex select + compare result. MSSQL

At the moment, my Update script looks like this. UPDATE [dbo].[myTable] SET [isOnlyProgrammerRoles] = CAST (CASE WHEN UserNam ... ample, the scrum master, then the isOnlyProgrammerRoles field should be assigned bit 0. How to organize such a role Update?