CREATE VIEW <View_Name>
CREATE VIEW v_users_without_critical_data
SELECT s.email,s.Id,s.userName FROM Users s
Yes, you heard it right. We can update/Insert/Delete the records of the table through view. Below are some restriction to it.
have you ever faced slowness while fetching the records in the SQL. If yes, then you are at the right place 😉. First let’s understand the reason behind it.
So at the beginning of any project each table has small amounts of data and when we retrieve the data we don’t feel slowness. But when the project is very big and most of the tables store thousands of records then query execution will be slow if the table is not indexed. …
You will learn :-
1) Types of data type
2) primitive data types
3) non-primitive data types
4) difference between all the data types.
Prerequisites:- basics of programming.
Data type:- Data type provides the information about the value which is being stored in the variable.
There are two types of data type…
The count is used in SQL to return number of rows from Result Set.
Syntax with SELECT STATEMENT :-
SELECT COUNT(EXPRESSION) FROM TABLE_NAME;
Syntax with GROUP BY CLAUSE :-
SELECT COLUMN_NAME,COUNT(EXPRESSION) FROM TABLE_NAME GROUP BY COLUMN_NAME HAVING COUNT(EXPRESSION) RELATIONAL_OPERATOR VALUE;
We can put three type expressions in Count() and all of them have their different-different meaning:
COUNT(*) counts all the values including null values rows.
emid ename cmpny
NULL NULL 0
NULL NULL 0
NULL NULL 0
Explanation:- Now it is visible that count(*) includes null values as well as…
Variable is used to store the value in the physical memory.
Whenever we create the variable some physical memory gets allocated to it.
Declaring and defining the variable at the same time:
We can declare and give the value to the variable at the same line.
Only declaring and defining in another line:
We can declare variable in one line and give the value to the variable at somewhere else in the programe but after declaration.
Have you ever thought why do we use truncate and delete if both the statements just remove the records?
We will discuss this in our todays topic as how internally they are different from each other. First let’s understand the basics of both the statements.
TRUNCATE TABLE <TABLE_NAME>;
Let’s start with first point
Thank you please follow me
|| operator is used to assign the value if there is no value assigned to it.
var vr1 ;
var vr2=vr1 || ‘some value’;
In above example if vr1 is not value then ‘some value' string value will be assigned to vr2.