What is Primary Key in SQL ?

Updated on 24-Jul-2023 17:44:20
Introduction :  In the world of databases, a primary key is a fundamental concept that plays a crucial role in maintaining data integrity and ensuring efficient data retrieval. It is a concept that is essential for anyone working with relational databases and forms the backbone of their structure. In this article, we will delve into the definition of a primary key, explore its examples, understand its significance, and learn how to choose and implement it effectively. Definition of Primary ... Read Mores

How to insert date in SQL ?

Updated on 14-Dec-2021 17:00:30
If the RDBMS is MYSQL, this is how we can insert date: INSERT INTO tablename (col_name, col_date) VALUES (‘DATE: Manual Date’, ‘2020-9-10’); ... Read Mores

Advertisements

Google Image
Updated on 16-Oct-2001 12:00:00

What is SQL server ?

Updated on 14-Dec-2021 16:57:09
To understand what exactly is SQL Server, we need to understand what is DBMS and RDBMS. DBMS stands for Database Management System. When we have a huge database with us, we would need a proper management system which would help us organise this database.  There are 4 types of database management systems: Hierarchical Network Relational Object-Oriented. Out of these database management systems, SQL Server comes under the category of Relational database management system.  A re... Read Mores

What is join in SQL ?

Updated on 14-Dec-2021 16:53:29
Joins are used to combine rows from two or more tables, based on a related column between them. Types of Joins: • INNER JOIN − Returns rows when there is a match in both tables. • LEFT JOIN − Returns all rows from the left table, even if there are no matches in the right table. • RIGHT JOIN − Returns all rows from the right table, even if there are no matches in the left table. • FULL OUTER JOIN − Returns rows when there is a match in one of the tables. • ... Read Mores

Advertisements

Google Image
Updated on 16-Oct-2001 12:00:00

What is Normalization in SQL ?

SQL
Updated on 14-Dec-2021 16:47:00
Normalization is used to decompose a larger, complex table into simple and smaller ones. This helps us in removing all the redundant data. Generally, in a table, we will have a lot of redundant information which is not required, so it is better to divide this complex table into multiple smaller tables which contains only unique information. First normal form: A relation schema is in 1NF, if and only if : – All attributes in the relation are atomic(indivisible value) - And there ... Read Mores

How to create a database in SQL?

SQL
Updated on 14-Dec-2021 16:43:51
A database is a repository in sql, which can comprise of multiple tables. This will be the command to create a database in sql: CREATE DATABASE database_name. ... Read Mores

Advertisements

Google Image
Updated on 16-Oct-2001 12:00:00

How to delete a row in SQL ?

Updated on 12-Dec-2021 20:59:46
We will be using the DELETE query to delete existing rows from the table: DELETE FROM table_name WHERE [condition]; We will start off by giving the keywords DELETE FROM, then we will give the name of the table, after that we will give the WHERE clause and give the condition on the basis of which we would want to delete a row. For example, from the employee table, if we would like to delete all the rows, where the age of the employee is equal to 25, then this will the command: DELETE... Read Mores

How to change a table name in SQL ?

Updated on 12-Dec-2021 20:55:05
This is the command to change a table name in SQL: ALTER TABLE table_name RENAME TO new_table_name; We will start off by giving the keywords ALTER TABLE, then we will follow it up by giving the original name of the table, after that, we will give in the keywords RENAME TO and finally, we will give the new table name. For example, if we want to change the “employee” table to “employee_information”, this will be the command: ALTER TABLE employee RENAME TO employee_information... Read Mores

Advertisements

Google Image
Updated on 16-Oct-2001 12:00:00

How to delete a table in SQL ?

Updated on 12-Dec-2021 20:41:30
There are two ways to delete a table from sql: DROP and TRUNCATE. The DROP TABLE command is used to completely delete the table from the database. This is the command: DROP TABLE table_name; The above command will completely delete all the data present in the table along with the table itself. But if we want to delete only the data present in the table but not the table itself, then we will use the truncate command: DROP TABLE table_name ; ... Read Mores
Advertisements

ads