Administrator-Account-0165811/: 2.data Definition Language
Administrator-Account-0165811/: 2.data Definition Language
com/forum/whats-difference-between-root-and-
administrator-account-0165811/
root account is created automatically by mysql and is a log on that is the most powerful user in the
system
used when we have to do super administrative tasks. Bcz it has all permission to do anything
2. database schema
is basically a database diagram showing us what tables are in our database and it's showing us
relationships and other information within our database.
So this database schema is very useful for seeing what tables you've created what database you've
created And more information on the tables here.
FLOAT(M,D)
Because this can hold a value which is more than 24 which is more than 99.99 hours.
So if two events took place more than 100 hours between then you can use the time data type.
TRUNCATE TABLE tablename;
basically what the truncate table statement is doing is dropping the table from the database or
deleting the test table from the example database and then creating a table again.
So it's running a drop table test and then it's running a create table test with the earlier columns
ALTER
when you drop a primary key column in a table it's not going to change the fact of
whether it can accept null values. It's still going to be set to No(null--no)
CONSTRAINT
A constraint is something which is applied to table columns which restricts what kind of data can
be entered into that column. Constraints include:
When we create a foreign key we are creating a constraint on that particular column and we can
name that constraint.
If we want to remove the foreign key, and therefore remove the constraint, we can use the
constraint name to delete it.
So we basically says that particular column is used to that particular purpose only
https://stackoverflow.com/questions/12652629/differences-between-foreign-key-and-constraint-
foreign-key
The first one assigns a user-defined name to the foreign key, the second one will assign
a system-generated name to the foreign key.
User-defined foreign key names can be useful for subsequent statements like these:
https://stackoverflow.com/questions/310561/mysql-terminology-constraints-vs-foreign-
keys-difference
https://stackoverflow.com/questions/16785561/what-is-the-difference-between-adding-
column-as-foreign-key-and-as-a-constraint
https://stackoverflow.com/questions/20473855/constraint-symbol-vs-foreign-key-index-
name-whats-the-difference imp
https://dba.stackexchange.com/questions/171434/when-creating-primary-and-foreign-
keys-is-the-constraint-keyword-optional
unique constraint
a column with a unique constraint applied to it means that it won't accept any duplicate
SELECT*FROM table_name;
selects from a table does it returns all the columns and all
'To alter' is generally to change something in a way that some of the original is
retained. Also alter implies an agent making the change.
https://www.quora.com/Could-anyone-tell-me-the-difference-between-alter-
change-switch-and-modify plz refer
3. 'To alter' is generally to change something in a way that some of the original is
retained. Also alter implies an agent making the change.
4.switch:
Change' in this sense means to alter or to discard in favour of another option. 'Switch'
implies to me that you are going to replace the item with another one and know what
the replacement will be. 'Switch' can also have the meaning of 'transpose'.
I need to change that lightbulb in the kitchen because it’s not working any more. I
haven’t got a new one so until I can get one, I’m going to switch it with the one in the
spare room that I don’t use very much.
To change and to switch out could be used interchangeably. But when using 'to change' you don't
necessarily have an idea of what is being changed to, whereas with 'to switch out' you are exchanging
something for something else.
Switch usually is a more specific exchange between two things whereas change is more general. You
can change your mind but you can never switch your mind because there is nothing to exchange it
with.
In this example because the addresses table has no rows of data in it it's an empty
table. But let's say we already had some data entered into our addresses table let's say
in the city column we already had some data entered like London Manchester or
Liverpool. Then if we try to modify the city's data type from VARCHAR(20) to INT It
wouldn't allow us to do this because the data that's already been entered is not
compatible with the data type. London is not an INT so we can't change the city data
type to an end. Simply we wouldn't be able to change it to a char because London
Manchester Liverpool have different lengths so we could have no CHAR with that
fixed length to satisfy London Manchester and LiverpoolR But we were able to
change the data type from VARCHAR(20) to 40 or 30 because London Manchester
and Liverpool are all compatible with VARCHAR( 20) VARCHAR (30) data type.
DDL was concerned with creating tables and now DML is concerned with inserting
data into those tables.
https://stackoverflow.com/questions/11448068/mysql-error-code-1175-during-update-in-mysql-
workbench before executing error query plz Query Menu -> Reconnect to Server
Delete and remove are defined quite similarly, but the main difference between them
is that delete means erase (i.e. rendered nonexistent or nonrecoverable), while
remove connotes take away and set aside (but kept in existence). In your example, if
the item is existent after the removal, just say remove, but if it ceases to exist, say
delete. As a side note: delete is sometimes used of computer files to mean move to
trash/recycle bin (hence it is still recoverable), but that's not a standard meaning
outside of that context.
insql server
DROP will delete all data and the table structure as well.
DELETE will delete the data but the table structure will remain the same and we can still
rollback the data. Also with DELETE you can use the where condition i.e. to delete only
certain records.
https://stackoverflow.com/questions/2452524/what-is-the-difference-between-drop-and-
delete-database
BETWEEN
https://stackoverflow.com/questions/4809083/between-clause-versus-and
https://stackoverflow.com/questions/1960801/why-use-the-between-operator-when-we-
can-do-without-it
https://softwareengineering.stackexchange.com/questions/160191/why-is-sqls-between-
inclusive-rather-than-half-open
LIKE ‘W%’ it is saying return words starting with w and any no of characters
% any no of characters
_ just one character
Sweaty----select-(choose)
Feet
Will----------restrict data
Horrible------
Odours—how can we order something before getting
restricted(where) data
Now in other databases There's also a full join or an outer join which will
retrieve all the data from table 1 and Table 2. It doesn't matter if there's
missing rows in the table. It would just retrieve all the data from table one