How is security ensured in PostgreSQL?
PostgreSQL uses 2 levels of security
Can we disable a trigger? If yes, How?
Yes, we can disable a single trigger on the database by using “DISABLE TRIGGER triggerName ON<>. We also have an option to disable all the trigger by using, “DISABLE Trigger ALL ON ALL SERVER”.
How to install SQL Server 2017?
5 How can you distinguish between SUBSTR and CHARINDEX?
Ans: Given the starting position and length details, SUBSTR helps extract a substring from the specified string.
The syntax for this function is given by:
SUBSTRING (expression, starting_position, length)
On the contrary, the CHARINDEX function helps identify a substrings position from the specified string.
The syntax for this function is given by:
CHARINDEX (substring, input_string)
How to insert multiple rows in SQL?
To insert multiple rows in SQL we can follow the below syntax:
We start off by giving the keywords INSERT INTO then we give the name of the table into which we would want to insert the values. We will follow it up with the list of the columns, for which we would have to add the values. Then we will give in the VALUES keyword and finally, we will give the list of values.
Here is an example of the same:
In the above example, we are inserting multiple records into the table called employees.
How can you distinguish between GETDATE and SYSDATETIME functions?
Ans: The GETDATE function returns the date and time of a location. In contrast, the SYSDATETIME function returns the date and time with the precision of 7 digits after the decimal point.
You can understand this from the following examples.
What do you mean by Stored Procedures? How do we use it?
A stored procedure is a collection of SQL statements that can be used as a function to access the database. We can create these stored procedures earlier before using it and can execute them wherever required by applying some conditional logic to it. Stored procedures are also used to reduce network traffic and improve performance.
How do you delete the database in PostgreSQL?
Databases can be deleted in PostgreSQL using the syntax
Please note that only databases having no active connections can be dropped.
9 How to improve query performance in SQL server?
Ans: We can improve the query performance in the following ways: