Structured Query Language (SQL) is a language for querying databases. Questions should include code examples, table structure, sample data, and a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2, etc.) being used. If your question relates solely to a specific DBMS (uses specific extensions/features), use that DBMS's tag instead. Answers to questions tagged with SQL should use ISO/IEC standard SQL.
I am trying to learn the best way to write queries. I also understand the importance of being consistent. Unti
What is the (default) charset for: MySQL database MySQL table MySQL column
Is it possible to temporarily disable constraints in MySQL? I have two Django models, each with a foreign key
SELECT id, amount FROM report I need amount to be amount if report.type='P' and -amount if report.
I want to do a full outer join in MySQL. Is this possible? Is a full outer join supported by MySQL?
I have searched and searched for an answer to this, and I think this must be child's play for anyone who
How can I quickly remove all rows in the table using Entity Framework? I am currently using: var rows = from o
I want to save my Edit to Database and I am using Entity FrameWork Code-First in ASP.NET MVC 3 / C# but I am g
I use postgresql and yii2 framework. Well I got a very interesting error message: SQLSTATE[23502]: Not null v
Is there a way to ensure all values in an IN clause are matched? Example: I can use IN as: IN (5,6,7,8). I
Which one: datetime datetime2 is the recommended way to store date and time in SQL Server 2008+? I'm a
I want to query the name of all columns of a table. I found how to do this in: Oracle MySQL PostgreSQL But I a
I need to remove a highly referenced table in a SQL Server database. How can I get a list of all the foreign
I'll use a concrete, but hypothetical, example. Each Order normally has only one line item: Orders: Or
I have seen SQL that uses both != and <> for not equal. What is the preferred syntax and why? I like !=
My table is: id home datetime player resource 1 10 04/03/2009 john 399 2 11 04/03/2009 juliet 244 5 12 04/03/
We all know that to select all columns from a table, we can use SELECT * FROM tableA Is there a way to excl
I've been learning Functions and Stored Procedure for quite a while but I don't know why and when I