Wednesday, July 31, 2019

Capitalism and leisure

Capitalism depends on a continuous sense of dissatisfaction to exist.   The temporary relief experienced by dissatisfied workers engaging in leisure activities such as shopping is not caused by the acquisition of an object, but rather is produced through the action of conspicuous consumption of those objects.   In other words, the relief is felt during the pursuit of certain objects and the exchange of money for goods, but diminishes almost immediately once the desired object is obtained. IPods and MySpace are recent examples that seem to bear this out.   The acquisition of an IPod necessitates the pursuit of music and the desire to perpetually obtain more music, while MySpace consumes massive amounts of free time and functions by the constant acquisition of â€Å"friends†.   They cannot create satisfaction in their original state; they only create satisfaction through the promise of acquiring infinitely more. Leisure activities such as attending the movies, on the other hand, produce temporary satisfaction through the conspicuous consumption of personal time and diminishes shortly after the movie ends.   Marx and Singer are correct in their assertion that life in the modern era is essentially dissatisfying: the capitalist economy could not exist without a pervasive and perpetual sense of dissatisfaction. However, the assumption that workers who are not alienated from their labor are generally more satisfied seems to discount other concomitant factors, such as the spirituality and close personal and family relationships that both capitalism and communism discount as irrelevant or unnecessary to life in the modern era.   Both can be considered leisure activities, and both have been reported to produce levels of satisfaction among those who participate in these types of activities.

Banc One HBS case Essay

Banc One has a problem with the alignment of two of its important strategies: (1) rapidly acquiring profitable banks and (2) sustaining high returns while mitigating interest rate risk. Banc One has been very successful in acquiring banks, and much of this is done through the sale/transfer of Banc One’s stock. This strategy relies heavily on Banc One’s ability to maintain a high stock price. The second strategy – high returns with mitigated interest rate risk – relies heavily on the use of interest rate swaps. This use of interest rate swaps has become concerning to investors – due to its complicated nature, off-balance sheet activity, and distortions in earnings metrics – which has negatively affected and continues to negatively affect Banc One’s stock price. Because both strategies are extremely successful, Banc One should not focus on abandoning either, but rather focus on educating investors about the use of interest rate swaps and their importance in not only sustaining high returns, but also providing mitigated risk, which is a strategy investors generally seek. Rather, Banc One should follow a three-step solution. The first step is to continue educating investors through prospectus-type materials (in very simplified forms) and individually informing fund managers and analysts, who are easier to educate about these complex transactions. The second step is to provide transparency with swap transactions. Although Banc One is only required to disclose swap information in the footnotes of its financial statements, Banc One should provide very detailed and clear information about specific swap transactions, to reinforce the notion that Banc One has nothing to hide with these swap transactions. For the last step, Banc One should analyze it s swap-trading procedures and identify simpler types of swap trades it could make. This would make reporting and educating on swaps easier. QUESTION 1: How could Banc One manage its interest rate risk exposure without using swaps? That is, how could it move from being asset sensitive to being neutral or liability sensitive without using swaps? The reason why Banc One needs to use swaps is to cover the gap between the duration of its asset and liabilities and thus to mitigate its exposure to interest rate risk. Therefore, another way for the bank to achieve this is by: Matching the maturities of its assets and liabilities. Since the bank has more long- term fixed-rate liabilities, it can add more long-term fixed rate assets, such as Treasure Securities to its portfolio. This will match the maturities on both sides of the balance sheet and will make the bank neutral to changes in interest rates. If rates change, an upward movement on one side of the balance sheet will offset a downward movement on the other. Matching the duration of its loans and liabilities and making sure the impact of interest rate changes on both sides of the balance sheet would cancel each other out. If the bank decides to take this approach, it can use instruments with different maturity periods in order to neutralize its exposure to interest rate risk. In order to achieve this it has to match the return of initial investment periods of its assets and liabilities. Borrow at a floating rate and use the proceeds to buy long-term fixed rate assets in order to mitigate their asset interest rate exposure. In this case the bank secures future income payments at a certain fixed rate, which it can use to pay the interest on its long-term fixed rate liabilities. Similarly, it can use the income from its floating-rate assets to repay the income on its borrowed floating-rate instruments. Thus, it neutralizes its risk-exposure. Avoid long-term liabilities in order to reduce its exposure to interest rate  risk on the asset side. In this case, the bank can borrow only through short-term liabilities and thus changes in interest rates will not affect its liabilities side more than they will impact its assets side. Purchasing options, forward, or future contracts. In this way the bank can reduce the uncertainty in the future by entering into an agreement with set terms for a specific date. Thus, if the interest rate moves in an unfavorable direction, the bank has the option to use these tools in order to mitigate the impact of the change on its balance sheet. What are the advantages and disadvantages of using swaps rather than these other means? Advantages: There are no capital reserve requirements specific to swaps. Swaps do not appear as assets on the balance sheet and thus they are not accounted for in the capital requirement calculations for the bank. This frees capital for the bank and at the same time brings insurance against its interest rate exposure. Swaps give flexibility and allow the bank to design the contracts in a way that fits its needs. Banks can tailor the durations, rates and other terms of the swap contracts and make it specific to the current situation of the bank. Furthermore, they can easily communicate with other banks in order to construct contracts, which benefit both sides. Swaps can also improve the bank’s liquidity – It can invest in short-term instruments and thus avoid locking in its funds in long-term securities. At the same time it can add swaps to its portfolio in order to mitigate some of the interest rate risk involved in the investment of short-term securities. In this manner the bank can make sure it has enough funds to meet changes in demand and at the same time it does not have to be exposed to the accompanying rate change risk. Swaps are off-balance sheet agreements; however, the income they generate is included in the company’s financials. In this case swaps are not recorded as assets or liabilities, however, they still bring income, which is included in the company’s cash flow statement and accounted for in the performance ratios of the organization. Disadvantages: Creates difficulties for the market and for investors to assess the risk and financial situation of the bank. As banks use more and more swap contracts, assessing the risk exposure of the organization becomes increasingly complex. Thus, external investors have a harder time evaluating the bank’s current situation and usually require higher returns to compensate for the perceived higher risk. Gives opportunities for speculations- Even though banks use swaps in order to mitigate interest rate exposure, they can also use them as instruments for speculations and short-term gains. If managers think they can predict the rate movement for a future period, they can be tempted to use swaps in order to gain from this movement. Thus, banks have to be careful in their strategies and should make sure they monitor the decision making process involved in the purchases and sales of swaps. They carry a small risk that the opposite party might default on the contract and leave the bank exposed to interest rate risk. What is the impact on interest rate sensitivity, accounting ratios, and capital ratios? Utilizing swaps, Banc One is more liability sensitive rather than asset sensitive. Without swaps, they would need to use its long duration assets to help control its interest rate sensitivity. Through its use of swaps, Banc One increases it return on assets. If they chose to manage interest rate risk by using methods mentioned above, the bank would hold more assets with longer durations causing the return on its assets to decrease relative to them using swaps. In the same scenario, the bank would have a lower return on equity due to the large amounts of assets needed. In  addition, the Appendix shows that although the Twin B bank has higher risk adjusted assets, the Tier I capital to risk-adjusted asset ratio is lower compared to Banc One’s ratio. References: http://www.federalreserve.gov/Boarddocs/SupManual/trading/200901/3000p2.pdf QUESTION 2: Describe how AIR’s work. Amortizing Interest Rate Swaps (AIRS) at Banc One grew out of a desire to create a synthetic collateralized mortgage obligation (CMO) similar to swaps but with the additional returns characteristic of CMO investments. Why is Banc One using them? CMO’s are desirable investments because it allows investors to get the benefits from investing in mortgage securities and it also is structured so that investors can easily estimate speed of prepayment. AIRs work best in low interest rate environments. With low interest rates, AIRS amortize faster and banks reinvest only when yields were low. AIRs have evolved to have their amortization schedule fixed by a formula instead of being tied to a group of mortgages. Another element of AIRs desirable to Banc One centered on the fixed rate or swap spread. In AIRs, Banc One would receive a fixed rate plus LIBOR. During this time period, Banc One could receive a swap spread of 120 bps over treasuries as compared to Banc One using a standard swap or comparable CMO that yielded 100 or 20 bps over similar treasuries, respectively. QUESTION 3: What are basis swaps? Basis swaps allow Banc One to transform prime-based floating rate assets to  fixed-income investments. Why is Banc One using them? Banc One was still vulnerable to basis risk even though synthetic investments partially shielded the bank from sensitivity stemming from shifts in interests rates. Between the two rates, LIBOR and prime, LIBOR changed frequently because it was traded daily while prime changed infrequently because it was governed by bankers. Basis swaps involved Banc One paying a floating rate based on prime while receiving floating rates based on three-month LIBOR and in addition Banc One would use an AIR to mitigate the risk posed by mismatched rates. QUESTION 4: What is counterparty risk? Counter-party risk is the risk that the counter-party – the other party in the transaction – will default on its obligations. How does Banc One measure this risk? The key to measuring counter-party risk is to understand the counter-party’s ability to pay, and this is done through a counter-party’s credit rating. The higher the credit rating, the greater the likelihood that that counter-party would not default. There are other ways that institutions can assess this risk, such as through an independent analysis of the company’s financial reports. How do they manage counter-party risk? Banc One managed this risk in several ways. First, it never dealt with an entity with lower than a single-A rating. Second, Banc One monitored its mark-to-market exposure to each counter-party and limited its exposure to any given company through strict guidelines. If the exposure exceeded the specified amount according these guidelines, Banc One would reallocate its swap portfolio. Third, counter-parties were required to post additional collateral as the market value of the swap changed, similar to how a margin account works with stocks. If the swap value for the counter-party dropped, it would have to post additional collateral to cover the value of a potential default. QUESTION 5: Why might Banc One’s use of swaps be damaging to the stock price? The main problem Banc One is facing is a drop in investors’ confidence due to its increased use of interest rate swaps. As confidence in Banc One falls, so does its stock price. At that time Banc One has ten pending acquisitions, with Liberty National Bancorp being the largest and if its stock falls below the â€Å"walkaway† price of $34.55 Liberty National Bancorp will either cancel the deal or the acquisition will become dilutive in violation of the bank’s established rules. What are investors and analysts concerned about? On the one hand investors are concerned about the transparency and accuracy of Banc One’s financial reports. Since interest rate swaps were off-balance sheet transactions, they underestimated the bank’s assets and in turn overestimated its earnings performance (Net interest margin, ROA and E/A ratio). In addition, the regulatory bodies (Financial Accounting Standards Board) required minimal disclosure on the companies’ swap portfolio, and as Banc One’s portfolio increased, investors felt they could not accurately assess the risk of the bank. On the other hand the fact that Banc One was acquiring heavily asset-sensitive institutions – which required it to increase its interest rate swaps portfolio to adjust to mild liabilities sensitivity – further made investors uncomfortable because they felt the growth of the portfolio might get out of control and could further cloud Banc One’s financial performance. How should Banc One respond to these concerns? The best path for Banc One is to educate investors about the bank’s use of derivatives. If Banc One does nothing, investors will likely become more concerned with Banc One’s practices and continue to withdraw from the stock, which will result in lower a lower stock price and major complications in Banc One’s investment strategy – acquiring other banks. If Banc One limits its derivatives trading, it exposes itself and its stock holders (which it has a fiduciary duty to) to much greater levels of interest rate risk. Because Banc One’s current strategy is the most optimal strategy for higher returns with more limited risk, it must find a way to educate investors about its practices, and how these practices are in investors’ best interests. This could include the disbursement of simpler educational materials (similar to prospectuses) and meetings with fund managers and analysts to inform them of the benefits of these trading practices. Banc One should also provide more transparency to investors about the types of derivatives trades it makes, adding more information about these trades rather than detail-limited footnotes in financial statements. Banc One should also research and implement (if possible) methods to trade swaps more simply.

Tuesday, July 30, 2019

Sql Study Matetial

Oracle/SQL Tutorial1 Michael Gertz Database and Information Systems Group Department of Computer Science University of California, Davis [email  protected] ucdavis. edu http://www. db. cs. ucdavis. edu This Oracle/SQL tutorial provides a detailed introduction to the SQL query language and the Oracle Relational Database Management System. Further information about Oracle and SQL can be found on the web site www. db. cs. ucdavis. edu/dbs. Comments, corrections, or additions to these notes are welcome. Many thanks to Christina Chung for comments on the previous version. Recommended LiteratureGeorge Koch and Kevin Loney: Oracle8 The Complete Reference (The Single Most Comprehensive Sourcebook for Oracle Server, Includes CD with electronic version of the book), 1299 pages, McGraw-Hill/Osborne, 1997. Michael Abbey and Michael Corey: Oracle8 : A Beginner’s Guide [A Thorough Introduction for First-time Users], 767 pages, McGraw-Hill/Osborne, 1997. Steven Feuerstein, Bill Pribyl, Deb by Russell: Oracle PL/SQL Programming (2nd Edition), O’Reilly & Associates, 1028 pages, 1997. C. J. Date and Hugh Darwen: A Guide to the SQL Standard (4th Edition), Addison-Wesley, 1997. Jim Melton and Alan R.Simon: Understanding the New SQL: A Complete Guide (2nd Edition, Dec 2000), The Morgan Kaufmann Series in Data Management Systems, 2000. 1 revised Version 1. 01, January 2000, Michael Gertz, Copyright 2000. Contents 1. SQL – Structured Query Language 1. 1. Tables 1. 2. Queries (Part I) 1. 3. Data De? nition in SQL 1. 4. Data Modi? cations in SQL 1. 5. Queries (Part II) 1. 6. Views 1 3 6 9 11 19 2. SQL*Plus (Minimal User Guide, Editor Commands, Help System) 20 3. Oracle Data Dictionary 23 4. Application Programming 4. 1. PL/SQL 4. 1. 1 Introduction 4. 1. 2 Structure of PL/SQL Blocks 4. 1. Declarations 4. 1. 4 Language Elements 4. 1. 5 Exception Handling 4. 1. 6 Procedures and Functions 4. 1. 7 Packages 4. 1. 8 Programming in PL/SQL 4. 2. Embedded SQL and Pro*C 26 2 7 27 28 32 34 36 38 39 5. Integrity Constraints and Triggers 5. 1. Integrity Constraints 5. 1. 1 Check Constraints 5. 1. 2 Foreign Key Constraints 5. 1. 3 More About Column- and Table Constraints 5. 2. Triggers 5. 2. 1 Overview 5. 2. 2 Structure of Triggers 5. 2. 3 Example Triggers 5. 2. 4 Programming Triggers 6. System Architecture 6. 1. Storage Management and Processes 6. 2. Logical Database Structures 6. 3.Physical Database Structures 6. 4. Steps in Processing an SQL Statement 6. 5. Creating Database Objects 46 47 49 50 50 53 55 58 60 61 63 63 1 SQL – Structured Query Language 1. 1 Tables In relational database systems (DBS) data are represented using tables (relations ). A query issued against the DBS also results in a table. A table has the following structure: Column 1 Column 2 . . . Column n †¦ †¦ †¦ †¦ A table is uniquely identi? ed by its name and consists of rows that contain the stored information, each row containing exactly one tuple (or recor d ). A table can have one or more columns.A column is made up of a column name and a data type, and it describes an attribute of the tuples. The structure of a table, also called relation schema, thus is de? ned by its attributes. The type of information to be stored in a table is de? ned by the data types of the attributes at table creation time. SQL uses the terms table, row, and column for relation, tuple, and attribute, respectively. In this tutorial we will use the terms interchangeably. A table can have up to 254 columns which may have di? erent or same data types and sets of values (domains), respectively.Possible domains are alphanumeric data (strings), numbers and date formats. Oracle o? ers the following basic data types: †¢ char(n): Fixed-length character data (string), n characters long. The maximum size for n is 255 bytes (2000 in Oracle8). Note that a string of type char is always padded on right with blanks to full length of n. ( can be memory consuming). Exampl e: char(40) †¢ varchar2(n): Variable-length character string. The maximum size for n is 2000 (4000 in Oracle8). Only the bytes used for a string require storage. Example: varchar2(80) †¢ number(o, d): Numeric data type for integers and reals. = overall number of digits, d = number of digits to the right of the decimal point. Maximum values: o =38, d= ? 84 to +127. Examples: number(8), number(5,2) Note that, e. g. , number(5,2) cannot contain anything larger than 999. 99 without resulting in an error. Data types derived from number are int[eger], dec[imal], smallint and real. †¢ date: Date data type for storing date and time. The default format for a date is: DD-MMM-YY. Examples : ’13-OCT-94’, ’07-JAN-98’ 1 †¢ long: Character data up to a length of 2GB. Only one long column is allowed per table. Note: In Oracle-SQL there is no data type boolean.It can, however, be simulated by using either char(1) or number(1). As long as no constraint restricts the possible values of an attribute, it may have the special value null (for unknown). This value is di? erent from the number 0, and it is also di? erent from the empty string ’’. Further properties of tables are: †¢ the order in which tuples appear in a table is not relevant (unless a query requires an explicit sorting). †¢ a table has no duplicate tuples (depending on the query, however, duplicate tuples can appear in the query result). A database schema is a set of relation schemas.The extension of a database schema at database run-time is called a database instance or database, for short. 1. 1. 1 Example Database In the following discussions and examples we use an example database to manage information about employees, departments and salary scales. The corresponding tables can be created under the UNIX shell using the command demobld. The tables can be dropped by issuing the command demodrop under the UNIX shell. The table EMP is used to store information about employees: EMPNO ENAME JOB MGR HIREDATE SAL DEPTNO 7369 SMITH CLERK 7902 17-DEC-80 800 20 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 30 7521WARD SALESMAN 7698 22-FEB-81 1250 30 †¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦.. 7698 BLAKE MANAGER 01-MAY-81 3850 30 7902 FORD ANALYST 7566 03-DEC-81 3000 10 For the attributes, the following data types are de? ned: EMPNO:number(4), ENAME:varchar2(30), JOB:char(10), MGR:number(4), HIREDATE:date, SAL:number(7,2), DEPTNO:number(2) Each row (tuple) from the table is interpreted as follows: an employee has a number, a name, a job title and a salary. Furthermore, for each employee the number of his/her manager, the date he/she was hired, and the number of the department where he/she is working are stored. 2The table DEPT stores information about departments (number, name, and location): DEPTNO 10 20 30 40 DNAME STORE RESEARCH SALES MARKETING L OC CHICAGO DALLAS NEW YORK BOSTON Finally, the table SALGRADE contains all information about the salary scales, more precisely, the maximum and minimum salary of each scale. GRADE 1 2 3 4 5 1. 2 LOSAL 700 1201 1401 2001 3001 HISAL 1200 1400 2000 3000 9999 Queries (Part I) In order to retrieve the information stored in the database, the SQL query language is used. In the following we restrict our attention to simple SQL queries and defer the discussion of more complex queries to Section 1. In SQL a query has the following (simpli? ed) form (components in brackets [ ] are optional): select [distinct] from [ where ] [ order by ] 1. 2. 1 Selecting Columns The columns to be selected from a table are speci? ed after the keyword select. This operation is also called projection. For example, the query select LOC, DEPTNO from DEPT; lists only the number and the location for each tuple from the relation DEPT. If all columns should be selected, the asterisk symbol â€Å"? † can be used to denote all attributes. The query select ? from EMP; retrieves all tuples with all columns from the table EMP.Instead of an attribute name, the select clause may also contain arithmetic expressions involving arithmetic operators etc. select ENAME, DEPTNO, SAL ? 1. 55 from EMP; 3 For the di? erent data types supported in Oracle, several operators and functions are provided: †¢ for numbers: abs, cos, sin, exp, log, power, mod, sqrt, +, ? , ? , /, . . . †¢ for strings: chr, concat(string1, string2), lower, upper, replace(string, search string, replacement string), translate, substr(string, m, n), length, to date, . . . †¢ for the date data type: add month, month between, next day, to char, . . The usage of these operations is described in detail in the SQL*Plus help system (see also Section 2). Consider the query select DEPTNO from EMP; which retrieves the department number for each tuple. Typically, some numbers will appear more than only once in the query result, tha t is, duplicate result tuples are not automatically eliminated. Inserting the keyword distinct after the keyword select, however, forces the elimination of duplicates from the query result. It is also possible to specify a sorting order in which the result tuples of a query are displayed.For this the order by clause is used and which has one or more attributes listed in the select clause as parameter. desc speci? es a descending order and asc speci? es an ascending order (this is also the default order). For example, the query select ENAME, DEPTNO, HIREDATE from EMP; from EMP order by DEPTNO [asc], HIREDATE desc; displays the result in an ascending order by the attribute DEPTNO. If two tuples have the same attribute value for DEPTNO, the sorting criteria is a descending order by the attribute values of HIREDATE. For the above query, we would get the following output: ENAME DEPTNO HIREDATEFORD 10 03-DEC-81 SMITH 20 17-DEC-80 BLAKE 30 01-MAY-81 WARD 30 22-FEB-81 ALLEN 30 20-FEB-81 â⠂¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦ 1. 2. 2 Selection of Tuples Up to now we have only focused on selecting (some) attributes of all tuples from a table. If one is interested in tuples that satisfy certain conditions, the where clause is used. In a where clause simple conditions based on comparison operators can be combined using the logical connectives and, or, and not to form complex conditions. Conditions may also include pattern matching operations and even subqueries (Section 1. 5). 4 Example:List the job title and the salary of those employees whose manager has the number 7698 or 7566 and who earn more than 1500: select JOB, SAL from EMP where (MGR = 7698 or MGR = 7566) and SAL > 1500; For all data types, the comparison operators =, ! = or , , are allowed in the conditions of a where clause. Further comparison operators are: †¢ Set Conditions: [not] in () Example: select ? from DEPT where DEPTNO in (20,30); †¢ Null value: is [not] null, i. e. , for a tuple to be selected there must (not) exist a de? ned value for this column. Example: select ? from EMP where MGR is not null; Note: the operations = null and ! null are not de? ned! †¢ Domain conditions: [not] between and Example: †¢ select EMPNO, ENAME, SAL from EMP where SAL between 1500 and 2500; †¢ select ENAME from EMP where HIREDATE between ’02-APR-81’ and ’08-SEP-81’; 1. 2. 3 String Operations In order to compare an attribute with a string, it is required to surround the string by apostrophes, e. g. , where LOCATION = ’DALLAS’. A powerful operator for pattern matching is the like operator. Together with this operator, two special characters are used: the percent sign % (also called wild card), and the underline , also called position marker.For example, if one is interested in all tuples of the table DEPT that contain two C in the name of the department, the condition would be where DNAME like ’%C%C%â⠂¬â„¢. The percent sign means that any (sub)string is allowed there, even the empty string. In contrast, the underline stands for exactly one character. Thus the condition where DNAME like ’%C C%’ would require that exactly one character appears between the two Cs. To test for inequality, the not clause is used. Further string operations are: †¢ upper() takes a string and converts any letters in it to uppercase, e. g. DNAME = upper(DNAME) (The name of a department must consist only of upper case letters. ) †¢ lower() converts any letter to lowercase, †¢ initcap() converts the initial letter of every word in to uppercase. †¢ length() returns the length of the string. †¢ substr(, n [, m]) clips out a m character piece of , starting at position n. If m is not speci? ed, the end of the string is assumed. substr(’DATABASE SYSTEMS’, 10, 7) returns the string ’SYSTEMS’. 5 1. 2. 4 Aggregate Functions Aggregate functions are statistical functions such as count, min, max etc. They are used to compute a single value from a set of attribute values of a column: count ax min sum avg Note: 1. 3 1. 3. 1 Counting Rows Example: How many tuples are stored in the relation EMP? select count(? ) from EMP; Example: How many di? erent job titles are stored in the relation EMP? select count(distinct JOB) from EMP; Maximum value for a column Minimum value for a column Example: List the minimum and maximum salary. select min(SAL), max(SAL) from EMP; Example: Compute the di? erence between the minimum and maximum salary. select max(SAL) – min(SAL) from EMP; Computes the sum of values (only applicable to the data type number) Example: Sum of all salaries of employees working in the department 30. elect sum(SAL) from EMP where DEPTNO = 30; Computes average value for a column (only applicable to the data type number) avg, min and max ignore tuples that have a null value for the speci? ed attribute, but count considers null values. Data De? nition in SQL Creating Tables The SQL command for creating an empty table has the following form: create table ( [not null] [unique] [], †¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦ [not null] [unique] [], [] ); For each column, a name and a data type must be speci? ed and the column name must be unique within the table de? nition. Column de? nitions are separated by colons. There is no di? rence between names in lower case letters and names in upper case letters. In fact, the only place where upper and lower case letters matter are strings comparisons. A not null 6 constraint is directly speci? ed after the data type of the column and the constraint requires de? ned attribute values for that column, di? erent from null. The keyword unique speci? es that no two tuples can have the same attribute value for this column. Unless the condition not null is also speci? ed for this column, the attribute value null is allowed and two tuples having the attribute value null for this column do not violate the constraint.Example: The create table statement for our EMP table has the form create table EMP ( EMPNO number(4) not null, ENAME varchar2(30) not null, JOB varchar2(10), MGR number(4), HIREDATE date, SAL number(7,2), DEPTNO number(2) ); Remark: Except for the columns EMPNO and ENAME null values are allowed. 1. 3. 2 Constraints The de? nition of a table may include the speci? cation of integrity constraints. Basically two types of constraints are provided: column constraints are associated with a single column whereas table constraints are typically associated with more than one column.However, any column constraint can also be formulated as a table constraint. In this section we consider only very simple constraints. More complex constraints will be discussed in Section 5. 1. The speci? cation of a (simple) constraint has the following form: [constraint ] primary key | unique | not null A constraint can be named. It is advisable to name a constraint in order to get m ore meaningful information when this constraint is violated due to, e. g. , an insertion of a tuple that violates the constraint. If no name is speci? ed for the constraint, Oracle automatically generates a name of the pattern SYS C.The two most simple types of constraints have already been discussed: not null and unique. Probably the most important type of integrity constraints in a database are primary key constraints. A primary key constraint enables a unique identi? cation of each tuple in a table. Based on a primary key, the database system ensures that no duplicates appear in a table. For example, for our EMP table, the speci? cation create table EMP ( EMPNO number(4) constraint pk emp primary key, . . . ); 7 de? nes the attribute EMPNO as the primary key for the table. Each value for the attribute EMPNO thus must appear only once in the table EMP.A table, of course, may only have one primary key. Note that in contrast to a unique constraint, null values are not allowed. Examp le: We want to create a table called PROJECT to store information about projects. For each project, we want to store the number and the name of the project, the employee number of the project’s manager, the budget and the number of persons working on the project, and the start date and end date of the project. Furthermore, we have the following conditions: – a project is identi? ed by its project number, – the name of a project must be unique, – the manager and the budget must be de? ed. Table de? nition: create table PROJECT ( PNO number(3) constraint prj pk primary key, PNAME varchar2(60) unique, PMGR number(4) not null, PERSONS number(5), BUDGET number(8,2) not null, PSTART date, PEND date); A unique constraint can include more than one attribute. In this case the pattern unique(, . . . , ) is used. If it is required, for example, that no two projects have the same start and end date, we have to add the table constraint constraint no same dates unique( PEND, PSTART) This constraint has to be de? ned in the create table command after both columns PEND and PSTART have been de? ed. A primary key constraint that includes more than only one column can be speci? ed in an analogous way. Instead of a not null constraint it is sometimes useful to specify a default value for an attribute if no value is given, e. g. , when a tuple is inserted. For this, we use the default clause. Example : If no start date is given when inserting a tuple into the table PROJECT, the project start date should be set to January 1st, 1995: PSTART date default(’01-JAN-95’) Note: Unlike integrity constraints, it is not possible to specify a name for a default. 8 1. 3. 3 Checklist for Creating TablesThe following provides a small checklist for the issues that need to be considered before creating a table. †¢ What are the attributes of the tuples to be stored? What are the data types of the attributes? Should varchar2 be used instead of char ? â⠂¬ ¢ Which columns build the primary key? †¢ Which columns do (not) allow null values? Which columns do (not) allow duplicates ? †¢ Are there default values for certain columns that allow null values ? 1. 4 Data Modi? cations in SQL After a table has been created using the create table command, tuples can be inserted into the table, or tuples can be deleted or modi? ed. 1. 4. 1Insertions The most simple way to insert a tuple into a table is to use the insert statement insert into [()] values (); For each of the listed columns, a corresponding (matching) value must be speci? ed. Thus an insertion does not necessarily have to follow the order of the attributes as speci? ed in the create table statement. If a column is omitted, the value null is inserted instead. If no column list is given, however, for each column as de? ned in the create table statement a value must be given. Examples: insert into PROJECT(PNO, PNAME, PERSONS, BUDGET, PSTART) values(313, ’DBS’, 4, 150000. 42, ’10-OCT-94’); r insert into PROJECT values(313, ’DBS’, 7411, null, 150000. 42, ’10-OCT-94’, null); If there are already some data in other tables, these data can be used for insertions into a new table. For this, we write a query whose result is a set of tuples to be inserted. Such an insert statement has the form insert into [()] Example: Suppose we have de? ned the following table: 9 create table OLDEMP ( ENO number(4) not null, HDATE date); We now can use the table EMP to insert tuples into this new relation: insert into OLDEMP (ENO, HDATE) select EMPNO, HIREDATE from EMP where HIREDATE < ’31-DEC-60’; 1. 4. 2 UpdatesFor modifying attribute values of (some) tuples in a table, we use the update statement: update set = , . . . , = [where ]; An expression consists of either a constant (new value), an arithmetic or string operation, or an SQL query. Note that the new value to assign to must a the matching data typ e. An update statement without a where clause results in changing respective attributes of all tuples in the speci? ed table. Typically, however, only a (small) portion of the table requires an update. Examples: †¢ The employee JONES is transfered to the department 20 as a manager and his salary is increased by 1000: pdate EMP set JOB = ’MANAGER’, DEPTNO = 20, SAL = SAL +1000 where ENAME = ’JONES’; †¢ All employees working in the departments 10 and 30 get a 15% salary increase. update EMP set SAL = SAL ? 1. 15 where DEPTNO in (10,30); Analogous to the insert statement, other tables can be used to retrieve data that are used as new values. In such a case we have a instead of an . Example: All salesmen working in the department 20 get the same salary as the manager who has the lowest salary among all managers. update EMP set SAL = (select min(SAL) from EMP where JOB = ’MANAGER’) where JOB = ’SALESMAN’ and DEPTNO = 20;Ex planation: The query retrieves the minimum salary of all managers. This value then is assigned to all salesmen working in department 20. 10 It is also possible to specify a query that retrieves more than only one value (but still only one tuple! ). In this case the set clause has the form set() = . It is important that the order of data types and values of the selected row exactly correspond to the list of columns in the set clause. 1. 4. 3 Deletions All or selected tuples can be deleted from a table using the delete command: delete from [where ]; If the where clause is omitted, all tuples are deleted from the table.An alternative command for deleting all tuples from a table is the truncate table command. However, in this case, the deletions cannot be undone (see subsequent Section 1. 4. 4). Example: Delete all projects (tuples) that have been ? nished before the actual date (system date): delete from PROJECT where PEND < sysdate; sysdate is a function in SQL that returns the system date. Another important SQL function is user, which returns the name of the user logged into the current Oracle session. 1. 4. 4 Commit and Rollback A sequence of database modi? cations, i. e. , a sequence of insert, update, and delete statements, is called a transaction.Modi? cations of tuples are temporarily stored in the database system. They become permanent only after the statement commit; has been issued. As long as the user has not issued the commit statement, it is possible to undo all modi? cations since the last commit. To undo modi? cations, one has to issue the statement rollback;. It is advisable to complete each modi? cation of the database with a commit (as long as the modi? cation has the expected e? ect). Note that any data de? nition command such as create table results in an internal commit. A commit is also implicitly executed when the user terminates an Oracle session. . 5 Queries (Part II) In Section 1. 2 we have only focused on queries that refer to exactly o ne table. Furthermore, conditions in a where were restricted to simple comparisons. A major feature of relational databases, however, is to combine (join) tuples stored in di? erent tables in order to display more meaningful and complete information. In SQL the select statement is used for this kind of queries joining relations: 11 select [distinct] [. ], . . . , [. ] from [], . . . , [] [where ] The speci? cation of table aliases in the from clause is necessary to refer to columns that have the same name in di? rent tables. For example, the column DEPTNO occurs in both EMP and DEPT. If we want to refer to either of these columns in the where or select clause, a table alias has to be speci? ed and put in the front of the column name. Instead of a table alias also the complete relation name can be put in front of the column such as DEPT. DEPTNO, but this sometimes can lead to rather lengthy query formulations. 1. 5. 1 Joining Relations Comparisons in the where clause are used to comb ine rows from the tables listed in the from clause. Example : In the table EMP only the numbers of the departments are stored, not their name.For each salesman, we now want to retrieve the name as well as the number and the name of the department where he is working: select ENAME, E. DEPTNO, DNAME from EMP E, DEPT D where E. DEPTNO = D. DEPTNO and JOB = ’SALESMAN’; Explanation: E and D are table aliases for EMP and DEPT, respectively. The computation of the query result occurs in the following manner (without optimization): 1. Each row from the table EMP is combined with each row from the table DEPT (this operation is called Cartesian product ). If EMP contains m rows and DEPT contains n rows, we thus get n ? m rows. 2.From these rows those that have the same department number are selected (where E. DEPTNO = D. DEPTNO). 3. From this result ? nally all rows are selected for which the condition JOB = ’SALESMAN’ holds. In this example the joining condition f or the two tables is based on the equality operator â€Å"=†. The columns compared by this operator are called join columns and the join operation is called an equijoin. Any number of tables can be combined in a select statement. Example: For each project, retrieve its name, the name of its manager, and the name of the department where the manager is working: select ENAME, DNAME, PNAME rom EMP E, DEPT D, PROJECT P where E. EMPNO = P. MGR and D. DEPTNO = E. DEPTNO; 12 It is even possible to join a table with itself: Example: List the names of all employees together with the name of their manager: select E1. ENAME, E2. ENAME from EMP E1, EMP E2 where E1. MGR = E2. EMPNO; Explanation: The join columns are MGR for the table E1 and EMPNO for the table E2. The equijoin comparison is E1. MGR = E2. EMPNO. 1. 5. 2 Subqueries Up to now we have only concentrated on simple comparison conditions in a where clause, i. e. , we have compared a column with a constant or we have compared two c olumns.As we have already seen for the insert statement, queries can be used for assignments to columns. A query result can also be used in a condition of a where clause. In such a case the query is called a subquery and the complete select statement is called a nested query. A respective condition in the where clause then can have one of the following forms: 1. Set-valued subqueries [not] in () [any|all] () An can either be a column or a computed value. 2. Test for (non)existence [not] exists () In a where clause conditions using subqueries can be combined arbitrarily by using the logical connectives and and or.Example: List the name and salary of employees of the department 20 who are leading a project that started before December 31, 1990: select ENAME, SAL from EMP where EMPNO in (select PMGR from PROJECT where PSTART < ’31-DEC-90’) and DEPTNO =20; Explanation: The subquery retrieves the set of those employees who manage a project that started before December 31, 1 990. If the employee working in department 20 is contained in this set (in operator), this tuple belongs to the query result set. Example: List all employees who are working in a department located in BOSTON: 13 select ? from EMP where DEPTNO in select DEPTNO from DEPT where LOC = ’BOSTON’); The subquery retrieves only one value (the number of the department located in Boston). Thus it is possible to use â€Å"=† instead of in. As long as the result of a subquery is not known in advance, i. e. , whether it is a single value or a set, it is advisable to use the in operator. A subquery may use again a subquery in its where clause. Thus conditions can be nested arbitrarily. An important class of subqueries are those that refer to its surrounding (sub)query and the tables listed in the from clause, respectively. Such type of queries is called correlated subqueries.Example: List all those employees who are working in the same department as their manager (note that co mponents in [ ] are optional: select ? from EMP E1 where DEPTNO in (select DEPTNO from EMP [E] where [E. ]EMPNO = E1. MGR); Explanation: The subquery in this example is related to its surrounding query since it refers to the column E1. MGR. A tuple is selected from the table EMP (E1) for the query result if the value for the column DEPTNO occurs in the set of values select in the subquery. One can think of the evaluation of this query as follows: For each tuple in the table E1, the subquery is evaluated individually.If the condition where DEPTNO in . . . evaluates to true, this tuple is selected. Note that an alias for the table EMP in the subquery is not necessary since columns without a preceding alias listed there always refer to the innermost query and tables. Conditions of the form [any|all] are used to compare a given with each value selected by . †¢ For the clause any, the condition evaluates to true if there exists at least on row selected by the subquery for which the comparison holds. If the subquery yields an empty result set, the condition is not satis? ed. For the clause all, in contrast, the condition evaluates to true if for all rows selected by the subquery the comparison holds. In this case the condition evaluates to true if the subquery does not yield any row or value. Example: Retrieve all employees who are working in department 10 and who earn at least as much as any (i. e. , at least one) employee working in department 30: select ? from EMP where SAL >= any (select SAL from EMP where DEPTNO = 30) and DEPTNO = 10; 14 Note: Also in this subquery no aliases are necessary since the columns refer to the innermost from clause.Example: List all employees who are not working in department 30 and who earn more than all employees working in department 30: select ? from EMP where SAL > all (select SAL from EMP where DEPTNO = 30) and DEPTNO 30; For all and any, the following equivalences hold: in ? = any not in ? all or ! = all Often a query resu lt depends on whether certain rows do (not) exist in (other) tables. Such type of queries is formulated using the exists operator. Example: List all departments that have no employees: select ? from DEPT where not exists (select ? from EMP where DEPTNO = DEPT.DEPTNO); Explanation: For each tuple from the table DEPT, the condition is checked whether there exists a tuple in the table EMP that has the same department number (DEPT. DEPTNO). In case no such tuple exists, the condition is satis? ed for the tuple under consideration and it is selected. If there exists a corresponding tuple in the table EMP, the tuple is not selected. 1. 5. 3 Operations on Result Sets Sometimes it is useful to combine query results from two or more queries into a single result. SQL supports three set operators which have the pattern: The set operators are: union [all] returns a table consisting of all rows either appearing in the result of or in the result of . Duplicates are automatically eliminated unless the clause all is used. †¢ intersect returns all rows that appear in both results and . †¢ minus returns those rows that appear in the result of but not in the result of . 15 Example: Assume that we have a table EMP2 that has the same structure and columns as the table EMP: †¢ All employee numbers and names from both tables: select EMPNO, ENAME from EMP union select EMPNO, ENAME from EMP2; †¢ Employees who are listed in both EMP and EMP2: select ? from EMP intersect select ? from EMP2; Employees who are only listed in EMP: select ? from EMP minus select ? from EMP2; Each operator requires that both tables have the same data types for the columns to which the operator is applied. 1. 5. 4 Grouping In Section 1. 2. 4 we have seen how aggregate functions can be used to compute a single value for a column. Often applications require grouping rows that have certain properties and then applying an aggregate function on one column for each group separately. For this, SQ L provides the clause group by . This clause appears after the where clause and must refer to columns of tables listed in the from clause. select from here group by [having ]; Those rows retrieved by the selected clause that have the same value(s) for are grouped. Aggregations speci? ed in the select clause are then applied to each group separately. It is important that only those columns that appear in the clause can be listed without an aggregate function in the select clause ! Example: For each department, we want to retrieve the minimum and maximum salary. select DEPTNO, min(SAL), max(SAL) from EMP group by DEPTNO; Rows from the table EMP are grouped such that all rows in a group have the same department number. The aggregate functions are then applied to each such group.We thus get the following query result: 16 DEPTNO 10 20 30 MIN(SAL) 1300 800 950 MAX(SAL) 5000 3000 2850 Rows to form a group can be restricted in the where clause. For example, if we add the condition where JOB = ’CLERK’, only respective rows build a group. The query then would retrieve the minimum and maximum salary of all clerks for each department. Note that is not allowed to specify any other column than DEPTNO without an aggregate function in the select clause since this is the only column listed in the group by clause (is it also easy to see that other columns would not make any sense).Once groups have been formed, certain groups can be eliminated based on their properties, e. g. , if a group contains less than three rows. This type of condition is speci? ed using the having clause. As for the select clause also in a having clause only and aggregations can be used. Example: Retrieve the minimum and maximum salary of clerks for each department having more than three clerks. select DEPTNO, min(SAL), max(SAL) from EMP where JOB = ’CLERK’ group by DEPTNO having count(? ) > 3; Note that it is even possible to specify a subquery in a having clause.In the above query, for example, instead of the constant 3, a subquery can be speci? ed. A query containing a group by clause is processed in the following way: 1. Select all rows that satisfy the condition speci? ed in the where clause. 2. From these rows form groups according to the group by clause. 3. Discard all groups that do not satisfy the condition in the having clause. 4. Apply aggregate functions to each group. 5. Retrieve values for the columns and aggregations listed in the select clause. 1. 5. 5 Some Comments on Tables Accessing tables of other usersProvided that a user has the privilege to access tables of other users (see also Section 3), she/he can refer to these tables in her/his queries. Let be a user in the Oracle system and a table of this user. This table can be accessed by other (privileged) users using the command select ? from . ; 17 In case that one often refers to tables of other users, it is useful to use a synonym instead of .. In Oracle-SQL a synonym can be created u sing the command create synonym for . ; It is then possible to use simply in a from clause. Synonyms can also be created for one’s own tables. Adding Comments to De? nitionsFor applications that include numerous tables, it is useful to add comments on table de? nitions or to add comments on columns. A comment on a table can be created using the command comment on table is ’’; A comment on a column can be created using the command comment on column . is ’’; Comments on tables and columns are stored in the data dictionary. They can be accessed using the data dictionary views USER TAB COMMENTS and USER COL COMMENTS (see also Section 3). Modifying Table- and Column De? nitions It is possible to modify the structure of a table (the relation schema) even if rows have already been inserted into this table.A column can be added using the alter table command alter table add( [default ] []); If more than only one column should be added at one time, respectiv e add clauses need to be separated by colons. A table constraint can be added to a table using alter table add (); Note that a column constraint is a table constraint, too. not null and primary key constraints can only be added to a table if none of the speci? ed columns contains a null value. Table de? nitions can be modi? ed in an analogous way. This is useful, e. g. , when the size of strings that can be stored needs to be increased.The syntax of the command for modifying a column is alter table modify( [] [default ] []); Note: In earlier versions of Oracle it is not possible to delete single columns from a table de? nition. A workaround is to create a temporary table and to copy respective columns and rows into this new table. Furthermore, it is not possible to rename tables or columns. In the most recent version (9i), using the alter table command, it is possible to rename a table, columns, and constraints. In this version, there also exists a drop column clause as part of the alter table statement. Deleting a TableA table and its rows can be deleted by issuing the command drop table [cascade constraints];. 18 1. 6 Views In Oracle the SQL command to create a view (virtual table) has the form create [or replace] view [()] as [with check option [constraint ]]; The optional clause or replace re-creates the view if it already exists. names the columns of the view. If is not speci? ed in the view de? nition, the columns of the view get the same names as the attributes listed in the select statement (if possible). Example: The following view contains the name, job title and the annual salary of employees working in the department 20: create view DEPT20 as elect ENAME, JOB, SAL? 12 ANNUAL SALARY from EMP where DEPTNO = 20; In the select statement the column alias ANNUAL SALARY is speci? ed for the expression SAL? 12 and this alias is taken by the view. An alternative formulation of the above view de? nition is create view DEPT20 (ENAME, JOB, ANNUAL SALARY) as se lect ENAME, JOB, SAL ? 12 from EMP where DEPTNO = 20; A view can be used in the same way as a table, that is, rows can be retrieved from a view (also respective rows are not physically stored, but derived on basis of the select statement in the view de? ition), or rows can even be modi? ed. A view is evaluated again each time it is accessed. In Oracle SQL no insert, update, or delete modi? cations on views are allowed that use one of the following constructs in the view de? nition: †¢ Joins †¢ Aggregate function such as sum, min, max etc. †¢ set-valued subqueries (in, any, all) or test for existence (exists) †¢ group by clause or distinct clause In combination with the clause with check option any update or insertion of a row into the view is rejected if the new/modi? ed row does not meet the view de? nition, i. e. these rows would not be selected based on the select statement. A with check option can be named using the constraint clause. A view can be deleted us ing the command delete . 19 2 SQL*Plus Introduction SQL*Plus is the interactive (low-level) user interface to the Oracle database management system. Typically, SQL*Plus is used to issue ad-hoc queries and to view the query result on the screen. Some of the features of SQL*Plus are: †¢ A built-in command line editor can be used to edit (incorrect) SQL queries. Instead of this line editor any editor installed on the computer can be invoked. There are numerous commands to format the output of a query. †¢ SQL*Plus provides an online-help. †¢ Query results can be stored in ? les which then can be printed. Queries that are frequently issued can be saved to a ? le and invoked later. Queries can be parameterized such that it is possible to invoke a saved query with a parameter. A Minimal User Guide Before you start SQL*Plus make sure that the following UNIX shell variables are properly set (shell variables can be checked using the env command, e. g. , env | grep ORACLE): â₠¬ ¢ ORACLE HOME, e. g. , ORACLE HOME=/usr/pkg/oracle/734 †¢ ORACLE SID, e. , ORACLE SID=prod In order to invoke SQL*Plus from a UNIX shell, the command sqlplus has to be issued. SQL*Plus then displays some information about the product, and prompts you for your user name and password for the Oracle system. gertz(catbert)54: sqlplus SQL*Plus: Release 3. 3. 4. 0. 1 – Production on Sun Dec 20 19:16:52 1998 Copyright (c) Oracle Corporation 1979, 1996. All rights reserved. Enter user-name: scott Enter password: Connected to: Oracle7 Server Release 7. 3. 4. 0. 1 – Production Release With the distributed option PL/SQL Release 2. 3. 4. 0. 0 – Production SQL> 20SQL> is the prompt you get when you are connected to the Oracle database system. In SQL*Plus you can divide a statement into separate lines, each continuing line is indicated by a prompt such 2>, 3> etc. An SQL statement must always be terminated by a semicolon (;). In addition to the SQL statements discussed in the previous section, SQL*Plus provides some special SQL*Plus commands. These commands need not be terminated by a semicolon. Upper and lower case letters are only important for string comparisons. An SQL query can always be interrupted by using C. To exit SQL*Plus you can either type exit or quit.Editor Commands The most recently issued SQL statement is stored in the SQL bu? er, independent of whether the statement has a correct syntax or not. You can edit the bu? er using the following commands: †¢ l[ist] lists all lines in the SQL bu? er and sets the current line (marked with an †? †) to the last line in the bu? er. †¢ l sets the actual line to †¢ c[hange]// replaces the ? rst occurrence of by (for the actual line) †¢ a[ppend] appends to the current line †¢ del deletes the current line †¢ r[un] executes the current bu? er contents †¢ get reads the data from the ? le into the bu? er †¢ save writes the current bu? r into the ? le †¢ edit invokes an editor and loads the current bu? er into the editor. After exiting the editor the modi? ed SQL statement is stored in the bu? er and can be executed (command r). The editor can be de? ned in the SQL*Plus shell by typing the command de? ne editor = , where can be any editor such as emacs, vi, joe, or jove. SQL*Plus Help System and Other Useful Commands †¢ To get the online help in SQL*Plus just type help , or just help to get information about how to use the help command. In Oracle Version 7 one can get the complete list of possible commands by typing help command. To change the password, in Oracle Version 7 the command alter user identi? ed by ; is used. In Oracle Version 8 the command passw prompts the user for the old/new password. †¢ The command desc[ribe] lists all columns of the given table together with their data types and information about whether null values are allowed or not. †¢ You can invoke a UNIX command from the SQL*Plus she ll by using host . For example, host ls -la *. sql lists all SQL ? les in the current directory. 21 †¢ You can log your SQL*Plus session and thus queries and query results by using the command spool .All information displayed on screen is then stored in which automatically gets the extension . lst. The command spool o? turns spooling o?. †¢ The command copy can be used to copy a complete table. For example, the command copy from scott/tiger create EMPL using select ? from EMP; copies the table EMP of the user scott with password tiger into the relation EMPL. The relation EMP is automatically created and its structure is derived based on the attributes listed in the select clause. †¢ SQL commands saved in a ? le . sql can be loaded into SQL*Plus and executed using the command @. Comments are introduced by the clause rem[ark] (only allowed between SQL statements), or – – (allowed within SQL statements). Formatting the Output SQL*Plus provides numerous comm ands to format query results and to build simple reports. For this, format variables are set and these settings are only valid during the SQL*Plus session. They get lost after terminating SQL*Plus. It is, however, possible to save settings in a ? le named login. sql in your home directory. Each time you invoke SQL*Plus this ? le is automatically loaded. The command column . . . is used to format columns of your query result.The most frequently used options are: †¢ format A For alphanumeric data, this option sets the length of to . For columns having the data type number, the format command can be used to specify the format before and after the decimal point. For example, format 99,999. 99 speci? es that if a value has more than three digits in front of the decimal point, digits are separated by a colon, and only two digits are displayed after the decimal point. †¢ The option heading relabels and gives it a new heading. †¢ null is used to specify the output of null val ues (typically, null values are not displayed). column clear deletes the format de? nitions for . The command set linesize can be used to set the maximum length of a single line that can be displayed on screen. set pagesize sets the total number of lines SQL*Plus displays before printing the column names and headings, respectively, of the selected rows. Several other formatting features can be enabled by setting SQL*Plus variables. The command show all displays all variables and their current values. To set a variable, type set . For example, set timing on causes SQL*Plus to display timing statistics for each SQL command that is executed. et pause on [] makes SQL*Plus wait for you to press Return after the number of lines de? ned by set pagesize has been displayed. is the message SQL*Plus will display at the bottom of the screen as it waits for you to hit Return. 22 3 Oracle Data Dictionary The Oracle data dictionary is one of the most important components of the Oracle DBMS. It con tains all information about the structures and objects of the database such as tables, columns, users, data ? les etc. The data stored in the data dictionary are also often called metadata.Although it is usually the domain of database administrators (DBAs), the data dictionary is a valuable source of information for end users and developers. The data dictionary consists of two levels: the internal level contains all base tables that are used by the various DBMS software components and they are normally not accessible by end users. The external level provides numerous views on these base tables to access information about objects and structures at di? erent levels of detail. 3. 1 Data Dictionary Tables An installation of an Oracle database always includes the creation of three standard Oracle users: SYS: This is the owner of all data dictionary tables and views. This user has the highest privileges to manage objects and structures of an Oracle database such as creating new users. â⠂¬ ¢ SYSTEM: is the owner of tables used by di? erent tools such SQL*Forms, SQL*Reports etc. This user has less privileges than SYS. †¢ PUBLIC: This is a â€Å"dummy† user in an Oracle database. All privileges assigned to this user are automatically assigned to all users known in the database. The tables and views provided by the data dictionary contain information about †¢ users and their privileges, tables, table columns and their data types, integrity constraints, indexes, †¢ statistics about tables and indexes used by the optimizer, †¢ privileges granted on database objects, †¢ storage structures of the database. The SQL command select ? from DICT[IONARY]; lists all tables and views of the data dictionary that are accessible to the user. The selected information includes the name and a short description of each table and view. Before issuing this query, check the column de? nitions of DICT[IONARY] using desc DICT[IONARY] and set the appropriate va lues for column using the format command. The query select ? from TAB; etrieves the names of all tables owned by the user who issues this command. The query select ? from COL; 23 returns all information about the columns of one’s own tables. Each SQL query requires various internal accesses to the tables and views of the data dictionary. Since the data dictionary itself consists of tables, Oracle has to generate numerous SQL statements to check whether the SQL command issued by a user is correct and can be executed. Example: The SQL query select ? from EMP where SAL > 2000; requires a veri? cation whether (1) the table EMP exists, (2) the user has the privilege to access this table, (3) the column SAL is de? ed for this table etc. 3. 2 Data Dictionary Views The external level of the data dictionary provides users a front end to access information relevant to the users. This level provides numerous views (in Oracle7 approximately 540) that represent (a portion of the) data fro m the base tables in a readable and understandable manner. These views can be used in SQL queries just like normal tables. The views provided by the data dictionary are divided into three groups: USER, ALL, and DBA. The group name builds the pre? x for each view name. For some views, there are associated synonyms as given in brackets below. USER : Tuples in the USER views contain information about objects owned by the account performing the SQL query (current user) USER TABLES USER USER USER USER USER USER CATALOG COL COMMENTS CONSTRAINTS INDEXES OBJECTS TAB COLUMNS USER USER USER USER TAB COMMENTS TRIGGERS USERS VIEWS all tables with their name, number of columns, storage information, statistical information etc. (TABS) tables, views, and synonyms (CAT) comments on columns constraint de? nitions for tables all information about indexes created for tables (IND) all database objects owned by the user (OBJ) columns of the tables and views owned by the user COLS) comments on tables and views triggers de? ned by the user information about the current user views de? ned by the user †¢ ALL : Rows in the ALL views include rows of the USER views and all information about objects that are accessible to the current user. The structure of these views is analogous to the structure of the USER views. 24 ALL CATALOG owner, name and type of all accessible tables, views, and synonyms ALL TABLES owner and name of all accessible tables ALL OBJECTS owner, type, and name of accessible database objects ALL TRIGGERS . . . ALL USERS †¦ ALL VIEWS †¦ DBA : The DBA views encompass information about all database objects, regardless of the owner. Only users with DBA privileges can access these views. DBA DBA DBA DBA DBA TABLES CATALOG OBJECTS DATA FILES USERS tables of all users in the database tables, views, and synonyms de? ned in the database object of all users information about data ? les information about all users known in the database 25 4 Application Programming 4 . 1 4. 1. 1 PL/SQL Introduction The development of database applications typically requires language constructs similar to those that can be found in programming languages such as C, C++, or Pascal.These constructs are necessary in order to implement complex data structures and algorithms. A major restriction of the database language SQL, however, is that many tasks cannot be accomplished by using only the provided language elements. PL/SQL (Procedural Language/SQL) is a procedural extension of Oracle-SQL that o? ers language constructs similar to those in imperative programming languages. PL/SQL allows users and designers to develop complex database applications that require the usage of control structures and procedural elements such as procedures, functions, and modules. The basic construct in PL/SQL is a block.Blocks allow designers to combine logically related (SQL-) statements into units. In a block, constants and variables can be declared, and variables can be used to store q uery results. Statements in a PL/SQL block include SQL statements, control structures (loops), condition statements (if-then-else), exception handling, and calls of other PL/SQL blocks. PL/SQL blocks that specify procedures and functions can be grouped into packages. A package is similar to a module and has an interface and an implementation part. Oracle o? ers several prede? ned packages, for example, input/output routines, ? le handling, job scheduling etc. see directory $ORACLE HOME/rdbms/admin). Another important feature of PL/SQL is that it o? ers a mechanism to process query results in a tuple-oriented way, that is, one tuple at a time. For this, cursors are used. A cursor basically is a pointer to a query result and is used to read attribute values of selected tuples into variables. A cursor typically is used in combination with a loop construct such that each tuple read by the cursor can be processed individually. In summary, the major goals of PL/SQL are to †¢ increase the expressiveness of SQL, †¢ process query results in a tuple-oriented way, †¢ optimize combined SQL statements, develop modular database application programs, †¢ reuse program code, and †¢ reduce the cost for maintaining and changing applications. 26 4. 1. 2 Structure of PL/SQL-Blocks PL/SQL is a block-structured language. Each block builds a (named) program unit, and blocks can be nested. Blocks that build a procedure, a function, or a package must be named. A PL/SQL block has an optional declare section, a part containing PL/SQL statements, and an optional exception-handling part. Thus the structure of a PL/SQL looks as follows (brackets [ ] enclose optional parts): [] [declare ] begin [exception ] end; The block header speci? s whether the PL/SQL block is a procedure, a function, or a package. If no header is speci? ed, the block is said to be an anonymous PL/SQL block. Each PL/SQL block again builds a PL/SQL statement. Thus blocks can be nested like blocks in conventional programming languages. The scope of declared variables (i. e. , the part of the program in which one can refer to the variable) is analogous to the scope of variables in programming languages such as C or Pascal. 4. 1. 3 Declarations Constants, variables, cursors, and exceptions used in a PL/SQL block must be declared in the declare section of that block.Variables and constants can be declared as follows: [constant] [not null] [:= ]; Valid data types are SQL data types (see Section 1. 1) and the data type boolean. Boolean data may only be true, false, or null. The not null clause requires that the declared variable must always have a value di? erent from null. is used to initialize a variable. If no expression is speci? ed, the value null is assigned to the variable. The clause constant states that once a value has been assigned to the variable, the value cannot be changed (thus the variable becomes a constant). Example: declare hire date job title mp found salary i ncr †¦ begin . . . end; date; /* implicit initialization with null */ varchar2(80) := ’Salesman’; boolean; /* implicit initialization with null */ constant number(3,2) := 1. 5; /* constant */ 27 Instead of specifying a data type, one can also refer to the data type of a table column (so-called anchored declaration). For example, EMP. Empno%TYPE refers to the data type of the column Empno in the relation EMP. Instead of a single variable, a record can be declared that can store a complete tuple from a given table (or query result). For example, the data type DEPT%ROWTYPE speci? s a record suitable to store all attribute values of a complete row from the table DEPT. Such records are typically used in combination with a cursor. A ? eld in a record can be accessed using . , for example, DEPT. Deptno. A cursor declaration speci? es a set of tuples (as a query result) such that the tuples can be processed in a tuple-oriented way (i. e. , one tuple at a time) using the f etch statement. A cursor declaration has the form cursor [()] is ; The cursor name is an undeclared identi? er, not the name of any PL/SQL variable. A parameter has the form . Possible parameter types are char, archar2, number, date and boolean as well as corresponding subtypes such as integer. Parameters are used to assign values to the variables that are given in the select statement. Example: We want to retrieve the following attribute values from the table EMP in a tupleoriented way: the job title and name of those employees who have been hired after a given date, and who have a manager working in a given department. cursor employee cur (start date date, dno number) is select JOB, ENAME from EMP E where HIREDATE > start date and exists (select ? from EMP where E. MGR = EMPNO and DEPTNO = dno);If (some) tuples selected by the cursor will be modi? ed in the PL/SQL block, the clause for update[()] has to be added at the end of the cursor declaration. In this case selected tuples ar e locked and cannot be accessed by other users until a commit has been issued. Before a declared cursor can be used in PL/SQL statements, the cursor must be opened, and after processing the selected tuples the cursor must be closed. We discuss the usage of cursors in more detail below. Exceptions are used to process errors and warnings that occur during the execution of PL/SQL statements in a controlled manner.Some exceptions are internally de? ned, such as ZERO DIVIDE. Other exceptions can be speci? ed by the user at the end of a PL/SQL block. User de? ned exceptions need to be declared using exception. We will discuss exception handling in more detail in Section 4. 1. 5 4. 1. 4 Language Elements In addition to the declaration of variables, constants, and cursors, PL/SQL o? ers various language constructs such as variable assignments, control structures (loops, if-then-else), procedure and function calls, etc. However, PL/SQL does not allow commands of the SQL data de? nition langu age such as the create table statement.For this, PL/SQL provides special packages. 28 Furthermore, PL/SQL uses a modi? ed select statement that requires each selected tuple to be assigned to a record (or a list of variables). There are several alternatives in PL/SQL to a assign a value to a variable. The most simple way to assign a value to a variable is declare counter integer := 0; †¦ begin counter := counter + 1; Values to assign to a variable can also be retrieved from the database using a select statement select into from where ; It is important to ensure that the select statement retrieves at most one tuple !Otherwise it is not possible to assign the attribute values to the speci? ed list of variables and a runtime error occurs. If the select statement retrieves more than one tuple, a cursor must be used instead. Furthermore, the data types of the speci? ed variables must match those of the retrieved attribute values. For most data types, PL/SQL performs an automatic type conversion (e. g. , from integer to real). Instead of a list of single variables, a record can be given after the keyword into. Also in this case, the select statement must retrieve at most one tuple ! declare mployee rec EMP%ROWTYPE; max sal EMP. SAL%TYPE; begin select EMPNO, ENAME, JOB, MGR, SAL, COMM, HIREDATE, DEPTNO into employee rec from EMP where EMPNO = 5698; select max(SAL) into max sal from EMP; †¦ end; PL/SQL provides while-loops, two types of for-loops, and continuous loops. Latter ones are used in combination with cursors. All types of loops are used to execute a sequence of statements multiple times. The speci? cation of loops occurs in the same way as known from imperative programming languages such as C or Pascal. A while-loop has the pattern [>] while loop ; end loop [] ; 9 A loop can be named. Naming a loop is useful whenever loops are nested and inner loops are completed unconditionally using the exit ; statement. Whereas the number of iterations through a w hile loop is unknown until the loop completes, the number of iterations through the for loop can be speci? ed using two integers. [>] for in [reverse] .. loop end loop [] ; The loop counter is declared implicitly. The scope of the loop counter is only the for loop. It overrides the scope of any variable having the same name outside the loop. Inside the for loop, can be referenced like a constant. ay appear in expressions, but one cannot assign a value to . Using the keyword reverse causes the iteration to proceed downwards from the higher bound to the lower bound. Processing Cursors: Before a cursor can be used, it must be opened using the open statement open [()] ; The associated select statement then is processed and the cursor references the ? rst selected tuple. Selected tuples then can be processed one tuple at a time using the fetch command fetch into ; The fetch command assigns the selected attribute values of the current tuple to the list of variables.After the fetch command , the cursor advances to the next tuple in the result set. Note that the variables in the list must have the same data types as the selected values. After all tuples have been processed, the close command is used to disable the cursor. close ; The example below illustrates how a cursor is used together with a continuous loop: declare cursor emp cur is select ? from EMP; emp rec EMP%ROWTYPE; emp sal EMP. SAL%TYPE; begin open emp cur; loop fetch emp cur into emp rec; exit when emp cur%NOTFOUND; emp sal := emp rec. sal; end loop; close emp cur; †¦ end; 30Each loop can be completed unconditionally using the exit clause: exit [] [when ] Using exit without a block label causes the completion of the loop that contains the exit statement. A condition can be a simple comparison of values. In most cases, however, the condition refers to a cursor. In the example above, %NOTFOUND is a predicate that evaluates to false if the most recent fetch command has read a tuple. The value of %NOTFOUN D is null before the ? rst tuple is fetched. The predicate evaluates to true if the most recent fetch failed to return a tuple, and false otherwise. FOUND is the logical opposite of %NOTFOUND. Cursor for loops can be used to simplify the usage of a cursor: [>] for in [()] loop end loop []; A record suitable to store a tuple fetched by the cursor is implicitly declared. Furthermore, this loop implicitly performs a fetch at each iteration as well as an open before the loop is entered and a close after the loop is left. If at an iteration no tuple has been fetched, the loop is automatically terminated without an exit. It is even possible to specify a query instead of in a for loop: for in () loop end loop; That is, a cursor needs not be speci? d before the loop is entered, but is de? ned in the select statement. Example: for sal rec in (select SAL + COMM total from EMP) loop †¦ ; end loop; total is an alias for the expression computed in the select statement. Thus, at each iterati on only one tuple is fetched. The record sal rec, which is implicitly de? ned, then contains only one entry which can be accessed using sal rec. total. Aliases, of course, are not necessary if only attributes are selected, that is, if the select statement contains no arithmetic operators or aggregate functions. For conditional control, PL/SQL o? rs if-then-else

Monday, July 29, 2019

Company Analysis-Ethics and Social Responsibility(AMAZON) Essay

Company Analysis-Ethics and Social Responsibility(AMAZON) - Essay Example Amazon.com’s ethical standard which is encapsulated in their vision as a company meant doing their job right that in doing their job right, this would be their greatest contribution to the good of society as they lower their prices, expand selection and other initiatives in the future. They also give to the communities where their employees live and their donations are spread throughout nonprofit organization across the United States. They also engage in volunteer works and give grants to the writing community (Amazon b, 2013). This standard of Amazon’s ethical standard is practiced in a way that was elaborated further by its CEO stating that this approach of â€Å"offering customers the lowest prices on virtually any product they wanted and providing a quality customer experience† is the only strategy that will provide long term value for Amazon.com’s customers and shareholders (G.A., 1999) Amazon.com’s ethical standard to be a customer-centric company also extends to their environmental friendly operations. Most of their orders are shipped in â€Å"corrugated containers which on average contain 43% recovered fiber content. Once used, these containers are 100% recyclable for use in the manufacture of other paper products† (Amazon c, 2013).   Large products such as television sets, and other appliance and household items are shipped using paper as packing materials that are 100% recyclable whose content is already 50% recycled (Amazon c, 2013). One of the concrete examples of Amazon’s ethical standard being aligned with their business strategy as a company is best illustrated by its new product Kindle. In an interview with its CEO Jeff Bezo, he stressed that as a company, they do not want to make money out of their hardwares that would make their price prohibitive. This is also consistent with their ethical standard of offering the most cost effective service to their customer with an

Sunday, July 28, 2019

Maritime transportation Essay Example | Topics and Well Written Essays - 1500 words

Maritime transportation - Essay Example It was forecasted to rise between 6.5-7% per annum over the next ten years (MPA, 2012). The reason behind Singapore’s maritime industry’s vibrant success is its strategic location and constant competition evolved into a strategic center for maritime business. Situated in the center of a complex global web of trade routes and connected to over 600 ports in over 120 countries, Singapore is nothing less than a global hub. A ‘hub’ can be defined as a well-connected node in a network, and throughout history, successful hubs have been the ones that offer focal points of opportunities, growth and innovation. Singapore has been identified as not only one of the 40 mega regions, which signify large markets with significant economic potential, but it is also one of the world’s most important maritime countries as per the UN Conference on Trade and Development. Singapore, apart from being a premier global hub port, is also the busiest port in the world considering shipping tonnage alone, which amounts to more than 120,000 vessel calls annually. In 2004, only the total vessel arrivals at the port exceeded one billion gross tons for the first time in Singapore’s maritime history. Moreover Singapore offers around 20 million tons of bunkers supplied each year to ships globally. Additionally, Singapore offers reliable and efficient cargo handling, the Global Competitiveness Report 2006-7 ranks Singapore as having the best Quality for Port Infrastructure. Singapore holds 70% of the global jack-up rig-building market and more than 65% of the world’s floating production storage and offloading (FPSO) conversion market. Its technological adeptness is observable through the wide range of maritime services available, including pilot age, towage, fresh water supply, crew changes, ship supply and repair as well as expert building facilitie s (Tan, 2005). Singapore is also a fast developing Petrochemical

Saturday, July 27, 2019

Term paper Example | Topics and Well Written Essays - 2000 words - 3

Term Paper Example Unfortunately, the inevitability of the assignment and seriousness of my instructor compelled me to set aside some evenings to study your book. I never knew that it would have such a lasting impact in my life. A couple of pages down from the cover page were enough reason to capture my attention in totality. It was beyond my wild imagination that a deaf person like you could be superbly gifted to come up with such a piece. As demeaning as this previous statement may sound, I must say that I personally do not read much from it as you have taught me to appreciate your coined concept of â€Å"deafhood.† And since your book sought to convince radical sectors, I being included, that deaf communities are far from being objects of pity and benevolence, I choose to regard the deaf culture just as any culture as I even dig deeper into your book. As a child I have always tried to figure out what life as a Deaf person is all about. Walking down the streets you meet countless people with varied facial expression. Some of them have smiling faces; others frowned, while others show no emotion. Also, you encounter people with different disabilities such as blind, lame, among many others. However, there is this special group you may never know their disability not unless somebody whispers to your ears or you see them constantly making some â€Å"funny† gestures. I am talking about the deaf people. Indeed the plight of the deaf is unimaginable. It is hard for them to communicate with majority groups as the majority group does not understand their language and neither do they understand the language of the majority group. Noteworthy, though, the majority groups have the ability to understand the language of the deaf, but the dead do not have the ability to understand the language of the majority. It is at such instances that I always pause and ask myself why our policy makers have failed to recognize sign

Friday, July 26, 2019

English 3 literature Essay Example | Topics and Well Written Essays - 250 words

English 3 literature - Essay Example This proverb has a close resemblance to Franklin’s proverb; a penny saved is a penny earned. The proverb means that if persons refrain from spending the little things they have, their small savings may add up to big things in the future. The proverb is applicable in numerous business situations whereby it emphasizes on the need to save little proceeds to amass a massive capital. Both of these proverbs are emphasizing on the need to save. They discourage unplanned expenditure for little possessions that a person may have, placing in focus the future goals. Expenditure without savings can lead to bankruptcy and eventually poverty. Nevertheless, if a person denies himself or herself a chance to spend today on unnecessary things, he or she may have greater benefits in the future. The proverbs reinforce the understanding that an investment starts with saving. A wise entrepreneur saves the little he or she possesses until there is a substantial capital to start a big

Thursday, July 25, 2019

Is there a connection between mortality and religion Research Paper

Is there a connection between mortality and religion - Research Paper Example But does religiosity translate into biological mechanisms which affect the rates of survival?—this is the moot question that remains to be answered by the researchers. The popular belief is the healthy body goes with the healthy mind. Only a moral/religious/spiritual individual can have a healthy mind. Religious practices are meant to combat the negative thoughts. In spiritual texts of all religions, one comes across parables related to long-life and such people adopted healthy practices in their day to day living. Physical wellbeing and religious belief is like the scale of justice. Both arms of the scale are equally important to get at the equilibrium. In one’s life, they must run like a train that speeds on two parallel tracks. Ralph W. Hood, Jr., et.al (2009, p.181) writes, â€Å"Some impressive research has examined the relationship between mortality and religious involvement†¦..The results showed that frequent attendees lived longer than infrequent attendees. Apparently, the former were more likely to cease smoking, engage in exercise, remain married, and maintain their social connections.† To put it in the terms of a laym an, a well-disciplined individual will live longer than a man with negative tendencies and habits. Brian Thomas in article â€Å"New Study Makes Connection Between Religion and Lower Mortality,† concludes that women performing religious service with regularity lived 20 percent longer than those who did not, as per the recent study. Some of the specific revelations in support of connection between mortality and religion are: Exodus 20:12: â€Å"Honour thy father and thy mother: that thy days may be long upon the land which the LORD thy God giveth thee.† To explain this further, one who adheres to this commandment lives the disciplined life. Principle of God-fearing is a positive approach to life-situations and such positivity contributes to peace which is conducive to long span of life. Proverbs

Women Empowerment in Corporate America Research Paper - 1

Women Empowerment in Corporate America - Research Paper Example will analyze the reasons which have led to the empowerment of women in the corporate sector in the United States of America, effects of this empowerment of women in the corporate sector and finally the challenges that face women empowerment in the corporate sector in the United States of America. The fight for equal rights for women has greatly contributed to the empowerment of women in corporate America. Women groups have been pushing for women to b give same rights as men in job opportunities, education and in the political scene. The fight for these equal rights has resulted in many women undertaking education opportunities which equip them with the necessary skills required for them to join the corporate world. Another reason that has resulted in the empowerment of women in corporate America is the increasing number of women enrolling in universities to undertake professional programs. For example according to survey done in universities in the United States of America, the number of women who had enrolled to undertake various professional courses had increased significantly on the onset of the 21st century (Klein 96). This has resulted in the number of women in the corporate sector in the United States of America since this huge number of women in universities seeks job opportunities in the corporate sector after completion of their courses in their respective universities. The end of world war two greatly contributed to the empowerment of women in the corporate sector in the United States of America. During the war many American men had enlisted to be at the fore front in serving their country. This left a vacuum since there were no men to run businesses, farms and homes. Women had to take up the role of these men to ensure that life went on smoothly back at home. It created an effect in women since they realized that they could also do what men did instead of staying at home and taking care of their families. Women started looking for jobs in the

Wednesday, July 24, 2019

Analyzing Popular Culture Essay Example | Topics and Well Written Essays - 1000 words

Analyzing Popular Culture - Essay Example Although this trend was not suitable for occasions in the past, it has been taken up by stylish people and stars all over the world and has become trendy and â€Å"chic† in the year 2014 ("Farewell to Faux Fashion." 23). Unlike the thoughts of many, the thesis of this paper is that ripped jeans can look good in many different forms and different styles of dressing. The ripped jeans can be dressed up or down, in different styles as either short or long, or even oversize or skinny, but still maintain its goodness in the different styles. A great challenge comes in trying to maintain the comfort while at the same time aiming at portraying an effortlessly pulled together distressed jeans ("Fashion Trends; Ripped Jeans." n.d.). Ripped jeans are a style of denim jeans that features tears and ripped parts which may include the knees, thigh, elbow and many others. Some think of ripped jeans as a sign of overuse. Back in the 1970s and 1980s, glam metal artists and rock and roll punk artists had begun to appear on stage wearing ripped jeans, in an attempt to create a casual punk statement. A good example is the American Poison band for glam metal music back in the 1980s were known for their ripped jeans fashion. After that, the popularity of the ripped jeans began to increase until it attracted designers and teenage fans. In the past couple of years, we began to find ripped jeans in almost all the designer brands and stores. Those who wear ripped jeans were no longer considered shabby. They are instead considered chic and stylish. Even celebrities such as, Kim Kardashian, Rihanna, and Kendall Jenner who are popular musicians seem to love them, and wear them on a regular basis especially during stage performance s. Various controversies have existed about this kind of fashion. Some people have usually had a thought that ripped jeans has no place in the fashion. The

Tuesday, July 23, 2019

Independent project Literature review Example | Topics and Well Written Essays - 1250 words

Independent project - Literature review Example Epistemology seeks out sources of knowledge that has logical application to the cognitive level of every researcher. Those who conduct an inquiry must endeavor to utilize processes as tools for investigation to clarify, justify, and rationalize a phenomenon (Goldman, 1986). Epistemologists usually adapt a normative action to socially theorize an event on its moral basis: is this objective or subjective? Is this deontological or consequentialist? Or, is this absolutist or pluralist? (Goldman, 1986 p.3) Researcher evaluates ideas and arguments, propositions and sentences in deductive or inductive logical processes. Hence, the epistemic component of the study relates to the inferences in the formation of belief or rational conclusions (Goldman, 1986). As such, social epistemology looks into the impact of different patterns in social interaction—its forms, styles, arguments, and the critical interfacing of facts, controversies, assumptions, and theoretical frameworks arising from a phenomenon under study. Heidegger explained that ontology is the doctrine of being and such has interrelation with phenomenology. Ontology explicates the nature of social reality, (Dreyfus & Wrathall, 2005) explores more assumptions, and the categorical character of the subject of research. The ontological side of the study focused on facticity. Researcher would therefore take into the process of engaging, approaching, explaining, questioning and accessing information to determine the subject’s facticity (Dreyfus, et. al., 2005). The epistemic and ontological component of research is often elaborated in related literatures and in the analysis. Methodology refers to systemic procedures on how a research should be undertaken and about how subject of the study is procedurally explicated-- whether it’s qualitative, quantitative and mixed. Methodology also explains the kind of research instruments which will be utilized in generating and consolidating data or evidences.

Monday, July 22, 2019

Mla Template for Dummies Essay Example for Free

Mla Template for Dummies Essay Got a paper to write? Here’s a tip: don’t worry about the formatting, just write. Besides, this MLA template for Word has the formatting down for you. Just replace everything in brackets with your information (remember the heading!) and you’re good to go. And, of course, replace this stuff with your content. But read this first! There’s some really important info here. Do yourself a favor and save this template to your computer in a place where you’ll remember it. There are bunch of little nuances in MLA that are really easy to miss – the heading, the spacing, the date format, and those random rules that seem to exist only to annoy you†¦ stop re-writing it each time you go to write a paper, and just whip out this handy template! Wasn’t that easy? By the way, here’s a look at some of the stuff people get wrong a lot. First, the heading at the top right corner of each page. Remove the entire thing if your paper is just one page long; some teachers, though, tell you to just remove the page number. Next come inline citations. You want to â€Å"write them in this format, with the period way at the end, assuming you got this from the 5th page of someone’s essay† (Someone 5). Also, if someone includes some random tangent in their quote, you can cut out the junk using ellipses. â€Å"I’ve got logorrhea, meaning I tend to ramble on incoherently a lot . . . Now back to the main topic.† Notice that there are spaces in between each ellipsis (yes, that’s the singular form), before the ellipses, and after them. Strange, I know. But it gets weirder. What if you want to cite a really long bit of text (4 lines or more)? Take a look. Welcome to long-quote land! Notice that the formatting here is the same as it is everywhere else – except every paragraph is indented twice as much (one inch) as usual paragraphs. What I’d recommend you do is type your long quote normally (like a normal paragraph), then highlight the whole thing and hit â€Å"tab† to indent it all properly. Also, remember that there are no quotation marks surrounding this block of text! None! Nada! Zilch! And as if there weren’t enough twists already, citing a long quote is different than citing a normal quote: the citation goes in parentheses after the final punctuation, like this. (Someone 5) Also, make sure you include a Works Cited page below this page (I’ve even included the page break!) I’d highly recommend using a web service such as easybib.com, which does all your formatting for you – just input the information you know. What’s more, you can export it to a Word document, complete with all the formatting! You can copy the contents of the exported document, insert a page break (Insert → Page Break; fancy that) after your body, then paste the contents in. Feel free to share this template with your friends at is.gd/mlatemplate (or, if for some reason that doesn’t work, is.gd/MLAtemplate), but remember that this template is copyrighted, meaning you can’t claim it as your own. Enjoy and good luck! –Neel

Sunday, July 21, 2019

Modern Sedentary Lifestyle On Overweight And Obesity Physical Education Essay

Modern Sedentary Lifestyle On Overweight And Obesity Physical Education Essay Currently, obesity and overweight is a main global health problem plaguing almost the whole planet. Studies show that in 2005 1.6 billion adults were overweight and 400 million adults were obese. As it is portrayed, obesity and overweight is a problem of the contemporary societies that cannot be confronted. According to a recent study of the World Health Organisation, it is predicted that there will be 2.3 billion overweight adults by 2015 in the world and more than 700 million of them will be obese. Also it is important to realise that obesity and overweigh are modern problems of the societies since statistics referring to these problems did not exist 60 years ago. Therefore, it is clear that obesity and overweight apart from genetic predisposition and psychological disorders might derive as well from the modern sedentary lifestyle that is highly affected by the recent technological development and from poor nutrition as there is an increase in convenience food. However in order to understand the extent and significance of the problem it is important to define and analyse overweight and obesity. Obesity can be defined as a medical condition in which body fat has accumulated to the extent that it has a negative effect on health. A healthy body requires a minimum amount of  fat  for the proper functioning of the  hormonal,  reproductive, and  immune  systems, as  thermal insulation, as  shock absorption  for sensitive areas, and as  energy  for future use. But the accumulation of too much storage fat can impair movement and flexibility, can alter the  appearance of the body and cause health problems. Obesity increases the likelihood of  various diseases like heart disease,  type 2 diabetes,  breathing difficulties during sleep (pulmonary diseases), hypertension, certain types of  cancer, and  osteoarthritis. In particular, cancer of the colon as well as prostate in men and cancer in breasts, ovaries and cervix in women have been found to be related to obesity. Furthermore, hypertension has been found to be related CHD and strokes. As a result, obesity has been found to reduce  life expectancy and be one of the leading  preventable causes of death  worldwide. Investigators have estimated that if everybody had the optimal body mass there would be 3 years added to life expectancy, 25 percent less coronary heart disease and 35 percent less congestive heart failure and brain infection. Overweight is generally defined as having more  body fat  than is optimally  healthy, without reaching the body fat value for obesity. The generally accepted view is that being overweight causes similar health problems to obesity, but to a minor degree. It is estimated that the risk of death increases by 20 to 40 percent among overweight people and that being overweight at age 40 reduces life expectancy by three years. Being overweight or obese has been identified also as a cause of  cancer. Psychological well-being is also at risk in the overweight individual due to social  discrimination. However, children under the age of eight are normally not affected. The prevalence of obesity and overweight is strongly related to age. The 16 to 24 years age group (for both men and women) is substantially less at risk of  becoming obese than older age groups. Those aged between 25 and 34 have the second lowest rates of obesity and overweight. Middle aged people are those who are in the most risky position of becoming obese or overweight. In order to further understand obesity and overweight it is important to analyse the methods used in order to classify and tell the degree to which a person is overweight or obese. The most popular method used is that of  the Body Mass index  (BMI), or  Quetelet index. The Body Mass index is a statistical measure of body weight based on a persons weight and height. Though it does not actually measure the  percentage of body fat, it is used to estimate a healthy  body weight  based on a persons height. Due to its ease of measurement and calculation, it is the most popular diagnostic tool to identify weight problems within a population, usually to classify adult underweight, overweight and obesity. Body Mass Index is found by dividing the body mass in kilograms by the square of height in meters. This technique can also act as a health since it appears to provide relative results concerning the degree of risk associated with overweight or obesity. Mortality and morbidity start increase at high rates at a BMI of more than 25. Therefore the desired levels of BMI are those below 25. Below there is a table of the BMI classification according to the World Health Organisation confirming what was previously stated. Classification BMI(kg/m2) Underweight