« first day (1304 days earlier)      last day (1354 days later) » 

Tom
4:42 AM
Brand new to the chat so I don't know the protocol: I've been searching for an answer and can not find it.

Can MySQL files be read during mysqldump lock tables.

As long as php: SELLECT * FROM ... retrieves the data then there is no down time.
 
4:58 AM
@TehShrike thats cool,but how to reference a price column I mean make it as a foreign key ? it's should be done through MySQL InnoDB engine or you think better I do it thought php by putting the price into variable in PHP then put the variable inside insert statement into the line-item table.
 
5:37 AM
@TehShrike hi currently restrticted meant no view privileges
 
 
8 hours later…
1:33 PM
@user285oo6 you want to list all views that you currently have permission to select from?
@Tom mysqldump only read-locks tables as it's reading them - unless you use the lock-tables option which read-locks all the tables in the database. A read-lock is the kind of lock caused by reading - other reads can occur while a table is read-locked, but writes can not occur.
@osamaalbanna it wouldn't be a key, the price column would be a value in both tables
It would be a DECIMAL in the inventory table, and DECIMAL in the lineitem table. Say the price of item 5 in the inventory table was $13.37. Somebody buys it, so you insert a lineitem with the same price, 13.37. Then later, somebody changes the price in the inventory table to 16.66 - but the lineitem's price stays the same.
Now, you will want your lineitems to have an inventory_id key linking to the inventory record, but you'll need to store the price too.
 
1:57 PM
I'm creating a photo uploading site for internal use. I'm guessing there will be less than a million photos in the database and around 10000 users.
Would it make sense to keep two image tables for user profile pictures and uploaded photos? Either from a
...wow, this chat doesn't impress...
Anyway, would there be any performance improvement keeping two different image tables? And I'm only asking about the tables for the actual images, not the information on it.
I'd either have this setup:
UserTable, PhotoTable, ImageTable
..or
UserTable, PhotoTable, UserImageTable, PhotoImageTable
 
@TehShrike thanks man yeah exactly ,I read about some cases that using a foreign key is not applicable in database like in my case.
 
@Niklas what would the difference be between profile pictures and uploaded photos? Would the columns be different between them? My instinct would be to use the same table for both
@osamaalbanna well, you do need foreign keys
But in the context of price it doesn't even make sense
If you had a "price" table that just stored prices, then you would have a foreign key to that
And in this case, you have an "inventory" table that you'll want a foreign key to
But you can't have a foreign key to a single value in a another table
 
Does anyone know what I'm missing here?
0
A: SQL Converting from scientific notion to string

UndoFrom the MSDN Developer Forums: select str(cast(YTD as real) ) from TABLE So if the results from the above look right: Update TABLE SET YTD = str(cast(YTD as real) ) Edit: It turns out that you need to explicitly tell SQL that this is what you actually want to do: BEGIN TRANSACTION Update...

Specifically around transactions and committing them?
 
@TehShrike No, there wouldn't be any difference between them. I'd just keep basic image information in the table and nothing domain-specific.

I'm partly curious about performance (my guess there's none really) but also curious as if there could be any drawbacks in mixing these images. But to answer the last question I guess you'd need more domain knowledge...
I guess I just needed to vent my thoughts somewhere :)
 
2:12 PM
@Niklas no worries :-)
@Niklas yeah, there are advantages to having them in the same table.
Mostly in sanity and code-writing. It gets way uglier than you think to be checking multiple tables to get the same objects
 
Yep, I'm with you on that. Will probably go with having them in the same table. Thanks for he support ;)
 
@Undo did you commit the transaction in which you did those updates?
 
BEGIN TRANSACTION UpdateScinot

Update TABLE
SET YTD = str(cast(YTD as real) )

COMMIT TRANSACTION UpdateScinot
GO
 
what do you see if you just SELECT str(cast(YTD as real) ) ?
 
He says it looks fine @TehShrike
That seems to have the correct output with the select statement. However when I do the Update statement and then do a select * from table it still shows the original? — user3532047 28 mins ago
I can't figure out what the heck is going on.
 
2:24 PM
oh hah, you're the answerer, not the questioner
right
do you have the ability to "ask him to chat" or whatever that feature is?
 
Probably
Actually, no
he's a 3-rep user
 
 
9 hours later…
11:33 PM
Hello guys, feel stupid for even asking this question. but:

SELECT `bids`.`bid_for`, `request_quote`.`quoteby` FROM `bids` GROUP BY `bids`.`bid_for`
LEFT JOIN `request_quote` ON `request_quote`.`quoteid`=`bids`.`bid_for`

Can someone point out to me why I get #1064 on this?
 
@galdikas yup! And in fact, the error message itself probably points it out
It should tell you the part of the query that causes the issue
Can you paste the full error message?
 
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN request_quote ON request_quote.quoteid=bids.bid_for LIMIT ' at line 2
I have no idea, I see nothing wrong at line 2, I wrote more complicated queries in my life, and it worked. Maybe its just because it is so late where I am lol
 
@galdikas it's the LEFT JOIN that's throwing it
 
so? I need to use different type of join?
 
nah, as the SELECT docs say, GROUP BY sections have to go after all table references.
this is a reasonable example of why I like to add newlines before every clause
the problem's a bit easier to see written out like:
SELECT `bids`.`bid_for`, `request_quote`.`quoteby`
FROM `bids`
GROUP BY `bids`.`bid_for`
LEFT JOIN `request_quote` ON `request_quote`.`quoteid`=`bids`.`bid_for`
 
11:47 PM
oh god, never would of thought about it. I need to start looking at these docs more seriously
 
yeah, I'd recommend setting up a custom search in your browser
 
Thanks a lot! You're a star! Ill just try this now
 
So you can just type m [search query] to search the docs
 
What you mean by that?
 
That's what I do, it makes me seem a lot smarter :-)
When I forget something, I just go to the url bar in Chrome
and type m select syntax
and then hit enter, and Chrome calls up my default search engine to search for site:dev.mysql.com/doc/refman/5.5/en/ select syntax
 
11:48 PM
wow, where do I set that up?
 
what browser do you use?
 
chrome
 
Right-click the url bar, go to "edit search engines"
 
so this like makes it use the search of mysql docs
 
add another "other" search engine named MySQL with a keyword "m"
copy the url string from whatever your favorite/default search engine is
but instead of just the %s, use site:dev.mysql.com/doc/refman/5.5/en/%20%s
 
11:54 PM
I think ive set it up
Thanks man!
 

« first day (1304 days earlier)      last day (1354 days later) »