Upwork Test Answers: Get all the correct answers of most recent and possible Upwork Tests A to Z (Updated on Jan, 2016)
Cover Letter Templates: These cover letter samples are not only for Upwork job, but also you will have some idea about your real life job
 
Freelance Profile Overviews: Different Profile samples and overviews of experts, advanced and intermediate level freelancers
For Newbie of Upwork: Upwork Help - How to apply for a job in Upwork with 10 most important articles about Upwork

A to Z View - All Upwork Test Answers

ANSI SQL Test Answers (new)

Here you will have most recent Upwork Test questions with updated answers of ANSI SQL Test Answers for Upwork Database Category.

Search your desired answers of the Upwork ANSI SQL Test questions.
---------------------------------------------------------------------------------------------------------------------

1. The simplest query must include at least________ and _________.

 Answers: • A select clause or • A from clause

 2. Which of the following are aggregate functions in SQL?
 Answers:

 • Avg or • Sum

 3. Which logical operator can reverse the result?
 Answers: • NOT

 4. What are the programs that execute automatically whenever DML operations are performed on tables called?
 Answers: • Triggers

 5. The primary key index does not allow ________ data in a field.
 Answers: • Duplicate

 6. Which character function should be used to return a specified portion of a character string?
 Answers: • SUBSTR

 7. Which one of the following correctly selects rows from the table myTable that have null in column column1?
 Answers: • SELECT * FROM myTable WHERE column1 is null

 8. What does the following Update statement do?


 Update OrderTable set OrderDiscount=OrderDiscount*1.10
 Answers: • Increases OrderDiscount of all rows by 10%

 9. Consider the following table structure of students:
 rollno number(4)
 name varchar(20)
 course varchar(20)
 What will be the query to display the courses in which the number of students
 enrolled is more than 5?
 Answers: • Select course from students group by course having count(*) > 5;

 10. Consider the following tables:

 Books
 ------
 BookId
 BookName
 AuthorId
 SubjectId
 PopularityRating (the popularity of the book on a scale of 1 to 10)
 Language (such as French, English, German etc)


 Subjects
 ---------
 SubjectId
 Subject (such as History, Geography, Mathematics etc)


 Authors
 --------
 AuthorId
 AuthorName
 Country

 What is the query to determine which Authors have written at least 1 book with a popularity rating of less than 5?
 Answers: • select authorname from authors where authorid in (select authorid from books where popularityrating<5)

 11. Examine the code given below:

 SELECT employee_id FROM employees WHERE commission_pct=.5 OR salary > 23000


 Which of the following statements is correct with regard to this code?
 Answers: • It returns employees who have 50% commission rate or salary greater than $23,000

 12. Which component of an RDBMS validates the syntax of the user's query?
 Answers: • Query Parse

 13. What does MOD() function do?
 Answers: • Returns the remainder after division

 14. Which of the following is not a SQL operator?
 Answers: • Having

 15. Which of the following operation is invalid with respect to dates?
 Answers: • date - date

 16. What does the term DDL stand for?
 Answers: • Data Definition Language

 17. Consider the following tables:

 Books
 ------
 BookId
 BookName
 AuthorId
 SubjectId
 PopularityRating (the popularity of the book on a scale of 1 to 10)
 Language (such as French, English, German etc)


 Subjects
 ---------
 SubjectId
 Subject (such as History, Geography, Mathematics etc)


 Authors
 --------
 AuthorId
 AuthorName
 Country

 What is the query to determine which German books(if any) are more popular than all the French?
 Answers: • select bookname from books where language='German' and popularityrating > (select max(popularityrating) from books where language='French')

 18. Consider the following tables:

 Books
 ------
 BookId
 BookName
 AuthorId
 SubjectId
 PopularityRating (the popularity of the book on a scale of 1 to 10)
 Language (such as French, English, German etc)


 Subjects
 ---------
 SubjectId
 Subject (such as History, Geography, Mathematics etc)


 Authors
 --------
 AuthorId
 AuthorName
 Country

 What is the query to determine which is the most popular book written in French?
 Answers: • select bookname from books where language='French' and popularityrating = (select max(popularityrating) from books where language='French')

 19. How many foreign key constraints can a table have?
 Answers: • None of the above

 20. When a table is dropped using a simple DROP statement, SQL performs some more operations simultaneously, select all the valid operations?
 Answers: • Removes all rows from the table

 21. You want to display the titles of books that meet the following criteria:

 1. Purchased before November 11, 2002
 2. Price is less than $500 or greater than $900

 You want to sort the result by the date of purchase, starting with the most recently bought book.
 Which of the following statements should you use?
 Answers: • SELECT Book_title FROM books WHERE (price < 500 OR price >900) AND purchase_date<'11/11/2002' ORDER BY purchase_date DESC;

 22. Which operator will be evaluated first in the following statement:


 select (age + 3 * 4 / 2 - 8) from emp
 Answers: • *

 23. What clause should be used to display the rows of a table in ascending order of a particular column?
 Answers: • Order By

 24. What is the correct order of clauses in the select statement?
 1 select
 2 order by
 3 where
 4 having
 5 group by
 Answers: • 1,3,5,4,2

 25. Which of the following statements is true?

 (a)The Insert statement creates new rows
 (b)The Update statement modifies the table structure
 Answers: • only (a) is true

 26. A table Students has a column called name which stores the names of the students. What will be the correct query to display the names of the students in reverse order?
 Answers: • Select name from students order by name desc;

 27. Choose the appropriate query for the Products table where data should be displayed primarily in ascending order of the ProductGroup column. Secondary sorting should be in descending order of the CurrentStock column.
 Answers: • Select * from Products order by ProductGroup,CurrentStock DESC

 28. Examine the two SQL statements given below:


 SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY salary DESC


 SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY 2 DESC


 What is true about them?
 Answers: • The two statements produce identical results

 29. The overall logical structure of a database can be expressed graphically by:
 Answers: • Entity-Relationship Diagram

 30. In an RDBMS, which term is used to describe 'data about data'?
 Answers: • Meta data