background preloader

Databases

Facebook Twitter

Practical PostgreSQL. Now Shipping!

Practical PostgreSQL

John Worsley Command Prompt, Inc. Joshua Drake Edited by Andrew Brookins Michael Holloway Copyright © 2001-2002 by Commandprompt, Inc Copyright (c) 2001 by Command Prompt, Inc. 'Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder.' to the license reference or copy. 'Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.' to the license reference or copy. Although every reasonable effort has been made to incorporate accurate and useful information into this book, the copyright holders make no representation about the suitability of this book or the information therein for any purpose. SQL pie chart. My other half says I'm losing it.

SQL pie chart

But I think that as an enthusiast kernel developer she doesn't have the right to criticize people. ("I like user space better! " - she exclaims upon reading this). Shown below is a (single query) SQL-generated pie chart. I will walk through the steps towards making this happen, and conclude with what, I hope you'll agree, are real-world, useful usage samples. Requirements We need a generic query, which returns at least these two columns: name_column and value_column. SELECT name AS name_column, value AS value_column FROM sample_values2; +-------------+--------------+ | name_column | value_column | +-------------+--------------+ | red | 1 | | blue | 2 | | orange | 3 | | white | 4 | +-------------+--------------+ Find sample data in pie_data.sql.

Part 1: expanding the original query We're going to need to take the above query's results and expand them: how much is the ratio from total, per value? Part 2: behind the scenes of the pie chart Showcase OK. Conclusion. Our Favorite Cheat Sheets - a definition from Whatis. Online - Getting Started with Linux: Table of Contents. A Gentle Introduction to SQL. Instant SQL Formatter. General What's instant sql formatter?

Instant SQL Formatter

Instant SQL Formatter is a free online sql tidy tool, actually, it not only can beautify your sql but also can turn your formatted sql into html code, so you can post coloured sql code in your blog, forum,wiki and any website easily. In addition to beautifying SQL code, this sql tool can translate SQL code into C#, Java, PHP, DELPHI and other program languages. Another useful feature is find out all database objects such as table, column, function in sql by selecting output format to list database object.

How does this sql beautifier work? Before the SQL is reformatted, the SQL formatter first checks the syntax of the input SQL, then creates a parse tree for each SQL. What can I do when my SQL is not formatted? 1. 2. 3. 4. Does this formatter support unicode? No. Why copy to clipboard button doesn't work in firefox? May I setup this sql formatter on my site? Yes. I don't want to post my sql on internet, how do I tidy my sql?