Questions tagged [sql]
Structured Query Language is a language for interacting with relational databases. Read the tag wiki's guidelines for requesting SQL reviews: 1) Provide context, 2) Include the schema, 3) If asking about performance, include indexes and the output of EXPLAIN SELECT.
1,463
questions
6
votes
2
answers
305
views
Extract a joined result set into a parent-child hierarchy
I'm writing a quiz application in PHP and am querying the DB for questions and their associated answers. I then wrangle the result set into a usable array for my front end. However, it always seems ...
8
votes
1
answer
528
views
Tame this Beast: TSQL Unpivot
Okay... here's the beast:
...
36
votes
7
answers
96k
views
Database design for a school system
This system has to manage students, teachers, staff and grading. This is for production and is not a school assignment. As such, please let me know if I can improve on any aspect. :)
My main concern ...
6
votes
3
answers
203
views
Return Data and Update Row without Multiple Lookups?
I have a stored procedure that looks up an article based on the article's title. But I also need to increment a column in the same table that counts the number of times the article has been viewed.
...
6
votes
1
answer
49k
views
Returning total number of rows in query
Oftentimes I find myself wanting the total number of rows returned by a query even though I only may display 50 or so per page. Instead of doing this in multiple queries like so:
...
11
votes
5
answers
2k
views
Simple ASP.NET C# class design
Here's a class I'm designing:
...
8
votes
2
answers
840
views
Extracting nodes from a graph database
I'm new to Postgres and PostGIS, but not to geospatial applications.
I have a table loaded up with graph data in the form of links (edges). The link database has about 60,000,000 rows. I am trying to ...
9
votes
2
answers
1k
views
Comparing data in 2 tables on different servers with CHECKSUM
So I've had a problem where I need to compare data in 2 different tables on two different servers. Now, I know MySQL supports CHECKSUM TABLES, but from my testing ...