Archive for February, 2010

How to write an SQL statement about the age of someone?

February 27, 2010 - 7:36 am 5 Comments

i need to write a statement about all those who are over the age of 70 and under the age of 25 where the "age" is in the customers table. Would it be something like:

SELECT Age
FROM Customers
WHERE people = >70yrs old OR = <25 yrs old

Thanks
Yes..sorry i was meant to say "find those who are over the age of 70..and those who are below the age of 25"…thanks for correcting me

you shouldn’t use spaces between >= or <=. I think there may be english equivalents though (GE and LE?). these are greater than or equal, and less than or equal.

over means > 70
under means < 25

you are close.

SELECT people
FROM Customers
WHERE age > 70 AND age < 25

it is AND instead of OR. read your own description for hints. you used the word yourself. however, if you really think about it, it cannot be logically true, your description is logically faulty. re-read your problem. it probably is OR. think about it. a single person cannot be possibly be under 25 and over 70 at the same time, so it can’t be AND.

Is a statement credit for a credit card only applied to a balance?

February 27, 2010 - 7:36 am 1 Comment

When a company offers a statement credit, does that amount appear on your card free for you to spend or is it only applied to an existing balance on the card?

In other words, do you get anything if you have no balance?

A credit would be applied to the balance. If your balance was 0, the credit would give you a negative balance. You can make charges and use up the credit balance.

How would you make an SQL statement about the date?

February 25, 2010 - 8:26 am 2 Comments

it wants me to sort by itinerary date and the actual "date" is from the itinerary table. Would it be something like

SELECT Date
FROM Itinerary
ORDER BY Itinerary date

Thanks

It would be like:

SELECT *
FROM Itinerary
ORDER BY Itinerary_date (Field/Column name containing date) asc/desc (optional)
Date cannot be a field name as it is a Keyword.

What is considered improper argument in an opening statement in a trial?

February 25, 2010 - 8:25 am 1 Comment

I am doing an opening statement for my mock trial and I do not want to draw an objection. I was wondering if someone could give me an example of what is and what is not improper argument.

Opening and closing statements are basically where the attorney can blow smoke and talk much more openly to the jury than in any other portion of the trial. The big thing to avoid in an opening statement is attacking any specific witness or piece of evidence, especially since nothing has been presented yet. It is perfectly fine to make general statements, such as "The defense is going to tell you that this was an accident, but we will prove otherwise". However, it is not acceptable to say "Joe Smith is a liar and will tell you this is an accident" or "The defense is going to present a store receipt as Joe Smith’s that we think is not his receipt", as the other side has not immediate recourse to refute those assertions, other than an objection. Keep it general while addressing what you intend to prove and how you believe the other party is in the wrong, and talk with certainty that your version of events is correct. Talk about how great your client is as a person/father/mother/etc.if you are the defense, or how you will show that the defendant was conclusively responsible for this awful crime if you are the prosecution (again without citing specific as to how that will be proven). Many judges will advise the attorneys of a set time limit for opening statements before the trial begins, otherwise the attorney will simply talk in circles in an attempt to sway the jury before any evidence is even presented. Many close cases have been decided by the attorney’s ability to come across as the more believable person in opening and closing statements.

How would you construct an SQL statement for all those who have the surname "Brown" and have booked cars?

February 23, 2010 - 5:08 am 4 Comments

Basically, i am wanting to construct an SQL statement where i want to find those who have the surname "brown" and have booked cars where the surname is its own column in the "customers table"

Would it be something like:

SELECT Surname
FROM Customers
WHERE Surname = Brown AND have booked cars

Thanks

It entirely depends on your table structure.

All SQL select statements are made up of 3 basic parts.

The "select" is the part that you would declare what columns you wish to view (* Means all columns)

The "From" declares what table/s you want to get the data from

The Clauses "Where, And, Having" is where you define your criteria.

If you have all your data in one table you would use something like below. (Assuming booking is a Yes or No)

Select *
from customers
where upper(surname) = ‘BROWN’
and booking = ‘Yes’

I made the surname convert to upper as you may have BROWN, Brown, brown, bRoWn in your database so this matches the string not the casing

If you have a separate customers and bookings table it would look something like below. Assuming both tables have some commonality (I am assuming both have customerid)

Select *
from customers, bookings
where customers.customerid = bookings.customerid
and upper(customers.surname) = ‘BROWN’
and bookings.booking = ‘Yes’

Or

Select *
from customers
where upper(surname) = ‘BROWN’
and customerid in (select customerid from bookings)

I gave 2 ways to do the statement if there are multiple tables and both would return all the customer data if there is a booking. HOWEVER if you want to see some data from the bookings table you would use the first as you can define columns e.g. Customers.*, Bookings.Booking date

If you want more information in the form of a tutorial please see. http://www.mikespraggett.co.uk/Pages/HowTo/HowToViewer.aspx?Article=7&Title=Selecting%20Data

if else statement java program?

February 23, 2010 - 5:08 am 1 Comment

Hi I am just trying to figure the if-else statements and I was just wondering why on the lines with

if (Grade == "A" || Grade== "B" || Grade=="C" || Grade== "D" || Grade=="F")
{
System.out.println ("Enter Percentage Weights: ");
}
else
{ System.exit(0);

}

System.out.println ("Exam 1: ");,

that even if I put A it just exits and also on the lines
EX1Score = keyboard.next();

if (EX1Score == "y" || EX1Score == "yes" || EX1Score == "Y" || EX1Score == "YES")
{
System.out.println("Marks scored in Exam 1:");

int Exam1Score = keyboard.nextInt();//The numerical value of the user’s score on exam one

}
else
{
System.out.println("Do you know your lab score");

why even if I put y or the others it skips to the lab question anyway

import java.util.Scanner;
public class GradeCalculation {

/*
* GradeCalculation.java
* Author: Nawasca Baity
* Last edited: 02/15/2010
*
* Purpose: A brief one or two paragraph description of the
* program. What does it do? How does it do it?)
*
* Statement of Academic Honesty:
*
* The following code represents my own work. I have neither
* received nor given inappropriate assistance. I have not copied
* or modified code from any source other than the course webpage
* or the course textbook. I recognize that any unauthorized
* assistance or plagiarism will be handled in accordance with
* the University of Georgia’s Academic Honesty Policy and the
* policies of this course.
*
*/
public static void main(String[] args) {

String Grade;// This will be the overall grade the user hopes to make in the class

String EX1Score;//Yes or No if they know the numerical grade of exam one

String EX2Score;//Yes or No if they know the numerical grade of exam two

String FinalExamScore;//Yes or No if they know the numerical grade of final exam

String LabGrade; //Yes or No if they know the numerical grade of Labs

String ProjectGrade; //Yes or No if they know the numerical grade of projects

System.out.println ("Grading Scale");

System.out.println ("A 90 - 100");

System.out.println ("B 80 - 89");

System.out.println ("C 70 - 79");

System.out.println ("D 50 - 69");

System.out.println ("F Below" );

Scanner keyboard= new Scanner (System.in);

System.out.println ("What letter grade do you want to achieve for the course?: ");

Grade = keyboard.next();

if (Grade == "A" || Grade== "B" || Grade=="C" || Grade== "D" || Grade=="F")
{
System.out.println ("Enter Percentage Weights: ");
}
else
{ System.exit(0);

}

System.out.println ("Exam 1: ");

int Exam1 = keyboard.nextInt();//The weight of exam one

System.out.println ("Exam 2: ");

int Exam2 = keyboard.nextInt();//The weight of exam two

System.out.println ("Final Exam: ");

int FinalExam = keyboard.nextInt();//The weight of the final exam

System.out.println ("Labs: ");

int Labs = keyboard.nextInt();//The weight of the labs

System.out.println ("Projects: ");

int Projects = keyboard.nextInt();//The weight of the projects

if (Exam1 + Exam2 + FinalExam + Labs + Projects <100)

{System.out.println("Weights don’t add up to 100, program exiting… ");

System.exit(0);//System exits if the values of the weight do not add up to 100
}

else
{ System.exit(0);

}

System.out.println ("Enter your scores out of a 100: ");

System.out.println ("Do you know your Exam 1 score?");

EX1Score = keyboard.next();

if (EX1Score == "y" || EX1Score == "yes" || EX1Score == "Y" || EX1Score == "YES")
{
System.out.println("Marks scored in Exam 1:");

int Exam1Score = keyboard.nextInt();//The numerical value of the user’s score on exam one

}
else
{
System.out.println("Do you know your lab score");

LabGrade = keyboard.next();

System.out.println("Do you know your project score");

ProjectGrade = keyboard.next();
}

}
}

Thank You, I just can’t seem to figure it out

If you use the == operator with strings, it only returns true if they’re the EXACT SAME object. Example:
String x="A";
String y="A";
x==x; //true
x==y;//false
x=="A";//false

What you want is if the string contents are the same. Use the String.equals(String) method instead.
x.equals(y);//true

What is the Wall Street Journal Company Mission Statement?

February 23, 2010 - 5:08 am 1 Comment

I cant find the mission statement anywhere. Anyone know a link where i can find it?

i cant find that either rob! dam business forum! lol

nvm

WSJ. is the only global magazine targeting a dual readership that focuses exclusively on influence and affluence in today’s ever-changing world. With stunning visuals and the same reporting standards as The Wall Street Journal, WSJ. magazine celebrates the lifestyle and interests of the Wall Street Journal reader, from finance to fashion to art, travel and philanthropy. With a large-scale format and an inventive, intelligent, irreverent take on life, WSJ. speaks directly to the world’s most discerning consumers about the subjects, people and products that matter most to them.

Do you think that the question delete system can be used as a form of bullying?

February 21, 2010 - 5:14 am 12 Comments

I have noticed that questions are deleted in this section that are perfectly acceptable but take a definitive stance on religion.

Atheist questions are deleted by christians who just don’t agree with the question and statements inside and visa versa.

As deletion is automated do you think that there will ever be a way around this bullying.

i had two questions and three answers deleted yesterday that were all appropriate but took the atheists side in the debate.

I’ve noticed it from both sides. Sometimes, someone will ask an insulting question of the atheists and I’ll type like 10 lines of smack down (or at least I think so) and I hit submit and…question has been deleted. Generally, I’d say that atheists have the thicker skin around here, with Christians pulling up 2nd and Muslims a distant 3rd but ‘my people’ (atheists) are still guilty of reporting from time to time. Is it bullying ? No, more like a fair fight. Stupid to report at all but totally fair.

How often am I supposed to receive a bank statement?

February 21, 2010 - 5:13 am 7 Comments

I think it’s a bank statement anyway - a piece of paper containing details of what has gone in and out of your account that month?

I’ve had my account for 4 months now, and I have only ever had one bank statement, I was just wondering if this was normal because I thought it was a monthly thing. I’m with HSBC if it helps.

You have the option of quarterly or monthly.

It sounds like you have the former set up. If you have online banking there should be an option to change it somewhere. Otherwise phone them and ask them to move it to monthly.

mysql update from a text file?

February 19, 2010 - 7:19 am 1 Comment

I am trying to update a field in mysql database. The update statement is long and DOS Command always truncates the last portion. If I paste the statement in a text file, how to execute the file. My mySql is 3.x version. Thanks

IF I understand correctly, just create the update in a plain text file save it with name update.sql (as an example..). Then from the DOS window, or any shell do:

mysql -u user -p databasename < update.sql

It will prompt you for your password.

And that’s it. Be sure to take some time to browsw through mysql docs, also if posible update to a newer version, you are missing a whole lot of stuff with 3.x

Alex