Sample Sql Essay

400 words - 2 pages

1. Show the last name, first name, and the credit_limit for all customers who reside in the city of Grant and have a credit_limit greater than $1,200.

select last, first, credit_limit
from customer
where city ='Grant'
and credit_limit > 1200;

LAST FIRST CREDIT_LIMIT
-------- ------- ------------
Samuels Ann 1500
Williams Al 1500

2. Show the names of all the employees who have the character string “er” as part of their job title.

select ename
from emp
where job like '%er%';

ENAME
------------
Smith
Jones
Blake
Walker
Clark
Adams
James
Miller

3. For every sales rep who has customers, show the sales rep number and the largest available credit (with the column heading MAX_AVAIL_CREDIT) among his/her customers. Exclude any customer who ...view middle of the document...

25

4. Count the number of orders that have a total order value of more than $500.

select count(sum(number_ordered*quoted_price))
from order_line
group by order_number
having sum(number_ordered*quoted_price)>500;

COUNT(SUM(NUMBER_ORDERED*QUOTED_PRICE))
---------------------------------------
3
5. List the number and name of every department that has no employees currently. (Exclude any employee whose department is not specified.)

select deptno, dname
from dept
where deptno not in (select deptno from emp where deptno is not null);

DEPTNO DNAME
---------- ---------------
40 Operations


6. Use a join operation (i.e., do not use a subquery) to find the customer number, last name, and first name for every customer who placed an order on August 5, 2014. Do not list the same customer more than once. (You may use the above date in any format, including the default DATE format.)

select distinct customer.c_number, last, first
from customer, orders
where orders.c_number=customer.c_number
and order_date='05-AUG-14';

C_NUMBER LAST FIRST
---------- -------- -------
124 Adams Sally
522 Nelson Mary

7. List the part number, part description, unit price, and item class for every part for which the unit price is higher than the unit prices of all parts in item class HW or SG.

select part_number, part_description, unit_price, item_class
from part
where unit_price> all
(select unit_price
from part
where item_class = 'HW' or item_class = 'SG');

PART_NUMBER PART_DESCRIPTION UNIT_PRICE ITEM_CLASS
----------- ---------------- ---------- ----------
BZ66 Washer 399.99 AP

Other assignments on Sample Sql

Mgt216 Essay

714 words - 3 pages released their product on the market. After G-BioSport ran test, it was determined that there were traces of a contaminant in the sample received. The quality control manager must identify a developmental solution to maintain the company’s reputation and identify the problem. G-BioSport had stumble upon a serious problem that required immediate attention. They had just discovered that there were traces of a contaminant in the sample they received

Economy Effect Of Marijuana Essay

277 words - 2 pages Modern American History by Alan Renga 2nd Mid Term! You will be given 3 Short Essay questions and 20 Multiple Choice questions deriving from this list! 80 points total! The 1920s Warren Harding then Calvin Coolidge Tea Pot Dome 1st Red Scare Immigration Restriction, Sacco and Vanzetti Langston Hughes, Marcus Garvey, KKK Prosperity, advertising Prohibition, Al Capone Flappers, Clara Bow, Rudolph Valentino Babe Ruth, Jack Dempsey

The Vc Shakeout

2033 words - 9 pages ECONOMY 26 Luring a big firm to town is not the secret to job growth DEFEND YOUR RESEARCH 30 Are morning people wired for success? VISION STATEMENT 32 The social web’s east-west divide COLUMN 38 Warren Bennis looks back on his surprising path to fame New Thinking, Research in Progress hbr.org New Thinking, Research in Progress hbr.org FIRST The VC Shakeout Venture capital hasn’t worked for a decade and must be radically

Hospitals Paper

6014 words - 25 pages . Not only do they have cost based reimbursement but they also receive a 1-2% profit so that they can be sure to stay afloat. Over the years, hospitals have spread to reach many new areas of this country. The AHA conducts an annual survey to show how many hospitals there are and how many there are in each category of hospital. Below is a sample of this report from 2009. Total number of registered U.S. hospitals | 5,795 | Number of U.S

Course Syllabus

2610 words - 11 pages [pic] COURSE SYLLABUS Semester: Fall, Year: 2012  College Mission Statement Richard J. Daley College provides high-quality education which leads to academic success, career development, and personal enrichment that fulfill diverse community needs. Mathematics Department Mission Statement Our mission is to deliver excellent service and to provide learning opportunities by offering a wide range of mathematics courses, which will help our

Management

1477 words - 6 pages Boeing Management Planning Heather Oetzel MGT 330 October 22, 2012 Joe Cheng Abstract Boeing is known as “the world’s leading aerospace company and the largest manufacturer of commercial jetliner and military aircraft combined ("The Boeing Company: About Us", 2012). Every company uses different types of management techniques including how the planning function of management is used. Planning allows organizations to develop how the

Assisted Suicide

1015 words - 5 pages Should physician-assisted suicide be legal? While I believe if one chooses to end his or own life through physician assistance for reasons that they chose, the choice should be up to the individual. Physician-assisted suicide should be at one's discretion. “Assisted Suicide, also called Voluntary Euthanasia, is currently a contentious issue in many countries. Because Euthanasia is legal in a few modern democracies: the Netherlands, Belgium

Tanglewood Case 1

797 words - 4 pages Tanglewood’s staffing strategy requires the organization to make key decisions about the acquisition, deployment, and retention of the organization’s workforce. In order to accomplish this, Tanglewood’s must make thirteen decisions regarding its staffing levels and its staffing quality. One of the first decisions that Tanglewood needs to choose is to acquire or develop talent. Tanglewood should try to develop their current talent because one

Nnnnn

1391 words - 6 pages Есе по въпроса: Кои от всички „действащи” лица могат да се разглеждат като морално отговорни и в какво именно? по казуса Форд „Пинто” Корпоративните злодеяния са нанесли повече вреди на обществото от всички улични престъпления взети заедно. Според данни на ФБР сумата от уличните престъпления възлиза на $3.8 млрд. годишно, а загубите от корпоративните измами между $100 млрд. и $400 млрд. годишно

The Penis

1052 words - 5 pages The short story ”The Penis” is written by Hanif Kureishi. The short story is about a penis, which has been separated from its owner Doug, who we hear from later on. At first though we hear about a guy called Alfie who was “a cutter – a hairdresser – and had to get to work”. He is having breakfast with his wife, when she asks him what he did last night, and if he had a good time last night? Alfie can not remember what he did last night, he then

Managed Care Paper

543 words - 3 pages Managed Care and Case Management Care Marvin Lloyd BSHS/402-Case Management 27 August 2012 Virgil Miller Managed Care are techniques employed to help reduce the cost for providing health benefits and a system for improving organizations quality of care

Similar Documents

Business Intelligence Essay

870 words - 4 pages installing SQL Server, you will be prompted to select these optional features. [pic] (We don’t strictly need Integration Services for the course, but I will be mentioning how it fits in with the other packages.) You must install the sample databases AdventureWorks and AdventureWorks DW. If you have already installed SQL Server 2005, but you did not install the sample databases, etc., you can use Add/Remove Programs to install them separately. See the following screenshots. [pic] [pic]

Unit 5 Essay

325 words - 2 pages string. FALSE 12.) You should not allow nulls in columns that are critical to your business rules. TRUE 13.) Tables can only be created by SQL statements in SQL Server. FALSE 14.) Referential integrity exists when every foreign key relates to a primary key. TRUE 15.) When referential integrity is in effect, you cannot delete a record in the primary key table until you have first deleted all the related records in the foreign key

Accounting System Essay

4830 words - 20 pages the schema tables. Specify the primary key(s), foreign key(s), and other data for each table. Test your model by entering sample data in each table. Table Name | Primary Key | Foreign Keys | Other Attributes | Inventory | Item Number | | Cost (standard or list) Description Quantity on Hand Price (standard or list) | Sales

Farmingville Case Study

2880 words - 12 pages ideology is that if you are different you are automatically heretical, ergo deviant. 3. Let’s suppose you wanted to survey the attitudes of the U.S. population towards migrant day laborers. Following the study procedures outlined in the text, explain how you would go about doing this research. Since it would be impossible to study all U.S. residents directly, how large would your sample have to before you could generalize your research