SQL Fundamentals Quiz
Test your knowledge of SQL commands, database operations, views, indexes, and query techniques including SELECT, UPDATE, JOIN, and WHERE clauses.
Questions
We refer to a join as a self-join when…
- we are joining more than 2 tables
- we are joining table to itself
- we are using left and right join together
- none of the above
What is the correct order of the ">" and the "=" operators, when we want to specify greater or equal search condition?
- >=
- Neither of the other two.
- =>
- !>=
What does the HAVING clause do?
- The HAVING keyword specifies a search condition for an aggregate or a group
- The HAVING keyword is used to select distinct values
- The HAVING keyword is used to join 2 or more tables.
- None of the above
What does follow after the SQL SELECT clause?
- The JOIN SQL clause.
- List of columns that will be selected or the * symbol.
- The name of the table we are selecting from.
- None of the above
What is an index?
- An index is the same as alias.
- An index is a special way to join 2 or more tables.
- An index is a database table attribute, which speeds-up data search within a table.
- None of the above
What is a view?
- A view is a special stored procedure executed when certain event occurs.
- A view is a database diagram.
- A view is a virtual table which results of executing a pre-compiled query. A view is not part of the physical database schema, while the regular tables are
- None of the above
How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table
- UPDATE Persons SET LastName='Hansen' WHERE LastName='Nilsen'
- MODIFY Persons SET LastName='Hansen' WHERE LastName='Nilsen'
- UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
- MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"
- SELECT * FROM Persons WHERE FirstName='%a%'
- SELECT * FROM Persons WHERE FirstName='a'
- SELECT * FROM Persons WHERE FirstName LIKE '%a'
- SELECT * FROM Persons WHERE FirstName LIKE 'a%'
how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"
- SELECT * FROM Persons WHERE FirstName='Peter',LastName='Jackson'
- SELECT * FROM Persons WHERE FirstName='Peter' OR LastName='Jackson'
- SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
- SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
how can you return all the records from a table named "Persons" sorted descending by "FirstName"
- SELECT * FROM Persons ORDER BY FirstName DESC
- SELECT * FROM Persons SORT BY 'FirstName' DESC
- SELECT * FROM Persons SORT 'FirstName' DESC
- SELECT * FROM Persons ORDER FirstName DESC
Which SQL statement is used to return only different values
- SELECT DIFFERENT
- SELECT DISTINCT
- SELECT COUNT
- SELECT UNIQUE
Which of the following can be a valid column name?
- Column
- 123_Invoices
- Catch_#22
- #Invoices
- None of the above
The TRUNCATE command writes user data to Rollback segments
- True
- False
To produce a meaningful result set without any cartesian products, what is the minimum number of conditions that should appear in the WHERE clause of a that joins 'N' tables?
- 4
- 3
- N - 1
- N + 1
When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?
- System tablespace
- Users tablespace
- Default tablespace for the user
- Oracle will give an error