Audit Command Language Interview Questions

How is security ensured in PostgreSQL?

PostgreSQL uses 2 levels of security

  • Network-level security uses Unix Domain sockets, TCP/IP sockets, and firewalls.
  • Transport-level security which uses SSL/TLS to enable secure communication with the database
  • Database-level security with features like roles and permissions, row-level security (RLS), and auditing.
  • 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?

  • Click on the below SQL Server official release link: https://www.microsoft.com/en-in/sql-server/sql-server-downloads
  • Click on the search icon and type in – SQL Server 2017 download
  • Click on the result link to download and save SQL Server 2017.
  • Select the type of SQL Server edition that you want to install. SQL Server can be used on a Cloud Platform or as an open-source edition(Express or Developer) in your local computer system.
  • Click on the Download Now button.
  • Save the .exe file on your system. Right-click on the .exe file and click on Open.
  • Click on ‘Yes’ to allow the changes to be made on your system and have SQL Server installed.
  • Once the installation is complete, restart your system, if required, and launch the SQL Server Management Studio application from the START menu.
  • 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:

  • Defining the transaction requirements precisely
  • Choosing the right query execution plan
  • Reducing table sizes and simplifying joins
  • Using ‘SELECT fields FROM’ instead of ‘SELECT*FROM’
  • Using EXIST() instead of COUNT()
  • Creating SQL query indexes
  • Avoiding running queries in loops
  • IT 5 Audit Command Language training with Mr Mandla 25 May 2021

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *