Gautam Sarswat

Asked a question
What is a Foreign Key in SQL?

When a "one" table's primary key field is added to a related "many" table in order to create the common field which relates the two tables, it is called a foreign key in the "many" table.

January 11, 2023 2
Asked a question
What is a primary key in SQL?

A primary key is a column whose values uniquely identify every row in a table. Primary key values can never be reused. If a row is deleted from the table, its primary key may not be assigned to any new…

January 11, 2023 2
Asked a question
What are properties of a transaction in SQL?

Properties of the transaction can be summarized as ACID Properties. 1. Atomicity A transaction consists of many steps. When all the steps in a transaction gets completed, it will get reflected in DB or…

January 11, 2023 2
Asked a question
What are Primary Keys and Foreign Keys in SQL?

Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental aspect of…

January 11, 2023 2
Asked a question
What is a stored procedure in SQL?

A stored procedure is like a function that contains a set of operations compiled together. It contains a set of operations that are commonly used in an application to do some common database tasks.

January 11, 2023 2
Asked a question
What is a Trigger in SQL?

A Trigger is a code that associated with insert, update or delete operations. The code is executed automatically whenever the associated query is executed on a table. Triggers can be useful to maintain…

January 11, 2023 2
Asked a question
What are the uses of view in SQL?

1. Views can represent a subset of the data contained in a table; consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to…

January 11, 2023 2
Asked a question
What is a view in SQL?

A view is a virtual table based on the result-set of an SQL statement. We can create using create view syntax. CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition

January 11, 2023 2
Asked a question
What is the difference between primary key and unique constraints in SQL?

Primary key cannot have NULL value, the unique constraints can have NULL values. There is only one primary key in a table, but there can be multiple unique constrains.

January 11, 2023 2
Asked a question
What are super, primary, candidate and foreign keys in SQL?

A super key is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes. A Candidate key…

January 11, 2023 2
Asked a question
What is the difference between a โ€œLocal Temporary Tableโ€ and โ€œGlobal Temporary Tableโ€ in SQL?

1. A Local Temporary Table is created by giving it a prefix of # whereas a Global Temporary Table is created by giving it a prefix of ##. 2. A Local Temporary Table cannot be shared among multiple users…

January 11, 2023 2
Asked a question
What is the difference between โ€œPrimary Keyโ€ and โ€œUnique Keyโ€?

1. We can have only one Primary Key in a table whereas we can have more than one Unique Key in a table. 2. The Primary Key cannot have a NULL value whereas a Unique Key may have only one null value. 3….

January 11, 2023 2
Asked a question
What is the difference between the โ€œWHEREโ€ clause and the โ€œHAVINGโ€ clause?

1. WHERE clause can be used with a Select, Update and Delete Statement Clause but the HAVING clause can be used only with a Select statement. 2. We can't use an aggregate functions in the WHERE clause…

January 11, 2023 2
Asked a question
What is the difference between the โ€œDELETEโ€ and โ€œTRUNCATEโ€ commands?

1. The DELETE command is used to remove rows from a table based on a WHERE condition whereas TRUNCATE removes all rows from a table. 2. So we can use a where clause with DELETE to filter and delete specific…

January 11, 2023 2
Asked a question
What is the difference between having and where clause?

HAVING is used to specify a condition for a group or an aggregate function used in select statement. The WHERE clause selects before grouping. The HAVING clause selects rows after grouping. Unlike HAVING…

January 11, 2023 2
Asked a question
What are the differences between DDL, DML and DCL in SQL?

DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP and RENAME come under this. DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT and UPDATE come under…

January 11, 2023 2
Received an upvote
January 11, 2023 10
Asked a question
What is SQL?

SQL is Structured Query Language designed for inserting and modifying in a relational database management system

January 11, 2023 2
Asked a question
What is difference between โ€œClustered Indexโ€ and โ€œNon Clustered Indexโ€?

A Clustered Index physically stores the data of the table in the order of the keys values and the data is resorted every time whenever a new value is inserted or a value is updated in the column on which…

January 11, 2023 2
Posted an answer
What is the difference between Stored Procedure and Function?

1. A procedure can have both input and output parameters, but a function can only have input parameters. 2. Inside a procedure we can use DML (INSERT/UPDATE/DELETE) statements. But inside a function we…

January 11, 2023 5
Load More