Premium Essay

Lad Sheet

In:

Submitted By Giovanni1403
Words 2268
Pages 10
Labsheet02

PostgreSQL7.4

Use of SQL language in PostgreSQL (continued)
Most of the contents of this Labsheet is taken from the PostgreSQL 7.4.17 Documentation. It is available at the following link: http://www.postgresql.org/docs/7.4/interactive/index.html

Aggregate Functions
Common aggregate functions are: count sum avg (average) max (maximum) min (minimum)

Note: avg, min and max ignore tuples that have a null value for the specified attribute, but count considers null values. As an example, we can find the highest low-temperature reading anywhere with Execute the following query using postgreSQL and see the results:
SELECT max(temp_lo) FROM weather;

Note: The aggregate max cannot be used in the WHERE clause
(This restriction exists because the WHERE clause determines the rows that will go into the aggregation stage; so it has to be evaluated before aggregate functions are computed.) Aggregates are also very useful in combination with GROUP BY clauses. For example, we can get the maximum low temperature observed in each city with Execute the following query using postgreSQL and see the results:
SELECT city, max(temp_lo) FROM weather GROUP BY city;

which gives us one output row per city. Each aggregate result is computed over the table rows matching that city. We can filter these grouped rows using HAVING: Execute the following query using postgreSQL and see the results:
SELECT city, max(temp_lo) FROM weather GROUP BY city HAVING max(temp_lo) < 40;

which gives us the same results for only the cities that have all temp_lo values below 40. Finally, if we only care about cities whose names begin with “S”, we might do Execute the following query using postgreSQL and see the results:
SELECT city, max(temp_lo) FROM weather WHERE city LIKE ’S%’ GROUP BY city Begum Durgahee HAVING max(temp_lo) < 40;

1

Labsheet02

PostgreSQL7.4

The

Similar Documents

Premium Essay

Housman's to an Athlete Dying Young

...Housman's "To An Athlete Dying Young"  A. E. Housman's "To an Athlete Dying Young," also known as Lyric XIX in A  Shropshire Lad, holds as its main theme the premature death of a young athlete  as told from the point of view of a friend serving as pall bearer. The poem  reveals the concept that those dying at the peak of their glory or youth are  really quite lucky. The first few readings of "To an Athlete Dying Young"  provides the reader with an understanding of Housman's view of death.  Additional readings reveal Housman's attempt to convey the classical idea that  youth, beauty, and glory can be preserved only in death.  A line-by-line analysis helps to determine the purpose of the poem. The  first stanza of the poem tells of the athlete's triumph and his glory filled  parade through the town in which the crowd loves and cheers for him. As Bobby  Joe Leggett defines at this point, the athlete is "carried of the shoulders of  his friends after a winning race" (54). In Housman's words:  The time you won your town the race  We chaired you through the market place;  Man and boy stood cheering by,  And home we brought you shoulder-high. (Housman 967).  Stanza two describes a much more somber procession. The athlete is being carried  to his grave. In Leggett's opinion, "The parallels between this procession and  the former triumph are carefully drawn" (54). The reader should see that  Housman makes another reference to "shoulders" as an allusion to connect...

Words: 1612 - Pages: 7

Premium Essay

A. E Housman To An Athlete Dying Young Analysis

...A.E. Housman : “ To an Athlete Dying Young” Alfred Edward Housman formally known as A.E. Housman was born on March 26th 1829 and died April 30th 1936. Housman lived in Valley House Bromsgrove UK. He was born to parents Sarah Jane and Edward Housman who married on June 17th ,1858 . Housman was the eldest of seven children and they were raised Christian . He was baptized on April 21 ,1859 at Christ church. Sadly shortly after his mother died on his twelfth birthday. His father who was a county solicitor soon after remarried to one of his elder cousin ,Lucy. Housman made a huge impact on the literature world of his time. It’s no secret that Housman was best known for his profound realization of life. He wrote countless quotes and poems which,...

Words: 335 - Pages: 2

Premium Essay

Argumentation Paper

...A. E. Housman's "To an Athlete Dying Young," also known as Lyric XIX in A Shropshire Lad, holds as its main theme the premature death of a young athlete as told from the point of view of a friend serving as pall bearer. The poem reveals the concept that those dying at the peak of their glory or youth are really quite lucky. The first few readings of "To an Athlete Dying Young" provides the reader with an understanding of Housman's view of death. Additional readings reveal Housman's attempt to convey the classical idea that youth, beauty, and glory can be preserved only in death. A line-by-line analysis helps to determine the purpose of the poem. The first stanza of the poem tells of the athlete's triumph and his glory filled parade through the town in which the crowd loves and cheers for him. As Bobby Joe Leggett defines at this point, the athlete is "carried of the shoulders of his friends after a winning race" (54). In Housman's words: The time you won your town the race We chaired you through the market place; Man and boy stood cheering by, And home we brought you shoulder-high. (Housman 967). Stanza two describes a much more somber procession. The athlete is being carried to his grave. In Leggett's opinion, "The parallels between this procession and the former triumph are carefully drawn" (54). The reader should see that Housman makes another reference to "shoulders" as an allusion to connect the first ... ... middle of paper...

Words: 378 - Pages: 2

Free Essay

Obstacles of Black Business

...THE BLACK BUSINESSMAN: OBSTACLES TO HIS SUCCESS Author(s): DEMPSEY J. TRAVIS Source: The Black Scholar, Vol. 4, No. 4, THE NEW BLACK BOURGEOISIE (January 1973), pp. 19-21 Published by: Paradigm Publishers Stable URL: http://www.jstor.org/stable/41163617 . Accessed: 08/07/2014 00:10 Your use of the JSTOR archive indicates your acceptance of the Terms & Conditions of Use, available at . http://www.jstor.org/page/info/about/policies/terms.jsp . JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms of scholarship. For more information about JSTOR, please contact support@jstor.org. . Paradigm Publishers is collaborating with JSTOR to digitize, preserve and extend access to The Black Scholar. http://www.jstor.org This content downloaded from 35.8.11.2 on Tue, 8 Jul 2014 00:10:37 AM All use subject to JSTOR Terms and Conditions THE BLACK BUSINESSMAN: OBSTACLES TO HIS SUCCESS by DEMPSEY J. TRAVIS black businessman, at some on between time,reflects the disparity he the effort puts into his businessand the whichhe obtains compared whites as results to in the same business. matter No how hardhis employees work nor how successful the business is, production and profitsremain small and insignificant the scale of total on and racist American businesses because racism whitesfrom...

Words: 1883 - Pages: 8

Free Essay

Netflix

...ST 4 April 5th In 1998, Netflix started an American, DVD- through mail service, where they rented and sold DVD’s one at a time. It was founded by Marc Randolph and Reed Hastings. The company then acknowledged that this business was in very high demand and then switched to a subscription model that would allow a customer to rent a precise number of DVD’s per month. This only lasted six months, when Netflix realized what the customers really wanted was an unlimited subscription model. In 2007, Netflix began streaming movies. Netflix has placed itself as a convenient, great choice of content and affordability entertainment option for customers who are interested in movies and TV-shows. It is now considered one of the biggest provider of streaming movies and TV-series. In 2013, Ted Sarandos, Netflix’s Chief Content Officer told GQ “The goal is to become HBO faster than HBO can become us”. Netflix has indeed been implementing diverse multi-product by creating very popular TV series and Award winning shows like Orange is the New Black and House of Cards. What is truly setting them apart is their new focus on creating movies that their customers can watch at their convenience at their own home without having to go the theaters and pay for the ticket, the popcorn, a drink among other food items Netflix is now hoping to win an award for its new original movie “Beast of No Nation “staring Idris Elba will begin running in a few of the United States http://www.fool.com/investing/general/2015/09/30/how-netflix-inc-really-creates-value...

Words: 300 - Pages: 2

Free Essay

Ex of a Press Release

...Martini Drive 1990 Hull S90 LM0 England 13 March 2013 PRESS RELEASE FOR IMMEDIATE RELEASE Contact: Syed Muhammad Abbas Ali Press officer of Acme (0044) 25676949 syed_acme@press.com Acme brewery is the hope of Hull The city Hull is known for its many social problems and the town brewery is known for its lack of order fulfilments. That’s why the new owners of Acme are going to improve the city. HULL, MARCH 2013 --- The people of Hull are celebrating, because of the rapid expansion of the Acme brewery. The city has gotten a new voice since the American company US Beverages bought Acme. It is the new owners hope, that the company’s products will go overseas to other markets. The company has moved its premises, from a docks area to a greenfield site. This makes it possible for the company to expand its limits. There are also more job opportunities than before, which will benefit the people of Hull. There used to be a lot of social problems in the city and people had no control over their lives. Therefore the Mayor decided to sell the brewery in hope of it becoming Hull’s rescue. The Mayor of Hull says: “ If the city had continued like this, people would have moved to other places. But because of US Beverages, who made Acme a bigger name than it was a year ago, we have a future. The people will have more opportunities and these will help our city in the long run. This is all possible because of the new Acme brewery.” ---------------------------------------------...

Words: 286 - Pages: 2

Free Essay

Netflix

...Company Overview Netflix has given rise to the new way viewers access their television. The company provides its customers a mail DVD and/or streaming media service for a low monthly subscription. The company’s successes is attributed mostly by its site, Netflix.com. The site allows audiences to view their media through access to a library of near unlimited movies and shows. Business Strategy Netflix’s biggest advantage over its competitors is that it has offered its own largely successful shows, such as House of Cards and Orange is the New Black. These shows are not released like the typical week to week basis, but rather each season is released all at once. "What we’re seeing actually is the breakup around traditional broadcasting models around genres as much as anything else,” says Matt Locke of Story Things Media Company. [1] This new format of viewing shows has given rise to what is known as “binge watching,” where consumers watch entire seasons at a time. Before this, viewers would have to patiently wait weeks at a time to watch their favorite shows and would be out of luck if they happened to miss it. Netflix is constantly pursuing new ways to offer the customer more and providing a first in the market. On January of 2015, Sony and Netflix partnered to release The Interview movie after only one month of its release. Global Presence "It’s going to take another couple of decades to disrupt the current business models, but I would never bet against audiences changing...

Words: 481 - Pages: 2

Free Essay

Beyond the Orange Jumpsuits

...Julia Castilho Beyond the Orange Jumpsuits Orange Is The New Black is a Netflix series, categorized as a comedy-drama where language and inappropriate content are not an issue. Orange Is The New Black, also known as OITNB, is a TV show that revolves around Piper Chapman. Piper is sentenced to fifteen months at a women’s federal prison for transporting drug money from an international drug cartel that was organized by her former girlfriend, Alex Vause (“Orange Is the New Black”). The incident, which Piper is sentenced for, happened ten years prior to the start of the TV show. By the time Piper’s past has caught up with her, she had already moved on; she got engaged and had an upper middle class lifestyle in New York City and ready to start her brand new life. Unfortunately, before all that can happen, Piper has to go to Litchfield, the female prison, which is now her new home. OITNB portrays the lives of many inmates, including Piper, before and during prison, showing their transformations through time. The first episode of season one, Piper gets ready to surrender at Litchfield. She faces the difficulties on being the new inmate - having no money, no privileges, and no respect from the other convicts. Watching this TV show makes viewers wonder if life in female institutions is as severe as Litchfield. Orange Is The New Black is based off the memoir of Piper Kerman and her experience in prison, which makes the show as realistic as possible. The first episode of season...

Words: 1470 - Pages: 6

Premium Essay

Jet 2 Task 1

...Horizontal analysis results Horizontal analysis compares the company’s finances over several years, with a base years for comparison. Competition Bikes uses year 6 as the base year, and a comparison of changes from year 6 to 7 and then with years 7 and 8. The strengths are mostly for year 6 to year 7. Net sales were $4,485,000 for year 6 and increased by $1,495,000 to $5,980,000 in year 7. Then from year 7 to 8 there is a decline in sales by $897,000 this decrease was the major weakness. The cost of goods in year 6 equaled $3,294,000 then increased in year 7 by 32.8% to $4,342,000. The Gross profits were up 37.5% in year 7 compared to year 6 for a growth of $447,000. The operating expenses increased due to the increase in sales from year 6 to 7. This is always a strength when you a company spend more because they are making more money. Advertising could have played a role in the increased sales. They spent the greatest amount of money on year 7, which was $32,760. There was a decreased in advertising expenses in year 8, by 16.3%. The company had fixed percent that they spent in sales commissions, distributions, network support, and transportation out, which all increased 33% from the 6th to 7th year and decreased 15% from the 7th to the 8th. The overall selling expenses were $299,220 in year 6 and increased to $397,960 (+33%) year 7 and then decreased to $338,748 (14.9%) year 8. Competition Bikes selling expenses were high for the 6th to the 7th year, but they managed to regain...

Words: 4327 - Pages: 18

Premium Essay

Not Yet

...CITY UNION BANK LIMITED, CENTRAL OFFICE, KUMBAKONAM This booklet contains the following statements/certificates/reports to be issued by Statutory Branch Auditors. Sl. No.|Particulars of documents|Remarks|Page No.| 01.|Letter of Acceptance|To be submitted to Central Office, Accounts Department before commencement of audit...

Words: 9109 - Pages: 37

Premium Essay

Corporate Finance for Demistified

...CORPORATE FINANCE DEMYSTIFIED TROY A. ADAIR, Jr. McGraw-Hill New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto Copyright © 2006 by The McGraw-Hill Companies. All rights reserved. Manufactured in the United States of America. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. 0-07-148678-X The material in this eBook also appears in the print version of this title: 0-07-145910-3. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. For more information, please contact George Hoare, Special Sales, at george_hoare@mcgraw-hill.com or (212) 904-4069. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted...

Words: 60340 - Pages: 242

Premium Essay

Basic Mba

...BU Basic M.B.A. International Master of Business Administration |Index | Accounting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Business Law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Entrepreneurship. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Finance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Marketing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 Strategic Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Words: 103642 - Pages: 415

Premium Essay

Human Resource

...XI THE RESERVE BANK’S ACCOUNTS FOR 2010-11The balance sheet of the Reserve Bank expanded significantly during the year, mainly reflecting the impact of liquidity management operations undertaken by the Bank. The income from foreign assets declined for the second successive year, reflecting the low interest rates in international markets. The decline in income from foreign assets in 2010-11 was, however, more than offset by earnings from domestic assets which have expanded. While the Bank’s gross income increased by 12.73 per cent to ` 37,070.12 crore in 2010-11, there was a 3 per cent increase in total expenditure to ` 8,655.22 crore. After meeting the needs of necessary transfer to the Contingency Reserve and the Asset Development Reserve, `15,009 crore was allocated for transferring to the Government.XI.1 The size of the Reserve Bank’s balance sheet increased significantly in 2010-11 (July-June) mainly on account of its liquidity management operations. On the liability side, the expansion was on account of a large increase in notes in circulation as also an increase in banks’ deposits with the Reserve Bank in line with the deposit growth in the banking system (see Box II.6). On the asset side, there was a significant increase in Bank’s portfolio of domestic assets in the form of government securities on account of open market purchases, repo purchases and disinvestment of Government of India’s surplus balance parked with the Reserve Bank. The increase in foreign currency assets...

Words: 8057 - Pages: 33

Premium Essay

Sample Exam

...Kimmel, Weygandt & Kieso - Sample Exam 1 Name: __________________________ Date: _____________ 1. Which financial statement would best indicate whether the company relies on debt or stockholders' equity to finance its assets? A) Statement of Cash Flows B) Retained Earnings Statement C) Income Statement D) Balance Sheet 2. Stockholders' equity A) is usually equal to cash on hand. B) is equal to liabilities and retained earnings. C) includes retained earning and common stock. D) is shown on the income statement. 3. Which of the following activities involves collecting the necessary funds to support the business? A) Operating B) Investing C) Financing D) Delivering 4. Issuing shares of stock in exchange for cash is an example of a(n) A) delivering activity. B) investing activity. C) financing activity. D) operating activity. 5. Which of the following is not a principal type of business activity? A) Operating B) Investing C) Financing D) Delivering 6. Which of the following is not a common way that managers use the balance sheet? A) To analyze the balances of assets, liabilities, and stockholders' equity throughout the accounting period B) To determine if the cash balance is sufficient for future needs C) To analyze the balance between debt and common stock financing D) To analyze the balance of accounts receivable on the last day of the accounting period Page 1 Kimmel, Weygandt & Kieso - Sample Exam 1 7. Ashton Company began the year with retained earnings of $210,000...

Words: 3558 - Pages: 15

Premium Essay

Penny Pincher Company

... 205 Fair value of plan assets 175 There is no balance in prepaid/accrued pension costs. Required: a. Calculate the funded status of the plan (see definition under ASC (was old SFAS 158 for funded status). Is the plan overfunded or underfunded? b. If the projected benefit obligation provides the appropriate measure of the company’s obligation for pension benefits and the assets in the fund are viewed as satisfying all or part of that obligation, what is Penny Pincher’s liability, if any, for the pension plan at year-end? Briefly explain, citing the conceptual framework’s definition of liabilities in your explanation. c. What amount will Penny Pincher have to report in its balance sheet? Is it an asset or liability? ANSWER a. Calculate the funded status of the plan (see definition under ASC (was old SFAS 158 for funded status). Is the plan overfunded or underfunded? The overfunded or underfunded status is measures as the difference between the projected benefit obligation and the fair value of the assets at the period end date. The accumulated benefit obligation does not include the present value of the future benefits for non-vested employees. FASB requires that the funding status be determined using the projected benefit obligation that includes the non-vested benefits. Fair value of assets. $175 Projected benefit obligation $205 ...

Words: 626 - Pages: 3