Home > Ask the Oracle Database / Applications Experts > SQL Questions & Answers > Two SQL homework questions
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Two SQL homework questions

Rudy Limeback EXPERT RESPONSE FROM: Rudy Limeback

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site


Oracle tips, scripts, and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 26 April 2007

I'm trying to answer the following questions for a homework assignment. Can you help?

  1. In a SQL statement, the SELECT clause is used to select
     (a) columns
     (b) rows
     (c) tables
     (d) none of the above

  2. In a SQL statement the FROM clause is used to select
     (a) which rows to extract from the table
     (b) which tables to extract data from
     (c) which conditions must be met to choose data to extract
     (d) b and c

The answers were not in any of my material. So it's possible that I'm supposed to go outside for answers. Thank you very much.



Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
SQL
How to check SQL query construction with the Mimer Validator
Using the SQL GROUP BY clause for counting combinations
How to use an SQL CASE expression
How to sort an SQL UNION query with special ORDER BY sequence
How to use string functions to make an SQL join
An SQL solution for a customer order homework problem
How to use SQL's POSITION function with substrings
Using SQL date functions to get totals for last three days
Using CASE in the SQL ORDER BY clause
What's the difference between an SQL inner join and equijoin?

Oracle and SQL
Using the SQL GROUP BY clause for counting combinations
How to use an SQL CASE expression
How to use the Oracle Database SQL Reference Manual
How to use SQL Developer to run SQL statements
How to work with the Oracle database home page
How to use SQL*Plus in Oracle
How to use SQL Developer to work with an Oracle database
How to view and edit table column definitions
How to sort an SQL UNION query with special ORDER BY sequence
How to use string functions to make an SQL join
Oracle and SQL Research

Oracle training and certification
Special Report: Collaborate '09
Oracle certifications to get an Oracle DBA job
What should I study after Oracle 9i training?
Confused about Oracle certification exams
Difference between Oracle Forms and E-Business Suite
Becoming a DBA with no experience
Oracle 10g study materials
Complete guide to becoming an Oracle database administrator
The power of Oracle certification
Switching to Oracle from Indian RDBMS

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
autonomous transaction  (SearchOracle.com)
CFML  (SearchOracle.com)
dynamic SQL  (SearchOracle.com)
foreign key  (SearchOracle.com)
Java Database Connectivity  (SearchOracle.com)
Open Database Connectivity  (SearchOracle.com)
Oracle  (SearchOracle.com)
stored procedure  (SearchOracle.com)
The Open Group  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


Your honesty in identifying these as homework questions is appreciated. Students who try to disguise their questions invariably receive no reply at all from me. However, you are really stretching the bounds of credibility in your closing paragraph. The answers to those questions are in your material, assuming that your material is even the most basic of SQL tutorials, and not a fennel soup recipe.

For the first question, consider the following query:

select char(34,72,101,108,108,111
           ,32,87,111,105,108,100,34)
        as message

Is this a column? In the strictest sense, yes. But notice that it is not a column in any table. In fact, there is no table in the query, is there. Still, (a) sounds right.

But what about this query:

select sum(case when gender = 'F'
                then salary * 0.15
            end) 
       as total_raise_amount
  from employees

Is this SELECT clause not selecting rows? Most definitely, eh. So, (b) sounds right.

Then there's this query:

select * from customer_orders

If that's not selecting an entire table, then what's it doing? Thus, (c) sounds right.

So for the first question, (a), (b), and (c) all sound right, which makes (d) wrong. Does that help?

For the second question, similar examples can be given. The FROM clause selects all rows from the table, which makes (a) correct. It definitely identifies which tables to extract data from, which makes (b) correct. And the FROM clause can also have join conditions (using the ON keyword), so that makes (c) correct. Therefore (d) is also correct. Does that help?




Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Oracle White Papers: Fusion Middleware
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts