Question for those who have database querying knowledge

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Badmaash
    Confirmed User
    • Jan 2007
    • 2695

    #1

    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
    best cbd oil uk - Hit me up on ICQ 400607632
  • the Shemp
    congrats to the winners
    • Nov 2001
    • 10891

    #2
    is there a user interface ...?
    i use Vacares...so should you
    Submit your picture galleries to my site...Outlaw TGP

    Comment

    • Badmaash
      Confirmed User
      • Jan 2007
      • 2695

      #3
      Originally posted by the Shemp
      is there a user interface ...?
      No idea.... have not taken up the job yet just doing research into the potential job

      1. Lets say you have one

      2. Lets say you dont have one

      Thanks
      best cbd oil uk - Hit me up on ICQ 400607632

      Comment

      • Prasawet
        Prasawet
        • Nov 2009
        • 65

        #4
        Or can you run a query that gives you all the information?
        Such a (mysql) query just don't exist, realtionships beetween tables could be anything but usually is beetwen id's.
        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.
        Last edited by Prasawet; 02-25-2014, 12:12 AM.

        https://caldasesso.com/

        Comment

        • Badmaash
          Confirmed User
          • Jan 2007
          • 2695

          #5
          Originally posted by Prasawet
          Such a (mysql) query just don't exist, realtionships could be anything but usually is beetwen id's. 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.
          So are you saying that if a DBA took up a job at a new company, they should provide him/her without the schema on document form?

          Thanks

          B
          best cbd oil uk - Hit me up on ICQ 400607632

          Comment

          • EddyTheDog
            Just Doing My Own Thing
            • Jan 2011
            • 25433

            #6
            Software like the stuff here would help a lot...

            http://www.sqlmaestro.com/

            Comment

            • myleene
              Confirmed User
              • Oct 2013
              • 906

              #7
              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.
              Last edited by myleene; 02-25-2014, 12:15 AM.

              Comment

              • Prasawet
                Prasawet
                • Nov 2009
                • 65

                #8
                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.

                https://caldasesso.com/

                Comment

                • Badmaash
                  Confirmed User
                  • Jan 2007
                  • 2695

                  #9
                  Originally posted by Prasawet
                  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.
                  Yes, it is mysql

                  what do you mean except in diagrams
                  best cbd oil uk - Hit me up on ICQ 400607632

                  Comment

                  • Badmaash
                    Confirmed User
                    • Jan 2007
                    • 2695

                    #10
                    Originally posted by Prasawet
                    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.
                    Apparently if you are using Innob tables then it does support foreign keys:

                    http://dev.mysql.com/doc/refman/5.1/...eign-keys.html
                    best cbd oil uk - Hit me up on ICQ 400607632

                    Comment

                    • Barry-xlovecam
                      It's 42
                      • Jun 2010
                      • 18083

                      #11
                      You mean this?

                      Code:
                      [FONT="Courier New"]barry:~$ mysql -u****** -p*******
                      Welcome to the MySQL monitor.  Commands end with ; or \g.
                      Your MySQL connection id is 1016
                      Server version: 5.***************************
                      
                      Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
                      
                      Oracle is a registered trademark of Oracle Corporation and/or its
                      affiliates. Other names may be trademarks of their respective
                      owners.
                      
                      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
                      
                      mysql> show databases;
                      +--------------------+
                      | Database           |
                      +--------------------+
                      | information_schema |
                      | models               |
                      | mysql                |
                      | test                    |
                      +--------------------+
                      11 rows in set (0.00 sec)
                      
                      mysql> use models;
                      
                      mysql> show tables;
                      +------------------+
                      | Tables_in_models |
                      +------------------+
                      | modelData      |
                      +------------------+
                      1 row in set (0.00 sec)
                      
                      
                      
                      mysql> SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = 'models';
                      +-------------+--------+
                      | TABLE_NAME  | ENGINE |
                      +-------------+--------+
                      | modelData | INNODB |
                      +-------------+--------+
                      1 row in set (0.06 sec)[/FONT]

                      http://dev.mysql.com/doc/refman/5.1/en/alter-table.html

                      ALTER TABLE changes the structure of a table. For example, you can add or delete columns, create or destroy indexes, change the type of existing columns, or rename columns or the table itself. You can also change characteristics such as the storage engine used for the table or the table comment.
                      Code:
                      [FONT="Courier New"][B]mysql> ALTER TABLE table_name ENGINE = INNODB;[/B][/FONT]
                      Just make it work :P

                      Nice references website

                      http://mysqlresources.com/documentation/db-table-schema

                      Comment

                      • woj
                        <&(©¿©)&>
                        • Jul 2002
                        • 47882

                        #12
                        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....
                        Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
                        Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
                        Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

                        Comment

                        • Why
                          MFBA
                          • Mar 2003
                          • 7230

                          #13
                          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.

                          Comment

                          • freecartoonporn
                            Confirmed User
                            • Jan 2012
                            • 7683

                            #14
                            what ^^ said.
                            SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean

                            Comment

                            Working...