SQL Exam: Trivia Questions! Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Emadeid
E
Emadeid
Community Contributor
Quizzes Created: 4 | Total Attempts: 2,261
Questions: 25 | Attempts: 618

SettingsSettingsSettings
SQL Exam: Trivia Questions! Quiz - Quiz


SQL Exam: trivia questions quiz! The structured query language is designed to help a programmer manipulate databases. It helps in retrieval and editing of data from the database with ease. This computer language is one of the easiest to understand and was first created in the 1970s. By taking this quiz, you will get a chance to test out your knowledge of the language and how to write it. Give it a try!


Questions and Answers
  • 1. 

    SQL < select name ,sal from Emp where name like m%;

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given SQL statement selects the columns "name" and "sal" from the table "Emp" where the name starts with the letter "m". The correct answer is False because the SQL statement is incorrect. The "%" wildcard character should be enclosed in single quotes ('%') to indicate a pattern match. So, the correct SQL statement should be "SELECT name, sal FROM Emp WHERE name LIKE 'm%';".

    Rate this question:

  • 2. 

    SQL < select name , job from Emp where sal < = 25000 or job = sales ;

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given SQL statement selects the name and job columns from the Emp table where either the sal column is less than or equal to 25000 or the job column is equal to "sales". Therefore, the correct answer is False because the statement is selecting records that meet either one of the conditions, not both.

    Rate this question:

  • 3. 

    SQL < select name , job from Emp  where sal < = 25000 or job = 'sales' ;

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given SQL query selects the name and job columns from the Emp table where the salary is less than or equal to 25000 or the job is 'sales'. Since the query is selecting rows that meet either of these conditions, it will return true.

    Rate this question:

  • 4. 

    SQL < select * from Emp where sal between 1000 and 2000.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given SQL statement selects all the records from the "Emp" table where the "sal" column value is between 1000 and 2000. Since the statement does not specify any particular condition or constraint, it will return all the records that meet this criteria. Therefore, the correct answer is False, as the statement is not selecting a specific record or condition.

    Rate this question:

  • 5. 

    SQL < select * from Emp where sal between 1000 and 2000 ;

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given SQL statement selects all the records from the "Emp" table where the "sal" column value is between 1000 and 2000. Since the statement is valid and will retrieve records based on the given condition, the correct answer is "True".

    Rate this question:

  • 6. 

    SQL < select  * where sal between 1000 and 2000 ;

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given SQL statement is incorrect because it is missing the "FROM" clause. The correct syntax should be "SELECT * FROM table_name WHERE sal BETWEEN 1000 AND 2000;". Therefore, the correct answer is False.

    Rate this question:

  • 7. 

    SQL < select * from Emp where sal between 1000 and 2000 ;

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given SQL query selects all the rows from the "Emp" table where the "sal" column has a value between 1000 and 2000. Since the query is valid and will return a result, the correct answer is "True".

    Rate this question:

  • 8. 

    SQL < select * from Emp where sal  1000 and 2000 ;

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given SQL statement is not written correctly. The correct syntax for selecting records based on a range of values in the "sal" column would be "SELECT * FROM Emp WHERE sal BETWEEN 1000 AND 2000;". Therefore, the correct answer is False.

    Rate this question:

  • 9. 

    SQL < select * from Emp where sal between 1000 and 2000 ;

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The SQL statement "select * from Emp where sal between 1000 and 2000" is used to retrieve all the records from the table "Emp" where the salary is between 1000 and 2000. Since the statement is valid and can be executed without any errors, the correct answer is "True".

    Rate this question:

  • 10. 

    SQL < select name ,sal from Emp where name like 'm%';

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The SQL query selects the "name" and "sal" columns from the "Emp" table where the "name" column starts with the letter "m". Since the query is valid and will return a result, the correct answer is "True".

    Rate this question:

  • 11. 

    SQL < select name , job from Emp where sal < = 25000 or job = 'sales' ;

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given SQL statement selects the columns "name" and "job" from the "Emp" table where the salary is less than or equal to 25000 or the job is "sales". Since the statement is valid and will return a result, the correct answer is True.

    Rate this question:

  • 12. 

    SQL < select name , job from Emp where sal < = 25000 or job =sales ;

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given SQL query selects the name and job columns from the Emp table where the salary is less than or equal to 25000 or the job is equal to "sales". Since the query has an "or" condition, it will return all the rows that satisfy either of the conditions. Therefore, the answer is false, indicating that the statement is incorrect.

    Rate this question:

  • 13. 

    SQL < select * from Emp where sal between 1000 and 2000 ;

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    This SQL statement selects all the rows from the "Emp" table where the "sal" column value is between 1000 and 2000. Therefore, the correct answer is "True" because the statement is valid and will return the desired results.

    Rate this question:

  • 14. 

    SQL < select name , sal from Emp name like '-a%' ;

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given SQL statement is incorrect. The correct syntax for selecting columns "name" and "sal" from the table "Emp" where the name starts with "-a" would be: "SELECT name, sal FROM Emp WHERE name LIKE '-a%'. Therefore, the correct answer is False.

    Rate this question:

  • 15. 

    SQL < select name , job , sal from emp where job = 'sales' and sal < 1500;

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given SQL statement selects the name, job, and salary of employees from the "emp" table where the job is "sales" and the salary is less than 1500. If there are any employees who satisfy both conditions, the statement will return true.

    Rate this question:

  • 16. 

    SQL < select min sal , max (sal) from emp;

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given SQL statement selects the minimum salary and the maximum salary from the "emp" table. Therefore, the correct answer is False, as the statement is syntactically incorrect. The "max" function should be used without parentheses, like "max(sal)", instead of "max (sal)".

    Rate this question:

  • 17. 

    SQL < select name , job , sal from emp where (job='sales' or job = 'clerk') and sal < 1700 ;

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given SQL query selects the name, job, and salary of employees from the "emp" table where their job is either "sales" or "clerk" and their salary is less than 1700. Since the query is selecting specific columns and applying conditions on the job and salary, it is expected to return a result. Therefore, the correct answer is "True".

    Rate this question:

  • 18. 

    SQL < select name , sal + 300 from emp

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given SQL statement selects the "name" column and adds 300 to the "sal" column from the "emp" table. Therefore, the correct answer is False.

    Rate this question:

  • 19. 

    DDL is SQL commands that allows the creating, alteration, and dropping of an object from the database.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The statement is true because DDL (Data Definition Language) is indeed a set of SQL commands that are used to create, modify, and delete database objects such as tables, indexes, and views. These commands include CREATE, ALTER, and DROP, which respectively allow the creation, alteration, and dropping of objects from the database. Therefore, the given statement accurately describes DDL commands and their purpose.

    Rate this question:

  • 20. 

    Definition of DML is SQL commands allow the inserting, updating, and deletion of objects from the database.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given statement is true. DML (Data Manipulation Language) in SQL allows the insertion of new data into the database, updating existing data, and deleting unwanted data from the database. It includes commands such as INSERT, UPDATE, and DELETE, which are used to perform these operations on the database objects. Therefore, the statement accurately defines the purpose of DML in SQL.

    Rate this question:

  • 21. 

    Definition of Dcl is SQL commands allow certain DML commands to be undone.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given statement is false. Dcl (Data Control Language) in SQL is used to control access to the database and perform administrative tasks. It includes commands like GRANT, REVOKE, and DENY, which are used to grant or revoke privileges on database objects. DML (Data Manipulation Language) commands like INSERT, UPDATE, and DELETE are used to modify data in the database and cannot be undone using Dcl commands. Therefore, the statement that Dcl commands allow certain DML commands to be undone is incorrect.

    Rate this question:

  • 22. 

    A null is not the same as zero or a blank space.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A null refers to the absence of a value, while zero represents a numerical value and a blank space represents an empty character. Therefore, a null is different from both zero and a blank space.

    Rate this question:

  • 23. 

    SQL is Is based on American National Standards Institute ( ANSI ) standard SQL.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given statement is true because SQL, which stands for Structured Query Language, is indeed based on the American National Standards Institute (ANSI) standard SQL. This standard ensures that SQL is consistent and compatible across different database management systems, allowing for portability and interoperability of SQL code.

    Rate this question:

  • 24. 

    SQL Can be abbreviated.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    SQL cannot be abbreviated. It stands for Structured Query Language and is a programming language used for managing relational databases. Abbreviating SQL would result in a different term altogether and would not accurately represent the purpose and functionality of the language. Therefore, the correct answer is False.

    Rate this question:

  • 25. 

    SQL Is Manipulates data and table definitions in the data base.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The statement is true because SQL (Structured Query Language) is a programming language that is used to manipulate and manage data and table definitions in a database. It is specifically designed for managing relational databases and allows users to perform tasks such as inserting, updating, deleting, and retrieving data from tables. SQL is widely used in the field of database management systems and is essential for working with databases effectively.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 02, 2011
    Quiz Created by
    Emadeid

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.