sql

How to add LINQ to SQL query results to Observable Collection?

In WPF app I have an Observable Collection which is connected through databinding with ListView. I would like to populate this Observable Collection from LINQ to SQL query, but with no success. In fact my code even doesn't compile (I pointed out the problem lines with comments). The structure of underlying Observable Collection Class i...

Do I need a second table for this database logic?

Hi folks, Firstly, this DB question could be a bit DB agnostic, but I am using Sql Server 2008 if that has a specialised solution for this problem, but please keep reading this if you're not an MS Sql Server person .. please :) Ok, I read in a log file that contains data for a game. Eg. when a player connects, disconnects, does stuff...

SQL Server - something available to practice dev for beginner

So this might be a ridiculous question, but I don't know so that is why I am asking: I would like to practice some C#, and get some basic familiarity with the IDE for SQL Server. Is there some fake version of SQL server that I can download to practive with?? thanks! ...

Regex for doubling single quotes in string

Hi I would like a regex that would make this: VALUES('Hit 'n Run') into VALUES('Hit ''n Run') Is this possible? ...

Count number of times a date is in DB

Hi Im looking for some help creating a graph using the google chart API I have some idea of how i want to code it, but i need help turning psuedo into real code. I have a database with site users. Each user has a date that they joined. I want to count how many people join on each date, then put this into a string for the google chart ...

SQL to calculate the Tanimoto Coefficient of several vectors

Hi, I think it's easier to explain my problem with an example. I have one table with ingredients for recipes and I have implemented a function to calculate the Tanimoto coefficient between ingredients. It's fast enough to calculate the coefficient between two ingredients (3 sql queries needed), but it does not scale well. To calculate ...

SQL Query Help needed

Hi What I want is selecting the univirsities where student satisfy major high school type ,min gpa, min general tests scores (Qiyas and Tahsiely) and some other subjects (courses) scores. here is the database(SQLSERVER) http://sites.google.com/site/famu79/db.zip I tried this SQL Code SELECT DISTINCT univirsities.uni_id ...

Meaning of "Select tables optimized away" in MySQL Explain plan

What is the meaning of Select tables optimized away in MySQL Explain plan? explain select count(comment_count) from wp_posts; +----+-------------+---------------------------+-----------------------------+ | id | select_type | table,type,possible_keys, | Extra | | | | key,key_len,ref,rows | ...

What is the difference between single and double quotes in SQL?

What is the difference between single quotes and double quotes in SQL? ...

generation of sql queries on tables

(for sql server - in sql server management studio) I am having a few tables in my db with some data in those tables. I want to to transfer that data to my server; on that server I can run SQL queries. How can i generate the SQL to this? ...

how i can do this SQL Query ??

hi i have Employees Table (Eno, FName, Lname, DOB, Tell, Address, Salary, Pno, Bno) //Clients Table represents all data about a client // CID is number of client Clients Table(CID, FName, LName, Address, Tell, Cbalance,...) // Movement Table represents all tasks the client can do // MID is number of movement // M_type is t...

Simplifying an inequality for an SQL query.

For reference, this question was boggled, so thanks to everyone who helped unboggle it. I'm trying to locate potential collisions of events in a booking program where events have varying lengths. (a ≤ x && e ≥ y) || (a ≥ x && e ≤ y) || (a ≤ x && e ≤ y) || (a ≥ x && e ≥ y) I'm using DataMapper to accomplish this, but the query I had be...

Expanding mySQL query to include more content

I have a MySQL query that selects content created by friends of the current user and lists that content in reverse chronological order. SELECT node.nid AS nid, node.created AS node_created FROM node node LEFT JOIN user_relationships user_relationships ON node.uid = user_relationships.requestee_id LEFT JOIN users users_user_re...

field type for unix timestamp

Whats the best field type to use for unix timestamps? Will int(10) be enough for a while? ...

sql selection from one-to-many table

Hi, I have got 3 tables with those columns below: Topics: [TopicID] [TopicName] Messages: [MessageID] [MessageText] MessageTopicRelations [EntryID] [MessageID] [TopicID] messages can be about more than one topic. question is: given couple of topics, I need to get messages which are about ALL these topics and not the less, but t...

The max value of several columns (date and cost relationship)

How do you return the max value of several columns (date and cost relationship)? TableName [ID, Date1, Cost1, Date2, Cost2, Date3, Cost3] I need to return something like this: [ID, Most Recent Date, Cost] I need to return something like this: ID Most Recent Date the Cost related to the Date (if the most recent date is Date1 so th...

System.Web.HttpException was unhandled by user code. Message="A field or property with the name

I am getting the below exception when I run my ASP.NET/C#/SQL project on an XP box: System.Web.HttpException was unhandled by user code Message="A field or property with the name 'DisplaySchemaTables()' was not found on the selected data source." Source="System.Web" ... Can u advise me on what the problem might be? Here is the code c...

SQL Server Analysis Services - Do I have it?

Hi I have access to SQL Server at work and I've heard some interesting things that can be done with SQL Server Analysis Services. How do I know whether analysis services is running? Is it installed by default on the server? Would it be installed locally on my machine? Forgive what probably seems like a pretty dumb question, but I couldn'...

is_dirty VS last_modified_date in a db?

I am designing my database so i can do incremental backups. I am thinking there should be a weekly cron job that dumps data in a read only tar.bz2 and can dump most of my data easily since its had a modified date or is insert only. However there are some things like user_profile which holds the password and signature. How should i know w...

incremental backups on SQL Server and mysql

One user has said to me Applying incremental db backups is tedious, and a royal pain if you miss a step. I wouldn't bother with the approach on SQL Server or MySQL - that's what transaction logs are for, so you don't need to incorporate it into your data model So if i have transactions on mysql or sql server i can have ...