Home » SQL

How can I see all tables in SQL?

Published on 14-Dec-2021 17:13:39
Different database management systems have different queries to see all the tables. To see all the tables in MYSQL, we would have to use this query: show tables; This is how we can see all tables in ORACLE: SELECT table_name FROM User_tables; This is how we can extract all tables in SQL Server: SELECT * FROM Information_schema.tables; ... Read More

What is PL/SQL ?

Published on 14-Dec-2021 17:09:39
PL SQL stands for Procedural language constructs for Structured Query Language. PL SQL was introduced by Oracle to overcome the limitations of plain sql. So, pl sql adds in procedural language approach to the plain vanilla sql. One thing to be noted over here is that pl sql is only for oracle databases. If you don’t have an Oracle database, then you cant work with PL SQL. While, with the help of sql, we were able to DDL and DML queries, w... Read More

How do I view tables in SQL ?

Published on 14-Dec-2021 17:07:50
To view tables in SQL, all you need to do is give this command: Show tables; ... Read More

What is Primary Key in SQL ?

Published on 14-Dec-2021 17:04:38
Primary Key is a constraint in SQL. So, before understanding what exactly is a primary key, let’s understand what exactly is a constraint in SQL. Constraints are the rules enforced on data columns on a table. These are used to limit the type of data that can go into a table. Constraints can either be column level or table level. Let’s look at the different types of constraints which are present in SQL: Constraint Description ... Read More

How to insert date in SQL ?

Published on 14-Dec-2021 16:59:11
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 More

What is SQL server ?

Published 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 categor... Read More

What is join in SQL ?

Published on 14-Dec-2021 16:51:44
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 w... Read More

What is Normalization in SQL ?

Published 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 rela... Read More

How to create a database in SQL?

Published 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 More

How to delete a row in SQL ?

Published on 12-Dec-2021 20:58:57
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 ... Read More