To Find the nth highest and least salary
1. To Find the nth highest salary Eg: General query for all Database SELECT DISTINCT salary FROM emp X WHERE n = ( SELECT COUNT(DISTINCT salary) FROM emp WHERE salary…
1. To Find the nth highest salary Eg: General query for all Database SELECT DISTINCT salary FROM emp X WHERE n = ( SELECT COUNT(DISTINCT salary) FROM emp WHERE salary…
High availability: Database servers can work together to allow a second server to take over quickly if the primary server fails. Load balancing: To allow several computers to serve the…
Create Database: -> A database is a named collection of SQL objects (“database objects”). Generally, every database object (tables, functions, etc.) belongs to one and only one database. -> The…
-> A role can be thought of as either a database user, or a group of database users, depending on how the role is set up. -> Roles can own…
To list all the users: cmd:cat /etc/passwd To delete the user in linux: -> we can able to delete the users from ther root user or sudo user. cmd:deluser user_name…
listen_addresses (string) -> Specifies the TCP/IP address(es) on which the server is to listen for connections from client applications. -> The special entry ‘*’ corresponds to all available IP interfaces.…
-> To rename already existing table Syntax: ALTER TABLE table_name RENAME to new_table_name; Eg: Alter table attribute rename to attribute1; -> To rename a column in table ALTER TABLE attribute…
-> If we want to retrun boolean value from the query or more than one result based on the condition then we can use case in postgresql. We can use…
-> To truncate the instance table locks i.e. when one user locked the object and the user wants to lock the same object then dead lock condition occurs. At that…
Constraints: ->Constraints are the rules enforced on data columns on table. -> These are used to prevent invalid data from being entered into the database. This ensures the accuracy and…