sql

SQL-Join Task + Where(Having) + Group By

Display a list of passengers who have made at least 1 flight, sorted by the number of flights (in descending order). Fields ... tand what the error is. The system says that the solution is not correct, although it seems to me that everything is correct.

Invalid completion of the SQL statement

There is a request SELECT * FROM SMSPECREFUSE WHERE REASON= 'Недопоставка' It works correctly and outputs what you need. If ... age', 'item Exchange', 'Short time', 'Failure to follow orders', 'not ready for public consumption' at the end of the error:

Define a SERIAL (AUTO INCREMENT) column in postgresql

How to use a query in the information schema to determine the serial column by specifying the required table. Upd.Solution: SELECT * FROM information_schema.columns WHERE table_name='test' and column_default like 'nextval%'

Updating DB records in a many-to-many relationship

Learning SQL. I have a table products_to_colors it links 2 tables colors and products, a many-to-many relationship. Contains ... rmation on SQL (especially postgres) on the internet, especially examples. It is not clear how to learn to write good code =)

Create a PostgreSQL database using an SQL script for a java application

I am making an application on Java with a small local database and I need this database to be created using an sql file. That ... maintainer SUPERUSER CREATEROLE CREATEDB; Tell me, will it work and create a database and if so, how do I run this script?

IDE for writing SQL table structures

Tell me a good IDE(if there is one) You need not only syntax highlighting, but also highlighting possible errors in the code. ... important thing is autofill: names, types, attributes, etc. I use phpDesigner but there is no autofill in SQL, unfortunately.

How do I create a table in a database? (PHP+MySQL)

Hello! I found video lessons on the course Apache+PHP+MySQL on the Internet, but all the actions take place there, as I und ... завершено"; else echo "Таблицу создать не удалось"; } ?> But still nothing works, and it doesn't create a table...

Output of a TIME string from sql in python

Trying to output a table via python def verification(): connection = DataBase.getConnection_log() try: ... | time | YES | | NULL | | +--------------------+--------------+------+-----+---------+-------+

MySql & phpMyAdmin

I have an Open Server installed on my computer and use it to launch a web page from which data should be entered not in its d ... ault phpmyadmin settings from Open Server. I only changed the port to 3307. Server: 127.0.0.1:3307 "Database: a_db "Table: aa

SyntaxError: Non-ASCII character '\xd1'

I wrote the following code conAcc = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=D:\ThirdTask\Northw ... no encoding declared; see http://www.python.org/peps/pep-0263.html for details What should I do to make the error disappear?

SQL Insert or Update

Is there any function that would add values to the database if there are no values with a specific id, and update if the valu ... hen, if it exists, then we perform update, and if not, then insert. Or is there another option, without unnecessary requests?

Complex ORDER BY in a MySQL query

The database has a list of ads. Each ad has user_id (the ad author) and flag. You must first display ads with user_id = 7, 9 ... complication is that the request has a limit of 10, since the remaining ads are loaded by Ajax in portions of 10 (lazyload).

SQL query with JOIN (task)

There is a task: A father always has only one son. Sons, in turn, can also be fathers. Requests: (1) get the user together ... it was intended, from which the conclusion is that I am doing something wrong, I could not understand what is wrong myself.

Creating a local Database for a Java program

I want to make a Java program for compiling pedigrees, genealogy classes. And I need that when creating a new project, a data ... a database based on SQL queries, but I do not know how. Or perhaps someone can advise a more convenient method for this case.

How can I write the result of executing an SQL script to the log?

I use it to run on a remote machine .bat, which calls SQL * Plus and executes the script. In the log, only the result of the ... em.log I want to see not only the execution notification, but also the result of executing the request select * from table;.

Why is the request executed under Windows, and under Linux error: "ORA-01722: invalid number"?

There is a Python / SQL script that is written under Windows. Everything is elementary simple, I execute the request and do ... rsor.execute(_SQL) Under Windows-everything is fine, and under Linux-an error Which way to look? What could be the problem?

Relationships between tables. SQL Server

Tell me if I'm starting to build the database correctly: So far there are 3 tables: dbo.Exam, dbo.Offset, dbo.Session. The ... straint id primary key(SessionId, ExamId, OffsetId) ) P. s how can I then refer to id dbo.StudentSession from other tables?

It is not possible to arrange connections by MSSQL keys

Hello, there is such a problem, I want to put a connection from fact to dimension2 by the KOATUU key and from dimension3 to d ... ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

Why in MySQL (MariaDB) does the loop not work even in the procedure?

2 UPDATE: Something to think about: delimiter ;; drop procedure if exists test2;; create procedure test2() begin select ‘He ... t do it... I ask the moderators and users to help in this matter, and not to give the tag duplicate and set downvote. Please!

How do I update all id fields with a single request?

Let's say there is a table articles with the fields id,title,text.id this is a field with auto-increment, but in this field t ... in one query to order its values, and the second request to restore the field title, this is for training purposes, you need