SQL Fundamentals and Database Concepts
Test your knowledge of SQL commands, database operations, and Oracle-specific features including SELECT statements, table creation, views, constraints, and data manipulation.
Questions
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
Which character is used to continue a statement in SQL*Plus?
- *
- /
- -
- @
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 four-table join?
- 5
- 4
- 3
- There is no such criteria
Which of the following SQL functions can operate on any datatype?
- TO_CHAR
- LOWER
- LPAD
- MAX
Choose correct syntax to insert values into r4r_team table
- INSERT INTO r4r_team (id, username, exp) VALUES (1, ‘r4r01’, ‘2’);
- INSERT INTO r4r_team VALUES (1, ‘r4r01’, ‘2’);
- INSERT INTO r4r_team (id, username, exp) VALUE (1, ‘r4r01’, ‘2’);
- INSERT INTO table r4r_team (id, username, exp) VALUE (1, ‘r4r01’, ‘2’);
<> and != both are same operator into SQL
- True
- False
Choose true option
- BETWEEN -->>Used for range with in values
- LIKE -->>Used for Search a pattern
- IN -->>return east one of the columns in given set of values
- 1,2,3
Truncate is faster than delete
- True
- False
delete will lower the water mark
- True
- False
Which of the following denote group clause in SQL
- having
- group by
- where
- both 1 and 2
If base table does not exists, can we create a view?
- True
- False
If the base table of a view is deleted and we give SQL Select command on view table name
- Gives the columns referred in select statement of view
- Reports a error
- Select only particular columns of view table
- Outputs the whole view table
Which of the following data types are used in SQL?
- Long
- Date
- rowid
- all above
Which of the following SQL statement create a sequence SE with starting value as 30 and in increments of 20?
- GENERATE SEQUENCE SE START WITH 30 ADD BY 20;
- CREATE SEQUENCE SE START WITH 30 ADD BY 20;
- CREATE SEQUENCE SE START WITH 30 INCREMENT BY 20;
- GENERATE SEQUENCE SE INITIATE WITH 30 INCREMENT BY 20;
Which of the following is TRUE about Primary Key?
- Same value of Primary Key can appear in more than one row in the table
- A Primary key defined column can be of type LONG
- A column that is defined as Primary Key cannot contain NULL value
- Both A. and B.
Which of the following is not allowed while creating a table using CRRATE TABLE in SQL?
- Table name can be an oracle reserved word
- Table names must begin with a letter
- Table names can contain in it numbers also
- None of the Above
With SQL, how can you return the number of records in the "Persons" table?
- SELECT COLUMNS(*) FROM Persons
- SELECT COUNT() FROM Persons
- SELECT COUNT(*) FROM Persons
- SELECT COLUMNS() FROM Persons
Which SQL keyword is used to sort the result-set?
- order
- sort
- order by
- sort by
Which SQL statement is used to return only different values?
- SELECT DIFFERENT
- SELECT DISTINCT
- SELECT UNIQUE
- SELECT PRIMARY
With SQL, 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 LIKE '%a'
- SELECT * FROM Persons WHERE FirstName='a'
- SELECT * FROM Persons WHERE FirstName LIKE 'a%'
- SELECT * FROM Persons WHERE FirstName='%a%'