1. Describe the Basic Form of the SQL SELECT Command

1. Describe the Basic Form of the SQL SELECT Command

<p> COP2700 – Data Structures (SQL) Pop Quiz – Chapter 4 – Single Table Selects</p><p>Names: ______1. Describe the basic form of the SQL SELECT command. SELECT (columns, expressions, constants or *) FROM (Tables or Views) JOIN (Join clauses) WHERE (Conditional Statements) GROUP BY (columns, expressions, constants) HAVING (Conditional Statements) ORDER BY (columns, expressions, constants)</p><p>2. How do you form a compound condition? Give an example. By connecting two or more conditional statements with a conjunction… WHERE Author_Num = 123 AND City = ‘Miami’</p><p>3. In SQL, what operator do you use to determine whether a value is between two other values without using an AND condition? BETWEEN</p><p>4. How do you use a computed column in SQL? How do you name the computed column? A computed column is like any other column and can be used in the same way. To name a computer column, you would use the AS directive. SELECT On_Hand * Price AS On_Hand_Total FROM Part Just as an aside, the AS is really not needed, but makes things more readable</p><p>5. How do you determine whether a column contains one of a particular set of values without using an OR condition? With the “IN” directive</p><p>6. How do you sort data in descending order? ORDER BY column_name DESC</p><p>7. What are the SQL aggregate functions? Count(), SUM(), AVG(), MIN() and MAX()</p><p>8. How do you avoid including duplicate values in a query’s results? Use the Distinct Adjective</p><p>9. What is a subquery? A subquery is a query within a query that is done first. If it is a Scalar Select (which returns one row and one column), you can use it in a normal conditional statement. If it returns a table with a single column, it can be used with the IN expression.</p><p>More Questions 1 On Other Side COP2700 – Data Structures (SQL) Pop Quiz – Chapter 4 – Single Table Selects</p><p>Names: ______</p><p>10. How do you group data in an SQL query? By using the GROUP BY directive</p><p>11. How do you find rows in which a particular column contains a null value? By using the conditional IS NULL SELECT * FROM Transcript WHERE Grade IS NULL</p><p>12. The Result Set from a Select Clause is a what? The Result Set from a Select Clause returns a Table</p><p>More Questions 2 On Other Side</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us