This website includes Education Information like a programming language, job interview question, general knowledge.mathematics

Education log

PageNavi Results No.

Ads

Monday, September 23, 2019

SQL Interview Questions & Answers for developer and PL SQL Questions & Answers


 This article today discuss SQL Interview Questions & Answers for the developer. SQL is important to the software development you can use a software backend SQL server using today discuss a SQL Interview Questions. The SQL server is storage and manipulation of data. Databases. for  more information clik this link  SQL Interview Questions & Answers for developer https://www.guru99.com/sql-server-questions.html

what is SQL :

The database is a systematic collection of data. Databases support storage and manipulation of data. Databases make data management easy. This article provides SQL server interview questions for freshers follow the SQL server management Interview Questions.and PL SQL  Questions & Answers








1. What is DBMS? 

A Database Management System (DBMS) is a program that controls creation, maintenance and use of a database. DBMS can be termed as File Manager that manages data in a database rather than saving it in file systems. 


2. What is RDBMS? 

RDBMS stands for Relational Database Management System. RDBMS store the data into the collection of tables, which is related by common fields between the columns of the table. It also provides relational operators to manipulate the data stored into the tables. 
Example: SQL Server. 


3. What is SQL? 

SQL stands for Structured Query Language, and it is used to communicate with the Database. This is a standard language used to perform tasks such as retrieval, updating, insertion and deletion of data from a database. 
Standard SQL Commands are Select. 


4. What is a Database? 

Database is nothing but an organized form of data for easy access, storing, retrieval and managing of data. This is also known as structured form of data which can be accessed in many ways. 
Example: School Management Database, Bank Management Database.   


5.What is View in SQL?

A View can be defined as a virtual table that contains rows and columns with fields from one or more table.
Syntax : CREATE VIEW view_name AS SELECT column_name ( s ) FROM table_name WHERE condition



6.What are triggers?

Triggers in SQL is kind of stored procedures used to create a response to a specific action performed on the table such as Insert, Update or Delete. You can invoke triggers explicitly on the table in the database.
Action and Event are two main components of SQL triggers when certain actions are performed the event occurs in response to that action.


7. How we can update the view?

SQL CREATE and REPLACE can be used for updating the view.
Following query syntax is to be executed to update the created view

Syntax

CREATE OR REPLACE VIEW view_name AS
 SELECT column_name ( s )
FROM table_name WHERE condition



8. Explain the working of SQL Privileges?

SQL GRANT and REVOKE commands are used to implement privileges in SQL multiple user environments.  The administrator of the database can grant or revoke privileges to or from users of database object like SELECT, INSERT, UPDATE, DELETE, ALL etc.
GRANT  Command: This command is used provide database access to user apart from an administrator.



9. How many types of Privileges are available in SQL? 

There are two types of privileges used in SQL, such as
 System Privilege: System privileges deal with an object of a particular type and specifies the right to perform one or more actions on it which include Admin allows a user to perform administrative tasks, ALTER ANY INDEX, ALTER ANY CACHE GROUP CREATE/ALTER/DELETE TABLE, CREATE/ALTER/DELETE VIEW etc.  Object Privilege: This allows to perform actions on an object or object of another user(s) viz. table, view, indexes etc. Some of the object privileges are EXECUTE, INSERT, UPDATE, DELETE, SELECT, FLUSH, LOAD, INDEX, REFERENCES etc.



10. What is SQL Injection?

SQL Injection is a type of database attack technique where malicious SQL statements are inserted into an entry field of database such that once it is executed the database is opened for an attacker. This technique is usually used for attacking Data-Driven Applications to have an access to sensitive data and perform administrative tasks on databases.
For Example : SELECT column_name ( s ) FROM table_name WHERE condition



11. What is the difference between SQL and PL/SQL?

SQL is a structured query language to create and access databases whereas PL/SQL comes with procedural concepts of programming languages.



12.What is the difference between SQL and MySQL?

SQL is a structured query language that is used for manipulating and accessing the relational database, on the other hand, MySQL itself is a relational database that uses SQL as the standard database language.



13.What is the use of NVL function?

NVL function is used to convert the null value to its actual value.


14. What is the Cartesian product of table?

The output of Cross Join is called as a Cartesian product. It returns rows combining each row from the first table with each row of the second table. For Example, if we join two tables having 15 and 20 columns the Cartesian product of two tables will be 15×20=300 Rows.



15. What do you mean by Subquery?

Query within another query is called as Subquery. A subquery is called inner query which returns output that is to be used by another query



16. How many row comparison operators are used while working with a subquery?

There are 3-row comparison operators which are used in subqueries such as IN, ANY and ALL.



17. What is the difference between DELETE and TRUNCATE?

 The basic difference in both is DELETE is DML command and TRUNCATE is DDL  DELETE is used to delete a specific row from the table whereas TRUNCATE is used to remove all rows from the table  We can use DELETE with WHERE clause but cannot use TRUNCATE with it



18. What is the difference between DROP and TRUNCATE?

TRUNCATE removes all rows from the table which cannot be retrieved back, DROP removes the entire table from the database and it cannot be retrieved back.



19. What are Nested Triggers?

Triggers may implement data modification logic by using INSERT, UPDATE, and DELETE statement. These triggers that contain data modification logic and find other triggers for data modification are called Nested Triggers.



20. What is Cursor?

A cursor is a database object which is used to manipulate data in a row-to-row manner.
Cursor follows steps as given below
a.Declare Cursor 
b.Open Cursor 
c.Retrieve row from the Cursor
 d.Process the row  Close Cursor
 e. Deallocate Cursor



21. What do we need to check in Database Testing?

Generally, in Database Testing following thing is need to be tested
a. Database Connectivity
b. Constraint Check
c. Required Application Field and its size
d. Data Retrieval and Processing With DML operations
e. Stored Procedures
f. Functional flow



22. What is Database White Box Testing?

Database White Box Testing involves
1.Database Consistency and ACID properties 
2.Database triggers and logical views
 3. Decision Coverage, Condition Coverage, and Statement Coverage
4. Database Tables, Data Model, and Database Schema 
5.Referential integrity rules




23. What is Database Black Box Testing?

Database Black Box Testing involves
1.Data Mapping
2.  Data stored and retrieved
3. Use of Black Box techniques such as Equivalence Partitioning and Boundary Value Analysis (BVA)



24. What are Indexes in SQL?

The index can be defined as the way to retrieve the data more quickly. We can define indexes using CREATE statements.
Syntax :
CREATE INDEX index_name ON table_name ( column_name )






No comments:

Post a Comment