![]() |
Question for those who have database querying knowledge
Hi
Let say you know how to apply queries to a database and you land yourself a job. Now your job is to query the DB, but without knowing what it looks like and all the relationships between the tables how are you suppose to query it? Is the company suppose to give you documentation showing in graphical form what the tables look like and how they are linked? Or can you run a query that gives you all the information? Thanks B |
is there a user interface ...?
|
Quote:
1. Lets say you have one 2. Lets say you dont have one Thanks |
Quote:
Look for the views, that could be kind of graph about realtionships. If there is no documentation they are in a deep trouble. In that case you will have to dive into website code and find what is calling what. |
Quote:
Thanks B |
|
This?
http://onewebsql.com/blog/list-all-tables SQL Server or SqLite aren't included in these examples, but there's usually a way to do it whatever the database is. There's usually also a way to get database relationships. As mentioned, a GUI is usually preferred as it may also be able to show them well visually. (*) These examples haven't been tested and are only to show it's possible. |
Again, if it is MySql, that doesn't support foreign keys, you don't link the tables anywhere except your diagrams and queries. If there is saved queries (known as views) that can help.
Without that (diagrams or at least saved queries) that could be nightmare, in that case only the code (php or what is used) can show you possible relationships. |
Quote:
what do you mean except in diagrams |
Quote:
http://dev.mysql.com/doc/refman/5.1/...eign-keys.html |
You mean this?
Code:
barry:~$ mysql -u****** -p******* Quote:
Code:
mysql> ALTER TABLE table_name ENGINE = INNODB; Just make it work :P |
for anyone who has been around a block a few times, 99% of the time it's pretty obvious what the relationships are ... and if that fails, you can always look at the queries....
|
describe database;
describe table; will do most of what you need, however there are a lot of places to "hide" things in mysql(stored procedures, as an example), which is why documentation should be kept. |
what ^^ said.
|
All times are GMT -7. The time now is 05:35 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123