Last Minute Help ASAP

Good day everyone. I tried using access but getting answers that im not sure if im right. This is a sample questions. Pls check if im right or wrong.

a) Select Customer.Customer_Name, Customer.Address
From Customer

b) Select Bank.Branch_Name, Bank.Branch.City, Bank.Assets
From Bank
Where Bank.Assets > 10000000

c) Im not so sure whats the string "nor" how to apply

d) Select Deposit.Deposit_ID, Deposit.Customer_Name, Deposit.Amount, Bank.Branch_City
From (Im not so sureif theres inner join) Deposit INNER JOIN Bank
Where Balance > 80000 and Balance <120000
Order Balance (Asc)

Guide me if im wrong.TQ.

a) Almost :slight_smile: please re-read the question

b) Looks OK

c) "nor" should match the first part of the Customer Name - e.g. "Norbet", "Northsomething". You will need to use a LIKE comparison in the WHERE clause.

d) You are trying to join the wrong table, please re-read the question. We can then help with the syntax of the JOIN

You have the BALANCE wrong in the WHERE clause. Please re-read the question

Hi,

Ok, going through these in order:

a) You have been asked for the customer name and account number which are both in the deposit table (assuming the name column in there is a full name) as opposed to the Customer Table. Now I suspect there is multiple entries in the Deposit table for each customer so you may need to think about making the list distinct. That said I suspect that the Customer table actually has one entry per customer so you may want to use that and join the deposit table using the foreign key column which looks like it should be Customer_Name

b) This query looks ok but going by the question you are not being asked to return the Assets column in your result set.

c) The customer name column is going to be a character string data type (typically char, nchar, varchar or nvarchar). When the question asks for the name starting with the string "nor" they are asking for any name where the first three characters is "nor". You will need to use the wildcard "%" to ensure you get the results you require.

d) Whilst typing this I have just seen Kristen reply which pretty much covers my thoughts.

I hope this helps.

My guess is that that is not a requirement at this level (given the "level" of the other questions). Beyond that I'll take issue with the Normalisation of the question as posed as well use of Surrogate Keys!!

Oops! Missed that :frowning:

1 Like

Ahhh. I was careless for the first question.

  1. Select Deposit.Customer_Name, Deposit.Account_Number
    From Deposit; (Is it correct? How to know whether to use customer or deposit table)

  2. Select Bank.Branch_Name, Bank.Branch_City
    From Bank
    Where Bank Assets > 10000000;

  3. Select Deposit.Customer_Name, Deposit.Balance
    From Deposit
    Where Customer_Name like 'nor%';

  4. Select Deposit.Deposit_ID, Deposit.Customer_Name, Deposit.Amount, Bank.Branch_City
    From (Which part was wrong? I cant identify)
    Where Balance Between 8000 and 120000
    Order Balance (Asc)

  1. Why are you publicly posting "CONFIDENTIAL" questions from a Final Exam ?
  2. Why is anyone responding to such a post with answers??!!

2015 ... a past-paper?

I've only seen Hints provided (unless you were referring to helping with what may be a confidential paper)

  1. Which table contains the columns Customer_Name and Account_Number ? (Is it just a single table, or more than one [in which case you would need to JOIN the tables)

Which tables contain the columns that you need in the SELECT and WHERE?

You need a JOIN, what columns (from each table) will you Join on?

Do you have affirmative evidence that it's no longer "confidential"?

Don't the posting rules/guidelines for this forum, and general ethics, prohibit answering such qs?

Alright. Firstly, let me clarify.this was a past year paper and I think the term confidential applies to that particlaur year paper. Like this yr might be confidential . secondly, I really need help which is why I turn to this forum. U know that feeling when ur stuck at something and even googling can't help. Yeah. I'm sorry if it offended u. I'm trying to learn not asking direct answers too.

Kristen, based on what I see I can only figure joining deposit and bank. Only this two tables have the necessary records in question 4. Are my other answers right?

Another question, is there any advice on how to be able to know how to apply the syntax properly with questions like these? Like is there any solid methods or its just practice?

Nope. Didn't see the confidential until you mentioned it, but I am assuming that the Confidential relates to the original date. If the document is confidential beyond that date then I doubt the teacher should be using it as a mock paper either ... seems to me that an examination paper can't remain confidential after the exam as it is in the public domain thereafter.

I'm OK with helping / guiding students, provided that they submit their workings so far. I'm not OK with doing their homework for them as, of course, they wouldn't learn anything..

Yup, I agree.

Seem OK to me, but checking exam papers is not a skill I have; I'm dyslexic so the chance of me spotting a mis-match between question and answer is quite small.

That's a good pair of questions.

When you've been doing it for a while it kinda comes naturally. There may be better ways - more efficient / perform better / avoid pitfalls and, my particular soapbox:are programmed "defensively", that is to say writing the program in a way that will fail with suitable error message, or avoid possible outcomes, e.g. if data is "goofy" or goes out of expected ranges and so on. Plenty of palces just "churn out code", better places consider and address the quality of the code.

So I think it is important to strive for "Best of breed" coding techniques

I don't think Practice alone will help. You need Teaching - either from a more experienced person, or self-taught. I'm self-taught, some of it has come in peer-review with colleagues where we have debated the baest ways of doing things, I've also read some good books over the years - such as "Code Complete". Reducing bugs, the ones that come to light after the program is rolled out, is the biggest cost-saving, or counted another way highest "profit" :slight_smile: and that is what I have developed my methods to mitigate. We have extremely few failures in code that is in Production, we achieve that with a combination of Defensive Programming and good Testing / QA (i.e. the stage between Development and Deployment). Good error reporting is another way of reducing "cost" of failures in production; if the error can be quickly diagnosed and fixed that reduces the cost.

The cost of fixing a fault rises the further along the process that it is discovered. It is cheapest to fix in Design, and most expensive to fix if it has made it all the way into Production, which is why it is a primary focus of mine.

But we see all sorts of shocking code posted on here by people asking for help - unformatted, no consistency of style / naming, use of really poor technique ... and sadly I think that may be "average" in the industry.

Ok, we obviously view this very differently. Copyright law alone seems to me to cover this. I don't see any affirmative basis for assuming that prior year tests automatically become public domain. Indeed, the time period for that to happen is extremely long. Also, publicly known to some people and in the public domain are radically different things.

Alrighty, last question for the inner join so its
From Deposit Inner Join Bank (right?)
Sorry if it sounds sloppy but I need to know if its right. I'm still a very newbie in SQL.

Learning alone is gonna be hard but I've no choice at the moment. The database stuff that I'm learning now is basic coz I'm at foundation level. I'm doing computer foresncis so do u think mastering the SQL is vital for my stuff later on? I cud start with tutorials online like w3schools.