Structured Query Language (SQL) is a language for managing data in relational database management systems. This tag is for general SQL programming questions; it is not for Microsoft SQL Server (for this, use the sql-server tag), nor does it refer to specific dialects of SQL on its own.
-1
votes
2answers
97 views
Best practices for rotating large datasets?
[edit]Turns out there's 1.5 million records... The SQL database is taking about 17-20 seconds to run the query. Would it be best to have Java handle the joins and rearranging in that case? Since this ...
1
vote
1answer
39 views
What's the best approach to building a db schema for profile, but to track changes?
I'm working on a site where companies can create a profile then add locations for each profile.
Those first two tables are simple enough.
But any changes to their profiles or locations have to go ...
4
votes
2answers
279 views
Logic design question for SQL query
Was wondering if you could help me on a SQL problem I’m having.
I have a set of records of events where each event has a start time and end time. No event has the same start time, and the end time ...
1
vote
0answers
51 views
Which of these two methods is standard when creating a 1 to many database relationship? [migrated]
If I have a customer that can have many addresses, I can create an Address table with columns Street, Town etc. and CustomerId. Then I can insert multiple records to have multiple addresses per ...
2
votes
5answers
190 views
Is SQLite a sensible option for data logging?
I am trying to setup a small data-logging application under linux. The data arrives via serial port, and from there it should be pumped to logging and to graphical display.
The logging functionality ...
1
vote
1answer
59 views
Status update & news feed database design / architecture
Imagine a application similar to Facebook, where you have status updates and a news feed. The names and profile pictures can be changed. There are also several different types of updates requiring a ...
0
votes
1answer
56 views
Different ways to generate the latest int type primary foreign key in code
I am new to sql. I have added 2 new tables in database. The primary key of first is a foreign key in the other. The type of the keys is integer. Now I want to generate the keys in the code and assign ...
3
votes
2answers
200 views
In what order are rows fetched absent ORDER BY clause?
One programmer is testing and comparing the same application which uses the same database structure, and the same data, only in two separate databases, one with Oracle 8 and one with Oracle 9.
The ...
1
vote
1answer
115 views
Are there any SQL servers that support compiled queries?
Can SQL queries be compiled into byte code or equivalent to enhance performance?
I know that most database servers support prepared statements, but is that the same thing as compiling? Most ...
1
vote
1answer
152 views
JOIN vs. INNER JOIN and FULL OUTER JOIN
I know there is a difference between INNER JOIN and FULL OUTER JOIN, I can see it, but, what is the difference between the two following: JOIN ... ON... and INNER JOIN...ON... and still yet ...
18
votes
2answers
754 views
SQL IN() versus OR
I was working with a query I wrote today had to change the code from the WHERE clause to use a IN(list of stuff) filter instead of using something like
item_desc = 'item 1'
OR item_desc = 'item 2'
OR ...
3
votes
1answer
307 views
Rewriting C# Formula Calculations in T-SQL
We have a 3-tier application with a C# client that connects to a C# web service via WCF and requests data from a SQL Server database.
One feature in our application is a user-created form app in ...
3
votes
5answers
273 views
Need thoughts on a course curriculum for an entry-level programmer [closed]
Would love to know your thoughts on a curriculum that will be developed for people that want to get started in the programming field. The goal of the course is to help it's students to ensure that ...
0
votes
2answers
180 views
Multiple calls to Datetime.Now results in timestamps not in chronological order [closed]
I have a unit test that creates two objects each having a DateTime property called Created. Despite creating the objects and setting their Created times in chronological order, the Created times are ...
1
vote
1answer
77 views
What is better: multiple sql entries or one sql entry with a list field?
Suppose that I have the following logical information:
(tag_name, id). For example: (food, 1),(food, 2),(food, 3),(drink, 1),(drink, 2)
I'm trying to decide what is the best way to store it in a ...