InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. | 
                                    Explain DDL commands with example. | 
                            
| 
                                   Answer»  DDL -Data Definition Language commands create database objects such as tables, views, etc., The various DDL commands are Create Table, Alter Table, Create View, Drop Table. 3 AMOUNT NUMBER, The ALTER TABLE command is used to do two things: 
 SYNTAX: ALTER TABLE table_name ADD( column_name data_type); DROP command is used to remove the entire table from the database.  | 
                            |
| 2. | 
                                    Explain AND operator using where in SQL. | 
                            
| 
                                   Answer»  The operator AND means that the expressions on both sides must be true to return TRUE. If either expression is false AND returns FALSE. Example 1: CUSTOMERS WHERE SALARY > 2000 AND age < 25; Example 2:  | 
                            |
| 3. | 
                                    List the components of SQL architecture. | 
                            
| 
                                   Answer»  When executing an SQL command for any RDBMS, the SQL engine interprets the task for execution. There are various components included in the process. These components of SQL architecture are Query Dispatcher, Optimization Engines, Classic Query Engine, and SQL Query Engine, etc.,  | 
                            |
| 4. | 
                                    What is the dual table? | 
                            
| 
                                   Answer»  It is single row and single column dummy table provided by oracle.  | 
                            |
| 5. | 
                                    Classify numeric and character string data types in SQL. | 
                            
                                   Answer» 
  | 
                            |
| 6. | 
                                    What is commit command? | 
                            
| 
                                   Answer»  The commit command is used to save the transactions entered into the table.  | 
                            |
| 7. | 
                                    What is drop command in SQL. | 
                            
| 
                                   Answer»  The drop command is used to remove/delete tables,  | 
                            |
| 8. | 
                                    Expand the term SQL. | 
                            
| 
                                   Answer»  The SQL is expanded as ‘Structured Query Language’.  | 
                            |
| 9. | 
                                    What is update command? | 
                            
| 
                                   Answer»  The update command is used to change row values from a table. The SET keyword takes the column in which values needs to be changed or updated.  | 
                            |
| 10. | 
                                    Give the command to display all the details in the table. | 
                            
| 
                                   Answer»  To view All the Columns and all the Rows (Entire Table values)  | 
                            |
| 11. | 
                                    Classify various SQL operators. | 
                            
| 
                                   Answer»  The various SQL operators are Arithmetic operators, Comparison operators, Logical operators, Operators used to negate conditions.  | 
                            |
| 12. | 
                                    Write the syntax for distinct commands in SQL. | 
                            
| 
                                   Answer»  Syntax:  | 
                            |
| 13. | 
                                    Which are the logical operators in SQL. | 
                            
| 
                                   Answer»  The logical operators in SQL are ALL, AND, ANY BETWEEN, EXISTS, IN, LIKE, NOT, OR, IS NULL, UNIQUE.  | 
                            |
| 14. | 
                                    What is the use of NULL value? | 
                            
| 
                                   Answer»  A field with a value of NULL means that the field actually has no value stored in it.  | 
                            |
| 15. | 
                                    What is create view command? | 
                            
| 
                                   Answer»  A view is referred to as a virtual table. Views are created by using the CREATE VIEW statement.  | 
                            |
| 16. | 
                                    Write the differences between order by and group by with example. | 
                            
| 
                                   Answer»  1. SQL ORDER BY Clause: The SQL ORDER BY Clause is used in a SELECT statement to sort results either in ascending or descending order. Syntax for using SQL ORDER BY clause to sort data is: 2. SQL GROUP BY Clause: The basic syntax of GROUP BY clause is given below. The GROUP BY clause must follow the conditions in the WHERE clause and must precede the ORDER BY clause if one is used. For Example: If you want to know the total amount of salary spent on each department, the query would be:  | 
                            |
| 17. | 
                                    Give the syntax for create command in SQL. | 
                            
| 
                                   Answer»  Syntax:  | 
                            |
| 18. | 
                                    Explain with example to create details of employees and give the minimum and maximum in the salary domain. | 
                            
| 
                                   Answer»  The CHECK constraint is used to limit the value range that can be placed in a column. Check Constraint at column level: s);  | 
                            |
| 19. | 
                                    Explain SQL constraints with example. | 
                            
| 
                                   Answer»  SQL Constraints are rules used to limit the type of data that can be stored into a table, to maintain the accuracy and integrity of the data inside table. 
 Constraints are used to make sure that the integrity of data is maintained in the database. The NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, DEFAULT are the most used constraints that can be applied to a table. 1. NOT NULL Constraint: NOT NULL constraint restricts a column from having a NULL value. Once *NOT NULL* constraint is applied to a column, you cannot store null value to that column. It enforces a column to contain a proper value. 2. UNIQUE Constraint: UNIQUE constraint ensures that a field or column will only have unique values. A UNIQUE constraint field will not have duplicate data. 3. Primary Key Constraint: The primary key constraint uniquely identifies each record in a database. A Primary Key must contain unique value and it must not contain a null value. 4. Foreign Key Constraint: FOREIGN KEY is used to relate two tables. A FOREIGN KEY in one table points to a PRIMARY KEY in another table. ) 5. CHECK Constraint: CHECK constraint is used to restrict the value of a column between a range. It performs check on the values, before storing them into the database.  | 
                            |
| 20. | 
                                    What are privileges and roles? | 
                            
| 
                                   Answer»  The Privileges defines the access rights given to a user on a database object. There are two types of privileges. 
 Few CREATE system privileges are listed below: CREATE object – allows users to create the specified object in their own schema. Few of the object privileges are listed below: 
 Roles: Some of the privileges granted to the system roles are as given below: 1. CONNECT – CREATE TABLE, CREATE VIEW, CREATE SYNONYM, CREATE SEQUENCE, CREATE SESSION, etc. 2. RESOURCE – CREATE PROCEDURE, CREATE SEQUENCE, CREATE TABLE, CREATE TRIG-GER, etc. The primary usage of the RESOURCE role is to restrict access to database objects. DBA- ALL SYSTEM PRIVILEGES.  | 
                            |
| 21. | 
                                    Explain with an example boolean expression in SQL. | 
                            
| 
                                   Answer»  Boolean expressions return rows (results) when a single value is matched. Boolean expressions commonly used in a WHERE clause are made of operands operated on by SQL operators. For example, > SELECT * FROM EMPLOYEES WHERE AGE = 45;  | 
                            |