Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts tagged sql

13 child tags

Use for questions about one or multiple Structured Query Language (SQL) flavours.

In order to get the most helpful answer your question should include the following:

- a specific SQL flavor tag (e.g. for MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2)
- table definitions
- sample data if needed
- expected result when query results are not what you expect

For general questions that are not targeting a specific SQL flavor, questions and answers should use ISO/IEC standard SQL.

This tag doesn't have a detailed wiki yet.

80%
+6 −0
Q&A Is there a naming convention for table aliases?

Sometimes, either to reduce the amount of typing big table names or when joining a table to itself one will need to alias a table. Personally I find SQL statements with aliases harder to read and a...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Alexei‭

75%
+4 −0
Q&A How can I generate documentation from comments in SQL DDL?

I have some SQL scripts that contain DDL to create tables and schemas for a database. I'd like to be able to comment this SQL and then use those comments to generate output documentation (in HTML)...

0 answers  ·  posted 3y ago by Monica Cellio‭  ·  edited 3y ago by Monica Cellio‭

81%
+11 −1
Q&A Why would excluding records by creating a temporary table of their primary keys be faster than simply excluding by value?

I have two tables with millions of records. Every so often I need to join them and exclude just a handful of records where a bit(1) column is set to 1 instead of 0. I can do it with either, WHERE ...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Alexei‭

60%
+1 −0
Q&A What is the rationale of having Cascade as a DeleteAction in EntityFramework.Core?

I have noticed some time ago that Entity Framework assumes a CASCADE behaviour (implicit value, if not specified) for referential constraints (FKs) when deleting items. This means that by default, ...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by Alexei‭

75%
+4 −0
Q&A Is there an equivalent way of returning early in a MySQL stored procedure?

In programming instead of arrowcode where one has many layers of indented if statements, you can return a result as soon as possible. So instead of, if if end if end if It looks like if ret...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Moshi‭

60%
+1 −0
Q&A What is happening under the hood to the selected data in a MySQL cursor?

I have a number of MySQL stored procedures that use a cursor to go through a select and then pass the results to other stored procedures one row at a time. This can take a while to run, what is hap...

0 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Charlie Brumbaugh‭

Question mysql
83%
+8 −0
Q&A Is there a way to estimate the execution time of a statement in MySQL?

From time to time I will have large structural changes to make on my MySQL DB, things like adding columns, changing datatypes, adding indexes etc. These types of changes result in downtime and what...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by meriton‭

Question mysql
60%
+1 −0
Q&A In a stored procedure, is it possible to get the total number or rows updated by different statements?

I have a bunch of stored procedures that look like something this CREATE PROCEDURE example() BEGIN UPDATE STATEMENT A; UPDATE STATEMENT B; UPDATE STATEMENT C; END// When I run them thr...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Alexei‭

71%
+3 −0
Q&A How long in days is a MONTH in MySQL?

If one finds where the past number of months equals the past number of days like this, select distinct DATE_SUB(now(), INTERVAL 92 DAY),DATE_SUB(now(), INTERVAL 3 MONTH) The numbers that are curre...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by r~~‭

Question mysql
33%
+0 −2
Q&A How do I find all the tables in a database that don't have a specific column?

I need to add one column with the same name to all of the tables in my database, how can I find which tables don't currently have a column with that name?

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Charlie Brumbaugh‭

Question mysql
50%
+1 −1
Q&A How to temporarily disable a MySQL user?

Sometimes I will need to temporarily lock out other MySQL users when I am making large structure changes and want to make sure that nobody else is inputting or changing the data. The other use case...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Charlie Brumbaugh‭

Question mysql
71%
+3 −0
Q&A Can renaming a MySQL column be sped up by dropping indexes or foreign keys?

I need to rename one column in 170 tables in a MySQL database and its going really slow. The columns all have an index plus a foreign key on them, would dropping the index/temporarily removing the...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by manassehkatz‭