T-SQL And General SQL: Unit 1 - Introduction To SQL Queries

26 Questions | Total Attempts: 45

SettingsSettingsSettings
Please wait...
T SQL Quizzes & Trivia

Related Topics
Questions and Answers
  • 1. 
    SQL: What are the purposes of the * symbol in a SELECT statement?
  • 2. 
    T-SQL:  Write the SQL to list all employees (empno, sal) whose salary (sal) is between 1000 and 2000. The table in question is called 'emp'.
  • 3. 
    T-SQL: Write the SQL to display each of the different types of occupation (i.e. each occupation only once). The table in question is called 'emp', and the occupation column is called 'job'
  • 4. 
    T-SQL: Write the SQL to display all the employees who were recruited during 1983 giving their name (ename), department number(deptno) and hire date(hiredate). The table in question is 'emp', with the default owner.
  • 5. 
    T-SQL: Write the SQL to find the names (ename), jobs (job) and salaries (sal) of all employees who do not have managers (mgr). The table in question is called 'emp', with the default owner.
  • 6. 
    T-SQL: Write the SQL to list the jobs (job) and department numbers (deptno) of employees whose names  (ename) ends with s. The table in question is called 'emp' with the default owner.
  • 7. 
    T-SQL: Find employees (ename, job) who are not managers or the president. The table in question is 'emp', with the default owner
  • 8. 
    T-SQL: Write the SQL to work out what percentage of salary (sal) the commission (comm) is for an employee who earns commission. The table in quesiton is called 'emp', with the default owner.
  • 9. 
    T-SQL: Write the SQL to list the department number (deptno), name (ename), job (job) and salary (sal) of all employees, firstly in department number (deptno) order and then in salary (sal) order, showing the highest salary for each department first. The table in question is called 'emp', with a default owner.
  • 10. 
    T-SQL: What is the format for the 'date' datatype?
  • 11. 
    SQL: Write an sql statement to insert 1227 and 'Manager' into the 'empno' and 'job' column of the dbo.emp table respectively.
  • 12. 
    T-SQL: What keyboard shortcut do you use in sql server management studio to execute an sql statement?
  • 13. 
    T-SQL: You have a table with a colum entitled 'job', whose values are all lower case. If you execute the following query: SELECT ename, job, deptno FROM dbo.emp WHERE job = 'CLERK'   you will not get any results back buecase the match is case sensitve and so because all values of the 'job' colum are lowercase, uppercase 'CLERK' will not be found.
    • A. 

      True

    • B. 

      False

  • 14. 
    SQL: what operator is used to perform a search that matches a range of values?
  • 15. 
    SQL: What operator(s) can be used to perform a search that is not in a specified range of values?
  • 16. 
    SQL: What operator is used for negation?
  • 17. 
    SQL: What operator is used to compare against null values?
  • 18. 
    SQL: What operator(s) is used to compare against values that are not null?
  • 19. 
    SQL: What operator would you use to compare against values that are not null?
    • A. 

      NOT NULL

    • B. 

      NOT IS NULL

    • C. 

      IS NOT NULL

    • D. 

      !NULL

  • 20. 
    SQL: What operator would you use to compare against values that are not like other values?
    • A. 

      NOT LIKE

    • B. 

      IS NOT LIKE

    • C. 

      NOT IS LIKE

  • 21. 
    SQL: What operator would you use to find values that are not in a specified list?
    • A. 

      NOT IN LIST

    • B. 

      NOT IN

    • C. 

      IS NOT IN

  • 22. 
    SQL: What does the wildcard expression % stand for?
  • 23. 
    SQL: What does the wildcard underscore operator (_) stand for?
  • 24. 
    SQL: What operator do you use to perform wildcard matches?
  • 25. 
    SQL: What is the 'not equals' operator?