SQL Best tips/Do's and Dont's

Hi All
Can anyone has presentation material about whats the best practices to write SQL Queries in 9i. Like we should not have function on the column on left side of the where clause(it will not use index or else we need functional indexes.)
If anyone has such king of Do's and Dont's for SQL Please tell me the location or mail it across to me. my id is [email protected]
Rgds
Rohit

I agree.
Even more, I'm finding The Art of SQL (http://www.oreilly.com/catalog/artofsql/) and the SQL Cookbook (http://www.oreilly.com/catalog/sqlckbk/) to be useful. The former goes into the Why for the various dos and donts, and the latter goes into how to do the Dos in different dialects.

Similar Messages

  • What is the best tips for privacy and security

    How can you secure your email and phone messages

    And don't forget the passcode or you will be erasing the phone if you forget it. Use a complex passcode rather than the simple four digit PIN. These can be cracked in no time should you lose your phone.

  • Best pracitice while doing implementation like do's and dont's

    hi all,
    I am into implementation, for configuration in spro is there any book or pdf on best practices..like company code and plant should be copied from other or certain documents number range should be internal or storage location should not copied.
    For sap implementation what are all the do's and dont's.
    Thanks & Regards,
    vatsan

    Hi,
    SAP Implementation Projects and also provides list of Do's and don't s during project implementation as follows.
    Do's :
    1.Over-communicate to management, regarding the happenings in the project. Keep all higher-ups updated
    2.Document all the discussions and decisions taken in the meetings as MOM and archive all the MOMs
    3.Be handy with the status for higher management. They donu2019t like too much details, be creative summary presentation
    4.Have one-one meetings with team member at least once a month. It is good even if it is informal
    5.Pick and choose your resources during initial stages, try to remove the non-performers
    6.It is better to over-book the resources, compared to under-booking
    7.Coach and build the leaders from the team
    8..Request for the details during estimation and always add buffer for the schedule.
    9.Ask as many questions as possible to your delivery team to get more control over the situations.
    10.Think laterally for the solutions. Networking would be best solutions sometimes. Use your contacts
    11.Control scope completely. Freeze the requirement before development and detect any changes later and determine it as change and handle it
    12.Sense the delay in the delivery schedule and announce to the customer regarding the delay in delivery and reasons for the same.
    Don't :
    1.Never commit if you are not sure. Buy time if needed
    2.Never be carried away by emotions
    3.Never be controlled by anger and frustration
    4.Never shout/let them down in front of their co-workers
    5.Never under/ overestimate your team. Be sure of what are their abilities and inabilities
    6.Never miss/be late for any scheduled meetings, if unavoidable, inform the meeting chair
    7.Never compromise on quality, donu2019t ignore it while scheduling and estimating as well
    8.Never immerse into one particular issue. Be over it
    9.Never commit/ promise without consulting your immediate juniors. After all they are the once who execute Never ignore any mail from customer/ senior management
    Hope, it is useful for you.
    Regards,
    K.Rajendran

  • Grid monitroing  best practices do and dont

    Hi
    I would like to know your thought and experience: do and donts , specially on following ...
    * monitoring target host / linux
    *using default template,
    what are pitfalls?
    another question about default template is.. i would like to set default template for target type db, but db could be a standby/rac/stand alone ( i have diffrent type of templates for each of those) how can i set default template based on db type? can i create one template that has all metrics regardless whether db is rac/primary /standby and aply to all by default? is this is how it should be done?
    grid v11g
    thanks

    Hi
    But Grasshopper wants to know what is the minimum amount of
    statistics that correctly describes the data. I realize that this
    "depends", but that is not an answer.If you compare the data with the statistics you know if you have good statistics or not.
    Once you have a good set you have to reduce the gathering load to the minimum while keeping the good statistics.
    the Support Analyst was conceding that Oracle "out of the box"
    does not do a very adequate job of gathering the "minimum
    amount of statistics that correctly describes the data"I don't agree. In fact "out of the box" Oracle gathers:
    - to much statistics (too much histograms)
    - it's to "aggressive" with estimate percent
    You end up with a gathering that is too slow and that provides too much information to the CBO (slowing it down as well).
    Usually if you have a problem with the automatically installed job is because you have a large database and your statistics impacts your business.
    But if we can come up with a policy or method whereby we can
    say with certainty that the extra 5-10% is definitely not an issue
    with statistics, or even decrease those errant queries to <1%,
    I would consider our tuning efforts a success.My motto is "Start with a simple solution! If it doesn't work, elaborate it.", i.e. it's simply overkill implementing a solution that is fine in 100% of the cases.
    In other words I advice to use the default gathering, eventually with few parameters changes, in most of the cases. And only when there's a problem you should switch to manual (and this, eventually, for few tables or schemas).
    There is a lot to understand in the CBO. I agree.
    Regard,
    Chris

  • Do's and Dont's of ABAP Programming

    Can anybody give me the list of Do's and Dont's of ABAP programmings

    Go to Transaction SE30 an press the button Tips & Tricks.
    Also have a look at below links:
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
    http://www.sapdevelopment.co.uk/perform/performhome.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/afbad390-0201-0010-daa4-9ef0168d41b6
    http://www.erpgenie.com/abap/performance.htm
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Oracle PL/SQL best practice

    Hello experts,
    Is there any place I could find oracle PL/SQL best practice programming advice?  I got a requirement to write a small paper to help new people that come to work for us so I wanted to put some of best practices (or a set of standard tips) in that along with coding standards etc...
    Best regards,
    Igor

    Hello,
    my first links would be
    Re: 10 database commandments
    On Code Reviews and Standards
    Beware: Any discussion about coding standards tends to get lenghty with flame wars about upper/lower/camelcase keywords, indent style etc :-)
    As stated in the linked document: keep them simple.
    Regards
    Marcus
    Best Practices
    Doing SQL from PL/SQL: Best and Worst Practices
    Naming and Coding Standards for SQL and PL/SQL
    PL/SQL Coding Standards
    Also related:
    Performance question
    Re: How to re-construct my cursor ?

  • SQL Best Practices

    Hello,
            I'm planning to install a SQL server 2012 SP1 as a backend database for SCCM 2012 R2.
    Kindly suggest a best practice.

    Julie,
    Check this:
    http://www.sqlservercentral.com/blogs/basits-sql-server-tips/2012/06/23/sql-server-2012-installation-guide/
    http://www.sqlskills.com/blogs/glenn/the-accidental-dba-day-4-of-30-sql-server-installation-and-configuration-best-practices/
    http://www.brentozar.com/archive/2008/03/sql-server-2005-setup-checklist-part-1-before-the-install/
    http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx
    http://forums.whirlpool.net.au/archive/2144288
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • What can I do? I've forgotten my password and dont remember the answers to my sercurity questions, and no longer have access to the email account i used for backup. How do I get my icloud password reset?

    What can I do? I've forgotten my password and dont remember the answers to my sercurity questions, and no longer have access to the email account i used for backup. How do I get my icloud password reset? Please help. Thanks in advance.

    Please see Kappy's User Tip here:
    https://discussions.apple.com/docs/DOC-4551

  • SQL Server Express 2008 R2 and Windows 8.1 (Standard)

    I recently re-engineered the backend of a legacy Access 2003 application because we knew that going forward we were going to loose the replication capability in Access. This is a small, departmental app, so the new SQL Server Express 2008 R2 backend is
    hosted on a robust Windows 7 system. I tested the implementation with both Windows XP and Windows 7 clients running the updated Access 2003 frontend and everything worked great.
    We are now in the midst of a company-wide upgrade to Windows 8.1 and I'm having issues. The legacy frontend works fine with Access 2013 (full version) when run locally on the Win7 machine, but I can't get any of the new Win 8.1 clients to connect to the
    SQL database using the Access 2013 Runtime module. I CAN create ODBC connections to SQL Server from the clients and they test successfully, so I think I have a valid SQL connection to the Win 7 box.
    To recap: old clients were WinXP Pro with Office 2003 Pro, new clients are Win 8.1 (non-Pro) with Access 2013 Runtime module.
    Any ideas?

    Hi ,
    Glad to hear that you have found the solution. Thank you for coming back and let us know the result:)
    Best Regards,
    Tracy
    Tracy Cai
    TechNet Community Support

  • Need to run a sql query in the background and display the output in HTML

    Hi Guys,
    I have a link in my iprocurement webpage, when i click this link, a query (sql query) should be run and the output should be displayed in a HTML page. Any ideas of how this can be done. Help appreciated.
    We dont have OA Framework and we r using 11.5.7.
    help needed
    thanx

    Read Metalink Note 275880.1 which has the link to developer guide and personalization guide.

  • Best way to add and remove JPanels?

    I have a question on the best practice in removing and then adding JPanels. I know a few ways about doing it but it never seems to work just how I want it to. Any help would be great. Also if anyone wants to give tips on better ways of writing this code I am out your any ideas.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    class test2 extends JFrame implements ActionListener {
        private static final int FRAME_WIDTH    = 575;
        private static final int FRAME_HEIGHT   = 500;
        private static final int FRAME_X_ORIGIN = 150;
        private static final int FRAME_Y_ORIGIN = 250;
        //jbutton
        String [] foodButton = {"Tofu Burger",   "Cajun Chicken",
                                "Buffalo Wings", "Rainbow Fillet",
                                "Rice Cracker",  "No Salt Fries",
                                "Zucchini",      "Brown Rice",
                                "Cafe Mocha",    "Cafe Latte",
                                "Espresso",      "Oolong Tea"};
        JButton b[]          = new JButton[foodButton.length];
        JButton orderButton  = new JButton("Order");
        JButton cancelButton = new JButton("Cancel");
        JButton backButton   = new JButton("Back");
        int [] foodCount     = new int [12];
        double [] foodCost   = {3.49, 4.59,
                                3.99, 2.99,
                                0.79, 0.69,
                                1.09, 0.59,
                                1.99, 1.99,
                                2.49, 0.99};
        double subtotal;
        JPanel outPut         = new JPanel();
        JLabel test           = new JLabel ("Subtotal: ");
        //constructor
        public test2() {
            setContentPane(outPut);
            foodButton();
            frame();
            setVisible(true);
        //frame
        public void frame() {
            setSize(FRAME_WIDTH, FRAME_HEIGHT);
            setResizable(true);
            setTitle("Welcome to Low Fat Burger");
            setLocation(FRAME_X_ORIGIN, FRAME_Y_ORIGIN);
        //button builder
        public void foodButton() {
            ImageIcon myIcon = new ImageIcon("C:/Documents and Settings/Keith/My Documents/My Pictures/Clip Art/lowFatBurger.jpg");
            JPanel header    = new JPanel();
            JPanel menu      = new JPanel();
            JPanel bottom    = new JPanel();
            JPanel subtotal  = new JPanel();
            JPanel itemCount = new JPanel();
            JPanel control   = new JPanel();
            outPut.setLayout(new BorderLayout(0, 0));
            //outPut.setBorder(BorderFactory.createLineBorder(Color.red));
            outPut.add(header,   BorderLayout.NORTH);
            outPut.add(menu,     BorderLayout.CENTER);
            outPut.add(bottom,   BorderLayout.SOUTH);
            header.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
            header.add(new JLabel(myIcon));
            menu.setLayout(new GridLayout(4, 3));
            //test.setLayout(new FlowLayout());
            //test.setBorder(BorderFactory.createLineBorder(Color.red));
            for(int i=0; i<foodButton.length; i++) {
                b[i] = new JButton (foodButton);
    //work area
    b[i].addActionListener(this);
    menu.add(b[i]);
    //add actionlistener to control buttons
    orderButton.addActionListener(this);
    cancelButton.addActionListener(this);
    backButton.addActionListener(this);
    bottom.setLayout(new BorderLayout(0, 0));
    bottom.add(subtotal, BorderLayout.NORTH);
    bottom.add(itemCount, BorderLayout.CENTER);
    bottom.add(control, BorderLayout.SOUTH);
    subtotal.add(test);
    control.add(orderButton);
    control.add(cancelButton);
    public void actionPerformed(ActionEvent event) {
    String straction = event.getActionCommand();
    //format
    DecimalFormat df = new DecimalFormat("0.00");
    for(int j=0; j<foodButton.length; j++) {;
    if(event.getSource() == b[j]) {
    int count = ++foodCount[j];
    double itemSubtotal = count * foodCost[j];
    for(int i=0; i<foodButton.length; i++) {
    subtotal = (foodCount[i] * foodCost[i]);
    test.setText("Subtotal: $" + df.format(subtotal));
    if(straction.equals("Cancel")) {
    }else if(straction.equals("Order")) {
    //menu.removeAll();
    //control.removeAll();
    //control.add(orderButton);
    //control.add(backButton);
    //menu.revalidate();
    //menu.repaint();
    }else if(straction.equals("Back")) {
    public static void main (String[] args) {
    new test();

    If you want a really cheap way to go about it, you could try setVisible(false) instead of removing the panel. It will result in the same visual effect, and if you ever need to add the component back, you just need to setVisible(true) again.
    But make sure you do it inside the event loop...
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            panel.setVisible(false);
    });

  • Im locked out of my adm. account what do i do and dont have a blank disk for recovery password

    im locked out of my adm. account what do i do and dont have a blank disk for recovery password

    As noted, this forum is for questions and discussions about the TechNet Wiki. We don't have enough information to move this question to the right forum. For example what operating system? I think it best that you ask your question in a Microsoft Answers/Community
    forum here:
    http://answers.microsoft.com/en-us/windows
    I cannot move this thread there, so will need to post again there. Select your operating system first.
    Richard Mueller - MVP Directory Services

  • PL/SQL Best practice

    can any one provide me PL/SQL Best practice document link ?
    Thsnks...

    can any one provide me PL/SQL Best practice document link ?nice reading as well:
    Doing SQL from PL/SQL: Best and Worst Practices

  • Required info on SQL Server Performance Issue Analysis and Troubleshoot way

    Dear All,
    I am going to prepare the simple documentation steps on SQL Server Performance Issue Analysis and troubleshoot method. I am struggling to make this documentation since we have different checklist (like network latency,disk latency, memory/processor pressure,SQL
    query tuning etc) to validate once application performance issue reported from the customer.So, I am looking for the experts document or link sharing .
    Your input will help for document preparation in better way.
    Thanks in advance.

    Hi,
    Recommendations and Guidelines on configuring disk partitions for SQL Server
    http://support.microsoft.com/kb/2023571
    Disk and File Layout for SQL Server
    https://blogs.technet.com/b/dataplatforminsider/archive/2012/12/19/disk-and-file-layout-for-sql-server.aspx
    Microsoft SQL Server 2012 Performance Tuning: Implementing Physical Database Structure
    http://www.packtpub.com/article/sql-server-2012-implementing-physical-database-strusture
    Database Mirroring Best Practices and Performance Considerations
    http://technet.microsoft.com/en-us/library/cc917681.aspx
    Hope the information helps.
    Tracy Cai
    TechNet Community Support

  • SQL Server 2005 High Availability and Disaster Recovery options

    Hi, We are are working on a High Availability & Disaster Recovery Planning solution for an application database which is on SQL Server 2005. What different options have we got to implement this for SQL Server 2005 and after we have everything setup how
    do we test the failover is working?
    Thanks in advance.........
    Ione

    DR : Disaster recovery is the best option for the business to minimize their data loss and downtime. The SQL server has a number of native options. But, everything is depends upon your recovery time objective RTO and recovery point objective RPO.
    1. Data center disaster
    Geo Clustering
    2. Server(Host)/Drive (Except shared drive) disaster
    Clustering
    3. Database/Drive disaster     
    Database mirroring
    Log shipping
    Replication
    Log shipping
    Log shipping is the process of automating the full database backup and transaction log on a production server and then automatically restores them on to the secondary (standby) server.
    Log shipping will work either Full or Bulk logged recovery model.
    You can also configure log shipping in the single SQL instance.
    The Stand by database can be either restoring or read only (standby).
    The manual fail over is required to bring the database online.
    Some data can be lost (15 minutes).
    Peer-to-Peer Transactional Replication
    Peer-to-peer transactional replication is designed for applications that might read or might modify the data in any database that participates in replication. Additionally, if any servers that host the databases are unavailable, you can modify the application
    to route traffic to the remaining servers. The remaining servers contain same copies of the data.
    Clustering
    Clustering is a combination of one or more servers it will automatically allow one physical server to take over the tasks of another physical server that has failed. Its not a real disaster recovery solution because if the shared drive unavailable we cannot
    bring the database to online.
    Clustering is best option it provides a minimum downtime (like 5 minutes) and data loss in case any data center (Geo) or server failure.
    Clustering needs extra hardware/server and it’s more expensive.
    Database mirroring
    Database mirroring introduced in 2005 onwards. Database Mirroring maintain an exact copy of a database on a different server. It has automatic fail over option and mainly helps to increase the database availability too.
    Database mirroring only works FULL recovery model.
    This needs two instances.
    Mirror database always in restoring state.
    http://msdn.microsoft.com/en-us/library/ms151196%28v=sql.90%29.aspx
    http://blogs.technet.com/b/wbaer/archive/2008/04/19/high-availability-and-disaster-recovery-with-microsoft-sql-server-2005-database-mirroring-and-microsoft-sql-server-2005-log-shipping-for-microsoft-sharepoint-products-and-technologies.aspx
    http://www.slideshare.net/rajib_kundu/disaster-recovery-in-sql-server
    HADR Considerations
    Need to Understand the business motivations and regulatory requirements that are driving the customer's HA/DR requirements. Understand how your customer categorizes the workload from an HA/DR perspective. There is likely to be an alignment between the needs
    and categorization.
    Check for both the recovery time objective (RTO) and the recovery point objective (RPO) for different workload categories, for both a failure within a data center (local high availability) and a total data center failure (disaster recovery). While RPO and
    RTO vary for different workloads because of business, cost, or technological considerations, customers may prefer a single technical solution for ease in operations. However, a single technical solution may require trade-offs that need to be discussed with
    customers so that their expectations are set appropriately.
    Check and understand if there is an organizational preference for a particular HA/DR technology. Customers may have a preference because of previous experiences, established operational procedures, or simply the desire for uniformity across databases from
    different vendors. Understand the motives behind a preference: A customers' preference for HA/DR may not be because of the functions and features of the HA/DR technology. For example, a customer may decide to adopt a third-party solution for DR to maintain
    a single operational procedure. For this reason, using HA/DR technology provided by a SAN vendor (such as EMC SRDF) is a popular approach.
    To design and adopt an HA/DR solution it is also important to understand the implications of applying maintenance to both hardware and software (including Windows security patching). Database mirroring is often adopted to minimize the service disruption
    to achieve this objective.
    HADR Options :
    Failover clustering for HA and database mirroring for DR.
    Synchronous database mirroring for HA/DR and log shipping for additional DR.
    Geo-cluster for HA/DR and log shipping for additional DR.
    Failover clustering for HA and storage area network (SAN)-based replication for DR.
    Peer-to-peer replication for HA and DR (and reporting).
    Backup & Restore ( DR)
    keep your server DB backups in network location ( DR)
    Always keep your sql server 2005 upto date, in case if you are not getting any official support from MS then you have to take care of any critical issues and more..
    Raju Rasagounder Sr MSSQL DBA

Maybe you are looking for

  • Search Help in Webdynpro For ABAP

    Hi Experts,                   In my application I want to attach search help to a field. My problem is that table field for which I am creating search help contains duplicate values. I dont want those duplicate values. How can I achieve this? I am us

  • How to fill a customer complaint? (Quicktime Pro)

    For more than a week I'm waiting my lost quicktime pro key to be emailed without success (the key is not in the order). I really don't have the time to go behind apple like that... I bought plenty of hardware and software over the years, but this mak

  • How to access from the internet an APEX app running in Oracle's VM.

    I'm fairly new to the world of VMs and networking. I have a DB instance with a APEX 4.1 application installed on my host operating system (VISTA) and another inside the VM. Is it possible to get users on the net to access the APEX application inside

  • Linksys EA6700, "Cannot find the DHCP server"

    Hello all I have a Linksys EA6700 router that has given me problems the three months I've had it. Typically I get the message "Cannot find the DHCP server" or no message at all. I have everything from three to eight PC's, SqueezeBoxes, Blu-ray player

  • Print the smartform to the spool

    Hi all, How to Print the smartform to the spool  ? Thanks in advance Krupa