• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

SQL Question (1 Viewer)

*~Dazed~*

fuck a duck
Joined
Jun 27, 2003
Messages
1,177
Gender
Female
HSC
2003
Originally posted by Huy
Selecting first, last and (home) phone number will let the query "look up" ONLY those 3 fields, and therefore your query and criteria can only manipulate with those 3 fields, NOT the State.
no because you are not selecting those fields so as to FIND the state ones... you are selecting those fields after it is determined which ones have state=nsw.....
 

Huy

Active Member
Joined
Dec 20, 2002
Messages
5,240
Gender
Undisclosed
HSC
N/A
Originally posted by holl
I said decending too. do u think u'd loose marks for not writing select etc in capitals and just writing big little letters if u no what i mean? It was only worth 3 marks, they can't be too picky.
If it were 2 marks, that would be applicable.

For 3 or 4 (this was out of 3), I would disagree with you when you say "they can't be too picky".
Originally posted by *~Dazed~*
no because you are not selecting those fields so as to FIND the state ones... you are selecting those fields after it is determined which ones have state=nsw.....
Oh alright, thanks - I never really bothered with SQL all that much and the logical operators :)
 

juber

jhv,m
Joined
Jun 20, 2003
Messages
86
Location
jh
Gender
Undisclosed
HSC
N/A
how much do you think they will care about syntax?

Like i used semicolons to separate the WHERE, FROM etc and I also used ASC for ascending..

Like are they just wanting to see that we could use the correct terms appropriately or are they gonna be really stingy? I was surprised that they asked that straight out cos like normally they leavce it to a multiple choice or something
 

Jeo

........
Joined
Apr 4, 2003
Messages
1,054
Depends... accessing mysql through php, well its case insensitive. Im not sure about access. The last time I opened access was probably when I didn't know what mysql was.
 

Huy

Active Member
Joined
Dec 20, 2002
Messages
5,240
Gender
Undisclosed
HSC
N/A
For IPT: I don't think they will care TOO MUCH if everything else is correct, but you have included colons.

As for "ASCENDING" or "Ascending" - I think it matters...

As I've said in this (or another) thread, I've lost track... if it were a 2 marker, they would let these things slip/slide. (Digression: who remembers the Slip and slide!!! :D)

But since it is a 3 marker, they would be a little stingy I think, in my opinion :)
 

tonberry_kun

O RLY?
Joined
Jun 21, 2003
Messages
818
Gender
Undisclosed
HSC
2003
its automatically ascending... so unless it asks u to put by descending (in which case u put desc), i dont think u need to add the ASC at the end

well that's how it works in practise :p
 

Jeo

........
Joined
Apr 4, 2003
Messages
1,054
yeah, I put just ORDER BY field which alphabetically orders it anyway.... soo yeah
 

Huy

Active Member
Joined
Dec 20, 2002
Messages
5,240
Gender
Undisclosed
HSC
N/A
Originally posted by Jeo
yeah, I put just ORDER BY field which alphabetically orders it anyway.... soo yeah
If you're required to list an SQL result (display), in alphabetical order, am I incorrect (or correct) in saying that:
all the way through to the 'top of the list' at the top? A.

Descending: From A to Z
Ascending: From Z to A, starting at the 'bottom' (end of the list)

I think it would be:

Ascending: A to Z
Descending: Z to A.

I don't know... they're not numbers! LOL :p
 

Huy

Active Member
Joined
Dec 20, 2002
Messages
5,240
Gender
Undisclosed
HSC
N/A
Ascending: A to Z
Descending: Z to A.
Thanks! :)

Or rather, no thanks!
I wrote "DESC" in my SQL answer.

Here's to 2/3, but if they're thinking along the same line of thought as I was during the exam, they'll slip a 3/3 just because I wrote a nice paragraph at the end to state my reasons for selection and SQL wording/programming

LOL ;)
 

Huy

Active Member
Joined
Dec 20, 2002
Messages
5,240
Gender
Undisclosed
HSC
N/A
Originally posted by gmraso
thats wrong ascending Z-A(just 10-1) and decending is (A-z)(1-10)
Hmmm... then I *could* be correct! I wrote DESC.

I was just thinking about it this afternoon and during the exam itself.

A = 1
Z = 26

Alphabetical order = A to Z

If A is 1, and Z is 26, then it would be ASCENDING (from 1 to 26, lowest to highest).

:confused:

I'm pretty sure I'm wrong here, as they're asking for an alphabetical (A-Z) listing, going from "1" to "26" (ascending order)

:)
 

honky tonk

in Miracle World
Joined
Dec 26, 2002
Messages
1,032
Location
Newcastle
Gender
Male
HSC
2003
This might answer your question:

Example 1: Sort in an Ascending order

MEANING: to sort the rows alphabetical order or numbers in numerical order from lowest to highest.

Note: the ascending clause is the default clause in the order statement. So if you do not specify ASC or DESC the results will automatically be sorted in ascending order.

EXAMPLE:

SELECT FirstName, Job, Age
FROM person
ORDER BY Age
 

Huy

Active Member
Joined
Dec 20, 2002
Messages
5,240
Gender
Undisclosed
HSC
N/A
honky tonk, I don't think that (adequately) answers gmraso's question.

It's sort of like saying:

Sorting in alphabetical order = listing it in alphabetical order, according to the alphabet, alphabetising the list.

(I know that's not what you said, but it's "sort of" like saying that :)).

But yes,
Ascending = lowest to highest
Descending = highest to lowest.

The question is, is "Z" low, or high ;)

Low if you list it like:

A
B
C
D
...
Z

But "high" when you list it as:

A, B, C, D, E, F... Z
1, 2, 3, 4, 5, 6... 26
lowest ------------> highest

;)
 

honky tonk

in Miracle World
Joined
Dec 26, 2002
Messages
1,032
Location
Newcastle
Gender
Male
HSC
2003
to sort the rows alphabetical order or numbers in numerical order from lowest to highest.
I guess that could be saying that alphabetical order and numerical order (say, 1 to 20) are the same thing.. and considering this was under an 'Ascending' subheading, you could see that as saying that low refers to 'A' and high refers to 'Z'.

You know, that sentence made sense before I typed it... :apig:
 

tonberry_kun

O RLY?
Joined
Jun 21, 2003
Messages
818
Gender
Undisclosed
HSC
2003
Quote from Heinmann Glossary:
Ascending order: data arranged from smallest to largest (0 to 9) or from first to last (A to Z)
 
Last edited:

Huy

Active Member
Joined
Dec 20, 2002
Messages
5,240
Gender
Undisclosed
HSC
N/A
Originally posted by gmraso
Frankly i don't give a shit anymore cause i fkd this question anyway.(3 marks down the toilet along with the gant charts 3 marks and the 2 multies i didn't know)
:)

It's over, so let's leave it there. It's not as though we'll be all stressing out over IPT before Dec 18th, awaiting our HSC marks. (I know I won't be stressing, a little anxious perhaps).

gmraso, that still leaves 92% - have a positive mindset :)
Originally posted by honky tonk
I guess that could be saying that alphabetical order and numerical order (say, 1 to 20) are the same thing.. and considering this was under an 'Ascending' subheading, you could see that as saying that low refers to 'A' and high refers to 'Z'.

You know, that sentence made sense before I typed it... :apig:
Makes sense to me :)
 

Huy

Active Member
Joined
Dec 20, 2002
Messages
5,240
Gender
Undisclosed
HSC
N/A
Originally posted by gmraso
What about the fact that i had the last 20 minutes to do the whole multimedia option? and less than four minutes to get 8 marks in 28C). I doubt you would have a positive mindset with a situation like that
I see your point... I won't say anything, it'll only upset you, or anger you. (if I give positive advice, you'll only throw more arguments and points against having a positive mindset. But if I don't say anything, you'll have to realise it yourself :))

I'm sorry, but there's always a possibility of maximising your marks in the last few minutes, had you not studied, your result would reflect that. Had you not managed time sufficiently, again, your mark will reflect that.

I'm not making excuses for you, but I'm only saying that a lot can be accomplished in 20 minutes.

(Leave Multiple Choice for last, it takes 20 minutes to complete it, if not the last 10).

Stay focussed :)
 

holl

Member
Joined
Oct 23, 2003
Messages
130
It's worth 3 marks, so I would say
1 mark for SELECT, FROM, WHERE, ORDER BY etc
1 mark for putting the feilds in the right spot
1 mark for all the other things like no colons, asc or des
 

asymptote03

Member
Joined
Aug 18, 2003
Messages
58
Location
Sydney
Gender
Undisclosed
HSC
N/A
Originally posted by Huy
Um... I did this in another thread.

SELECT Last_name, First_name, Home_phone, State
FROM FRIENDS
Where State="NSW"
ORDER BY Last_name DESC

Fade, I don't think you're allowed to use colon's.
SELECT Last_name, First_name, Home_phone, State
FROM FRIENDS
Where State="NSW"
ORDER BY Last_name ASC

Huy...it must be in alphabetical order!!!! :>
 

Jeo

........
Joined
Apr 4, 2003
Messages
1,054
actually, you dont specify ASC or DESC when arranging it alphabetically, because it does it automatically. Also, you do not select state, so the correct SQL is:

SELECT Last_name, First_name, Home_phone FROM FRIENDS WHERE State = "NSW" ORDER BY Last_name
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top