Professional Documents
Culture Documents
SQL Apnacollege Youtube
SQL Apnacollege Youtube
SQL Apnacollege Youtube
Here id , name can repeat individually but when combination of both occurs it will be unique.
This could be any name
Here the query will return an error because the no.of columns used in the select statement(except
aggregate columns) has to be in the group by (here the column name is missing in the group by).
Here where condition puts filter on grade whereas having condition puts condition ongroup by
column.
The complete picture
Set_sql_safe_updates=0;
This query is used to turn the safe mode off which is by default turned on in my sql from preventing
updating the table at first.
Eer diagram created by using the database->reverse engineer option
Alter means to change the schema or design(columns,datatypes,constraints), basically to add, drop
column and rename table.
1. To add a column.
Drop table command is used to delete the entire table completely whereas truncate command deletes
The data inside the table. You can still add the data inside the table.
In mysql there is no full outer join or outer join therefore we use UNION
Output:
Ex:
Step1
Step 2
For example: sales team want sales related data from a table/database which has large no of columns
and also data that is irrelevant/not required for them and also we want to restrict them from viewing all
the data for ex:( credit card numbers which is useful for accounts team). In this case we create views
which is a temporary /virtual table created from the original table.