background preloader

Database

Facebook Twitter

SQL Injection Cheat Sheet. Find and exploit SQL Injections with free Netsparker SQL Injection Scanner SQL Injection Cheat Sheet, Document Version 1.4 About SQL Injection Cheat Sheet Currently only for MySQL and Microsoft SQL Server, some ORACLE and some PostgreSQL.

SQL Injection Cheat Sheet

Most of samples are not correct for every single situation. Most of the real world environments may change because of parenthesis, different code bases and unexpected, strange SQL sentences. Samples are provided to allow reader to get basic idea of a potential attack and almost every section includes a brief information about itself. Examples; (MS) means : MySQL and SQL Server etc. Table Of Contents Syntax Reference, Sample Attacks and Dirty SQL Injection Tricks Ending / Commenting Out / Line Comments Line Comments Comments out rest of the query. -- (SM) DROP sampletable;-- # (M) DROP sampletable;# Comparison of different SQL implementations. The goal of this page — which is a work in progress — is to gather information relevant for people who are porting SQL from one product to another and/or are interested in possibilities and limits of 'cross-product' SQL.

Comparison of different SQL implementations

The following tables compare how different DBMS products handle various SQL (and related) features. If possible, the tables also state how the implementations should do things, according to the SQL standard. I will only write about subjects that I've worked with personally, or subjects which I anticipate to find use for in the near future. Subjects on which there are no significant implementation variances are not covered. Beta-versions of software are not examined. I'm sorry about the colors. If you have corrections or suggestions, please contact me; even notifications about spelling errors are welcome. Legend, definitions, and notes The following SQL standard and implementations have been examined, if not otherwise stated: Features Views Join types and features Remarks: Note: Best practices to improve performance in JDBC.

Best practices to improve performance in JDBC This topic illustrates the best practices to improve performance in JDBC with the following sections: Overview of JDBC JDBC defines how a Java program can communicate with a database.

Best practices to improve performance in JDBC

This section focuses mainly on JDBC 2.0 API. JDBC API provides two packages they are java.sql and javax.sql . JDBC architecture defines different layers to work with any database and java, they are JDBC API interfaces and classes which are at top most layer( to work with java ), a driver which is at middle layer (implements the JDBC API interfaces that maps java to database specific language) and a database which is at the bottom (to store physical data). What columns generally make good indexes. How do you know what a good index is. General Tips on Optimizing SQL Server Indexes. All the tips provided on this website about indexing are general guidelines.

General Tips on Optimizing SQL Server Indexes

As with any general guideline, there are exceptions. Because of this, it is a good idea to test out various indexing strategies for the most common queries run against your database. Only by testing different indexing strategies can you be sure that you have fully optimized your database. [6.5, 7.0, 2000, 2005] Updated 4-3-2006 If your databases are set for “Auto Create Statistics,” the SQL Server Query Optimizer, when running queries, will consider if there is any benefit to adding statistics for any column that doesn’t already have statistics for it.

This is for columns without indexes. The addition of an automatically added statistics to a column is also useful for something else. How do you know if the Query Optimizer has automatically created column statistics on a column in a table? SELECT name FROM sysindexes WHERE (name LIKE ‘%_WA_Sys%’) SQL Server Indexes. Relational databases like SQL Server use indexes to find data quickly when a query is processed.

SQL Server Indexes

Creating and removing indexes from a database schema will rarely result in changes to an application's code; indexes operate 'behind the scenes' in support of the database engine. However, creating the proper index can drastically increase the performance of an application. SQL Server Index Basics. Given the fundamental importance of indexes in databases, it always comes as a surprise how often the proper design of indexes is neglected.

SQL Server Index Basics

It often turns out that the programmer understands detail, but not the broad picture of what indexes do. Bob Sheldon comes to the rescue with a simple guide that serves either to remind or educate us all! One of the most important routes to high performance in a SQL Server database is the index. Indexes speed up the querying process by providing swift access to rows in the data tables, similarly to the way a book’s index helps you find information quickly within that book. Connection String Syntax. The value of a keyword must be specified as a string.

Connection String Syntax

The value depends on the property being set and the value that the OLE DB provider expects. Short Property Values The Data Link API uses a shortened, "friendlier" version of the property values defined in the OLE DB specification. The short value of a property is derived by removing the prefix from the documented property value and replacing any underscores with spaces. ConnectionStrings.com - Forgot that connection string? Get it here! SQL Tutorial. SQL basics: Query multiple tables.

MySQL

Visual FoxPro. SQL Server. Oracle. SQLite. Tutorials and Tips.