access multiple my sql database at a time? [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
how can i access multiple my sql database at time, what is the mechanism behind it?????
eg: i have three different database that contain product(shoes) along with price and there description etc...
so whenever the user type shoes and set its price ... my search bar should be able to retrieve the data in respect of price.. from multiple database..

You can use like
Select * FROM database1.products WHERE field = ?
UNION ALL
SELECT * FROM database2.products field = ?
UNION ALL
SELECT * FROM database3.products field = ?

Related

Is there a faster way to add new column data with hundreds of rows? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 11 months ago.
Improve this question
I have a decent-sized table 'countries' with about 10 columns. I recently added a new column to the table 'GDP' and I am entering the information per row using
UPDATE countries
SET GDP=(value)
WHERE name = (country);
I have 200 countries in this table. Is there a better way to update this information?
This project is from Khan Academy. We are asked to select a database and run queries on it. The data was pulled from https://gist.github.com/pamelafox/ad4f6abbaac0a48aa781
I am just making sure that there isn't a more efficient way of adding this information to the existing table 'countries' where the primary key is the name of the country.

How to compare data in SQL [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have an application which is taking data from questionnaires users are completing on a website and inputting this into a SQL Lite database.
I'm using Django and would like to display data of users who match closest by selecting similar answers.
How could this be done?
You can add multiple join conditions like this
SELECT *
FROM <table>
INNER JOIN <same table different name>
ON (condition1 OR condition2 OR condition3)

Simple select query running slow [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have about 1000 entries in table. It's simple table with 10 columns. Query:
SELECT * FROM my_table
server runs the query, but is processing it for a long time.
P.S. I know this is not enough info, so please comment and I will add what is needed.
Got it. Not related to SQL. Server got overflown by data. Someone was spamming it.
You can try to use TOP. For example try to select 100 rows and look if server still stucks:
SELECT TOP 100 * FROM my_table

SQL Server 2008 Replace substring [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a Screen table which has name and display_name columns. I am trying to replace the word Lawfirm with Law Firm in name and display_name columns for all the records of Screen table.
My SQL experience is pretty premature, I am wondering is there a way to achieve this using a SQL script?
Yes, you can do this:
update screen
set display_name = replace(display_name, 'Lawfirm', 'Law Firm')
where display_name like '%Lawfirm%';

like query for searching a multiple word in table column in sql [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have table named 'categories' and it has one column name 'catvalues' with values see example below:
catvalues
------------------------
Party wear,Plain,Classic
Party wear,Plain
Party wear,Classic
now i want like query which when i search for 'Party wear,Classic' it should return 2 rows like below:
catvalues
---------------------------
Party wear,Plain,Classic
Party wear,Classic
maybe something like...
SELECT * FROM table
WHERE catvalues LIKE '%Party wear%Classic%'
but i really need more info about your questions
This sounds like your trying to put to much information into one column.