Most voted "sql" questions
Structured Query Language (SQL) is a language to query databases. Questions should include examples of table code and structure. This tag refers to the default language, not to be used for questions about the implementation of specific DBMS (such as Mysql, Postgresql, Oracle, MS SQL Server). In this case use the specific DBMS tag. Answers to questions marked with ANSI SQL should use SQL as much as possible.
Learn more…6,771 questions
Sort by count of
-
-4
votes2
answers69
viewsHow do I extract the number of orders with 5 different items? I have this query but it is coming out a different result than expected
SELECT DISTINCT(pedidos.id_pedidos),produtos.nome_produto FROM pedidos INNER JOIN itens_dopedido ON itens_dopedido.id_pedido=pedidos.id_pedidos INNER JOIN produtos ON…
-
-4
votes1
answer62
viewsSimple question from PHP
I have this line in a code to connect to the database, but the following error appears: Code $con=mysql_connect("localhost","root",""); Error Fatal error: Uncaught Error: Call to Undefined Function…
-
-4
votes1
answer44
viewsHello, guys! I’m new to Database and have a question in Sql Managent Studio. How do I get out of here and proceed?
WHAT I ADD TO 'SERVER NAME'?…
-
-4
votes1
answer604
viewsSQL recursive using CTE
I am mounting an SQL statement using CTE (common table expression) and recursiveness, but I’m getting the following error: Message 530, Level 16, Status 1, Line 5 Instruction terminated. A maximum…
-
-4
votes0
answers21
viewsPeople with insert more than a million random lines in an SQL? database can be up to integers type 1 to 1,000,000
Insert into num values(1) example
sqlasked 3 years, 2 months ago Italo Freitas 1 -
-4
votes1
answer50
viewsSQL Foreign Tables and Attributes
Good afternoon, I made an Sql code with the following tables: create table Bairro( cdbairro int not null primary key, nmbairro varchar(80) not null )default charset = utf8; create table Aluno(…
sqlasked 5 years, 11 months ago Lucas Santana 11 -
-4
votes1
answer82
viewsSQL - How to filter only domains containing "Hotmail.com";
Write a select that meets the criteria below: 1° Filter only domains containing "Hotmail.com"; 2° Consider the contracts below; 683679 705126 715651 TABLE SELECT * FROM FDADOS_RE170(3,3) limit 12…
sqlasked 5 years, 3 months ago user157132 1 -
-4
votes1
answer149
viewsView photo registered in the bank
I want to display a photo registered in the database that was registered in a type blob attribute. However I do not want to display the photo through a link where you click and open the photo, on…
-
-4
votes1
answer22
viewsShow result of a sql by group query on PHP page
Good evening, this code works exactly the way I need to run directly in sql, but as I do for it to appear in a php page, I tried several things, I even managed to print but it does not appear right.…
-
-4
votes1
answer30
viewsError importing SQL wordpress database
When trying to import database the following error occurs: Erro Comando SQL: CREATE TABLE `wpzm_actionscheduler_actions` ( `action_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `hook`…
-
-4
votes0
answers52
viewsHow to insert multiple rows into a sql server, keeping all these rows in the same id
I am studying a program that lends equipment, in its proper functioning, when making a loan of material should be kept in the dbo.emprestimo all loan details (name, location, business, etc), then…
-
-4
votes1
answer21
viewsSELECT TWO COLUMNS THAT HAVE THE SAME ID IN DIFFERENT TABLES AND MAKE COMPARISONS
Good night Devs, I need to take each actor_id and film_id and check which total of movies(filme_id) has linked to actor_id and this I got : SELECT actor_id, COUNT(film_id) from film_actor group by…
-
-5
votes2
answers54
viewsI have a QUERY that doesn’t display what I really need
My Query: select id from clientes where cliente = '$cliente' AND status = '2' AND (tipo <> '0' AND (disponibilidade <> '0' OR vanual <> '0' OR vtemporada <> '0')) I need it…
-
-5
votes2
answers870
viewsWhat are the differences between a PL/SQL programmer and an Oracle DBA?
Could someone explain to me the differences between the programmer PL/SQL and the DBA Oracle? I know there are many differences, but I’m not sure how to specify them. I have some doubts too... For…
-
-5
votes1
answer265
viewsHow do I Inner Join with these tables?
How would the SELECT query in Mysql from the Inf_musicas table?…
-
-5
votes1
answer178
viewsError in SQL query with PDO
I can’t make the query, when I try to make it, I get the error: Erro PDOStatement Object ( [queryString] => SELECT userid FROM usuario WHERE email=:email and senha=:senha ) <?php…
-
-5
votes1
answer476
viewsSELECT SQL WITH WHERE "DOUBLE"
I am trying to make a query in the Mysql database with the following syntax SELECT id, codigo, faca, descricao, vendedor, imagem FROM produtos WHERE sit = 1 AND descricao = ESTE Even that part works…
-
-5
votes1
answer60
viewsI NEED HELP ORDERING A QUERY
I’m doing a query where I’m returning the last record of the day(which in case has the days but there are several time records in a day, and I’m picking the last of them in a sub select), the…
-
-6
votes1
answer45
viewsBasic Commands
Good afternoon. I’m new to the database and I can’t solve this solution Assemble a clause that performs UPDATE, for all employees who perform the function "Computer Programmer", changing its…
sqlasked 6 years, 4 months ago João Vitor Castilho Gamba 1 -
-6
votes2
answers43
viewsQuery to know which books students do not have, in SQL
Good, I have the following tables Livro: ID_Livro PK Nome Aluno: ID_Aluno PK Nome RegistoLivroAluno: ID_Registo PK ID_Aluno (chave extrangeira de Aluno) ID_Livro (chave extrangeira de Livro) ) I…
-
-7
votes2
answers117
viewsHelp with SELECT for the Acuity exam
I need help with a college test. I’m new in SQL, and I need to do well on this test. I wonder if someone could help me form this SELECT correctly? I don’t even know where to begin, so I really…