Home
Flashcards
Preview
MySQL Functions (4&5&6)
Home
Get App
Take Quiz
Create
get the current date
select now();
convert a date to days function
to_days('1999-10-09');
Get the month from a date function
select month('1999-10-09');
Get a day from a date function
select dayofmonth('1999-10-09');
get the year function
select year('1999-10-09');
Redefine a label or title in a query
With the "as" keyword select month('1999-10-09') as month,
place something into the database requires what format?
insert into
tableName
values (
value1,value2
);
Delete a line
delete from
tablename
where
arguement.
rename a table...there are two sections of keywords.
alter table
tablename
rename as
tablenamenew;
change a data type of an existing column
alter table
tablename
modify
column datatype.
If you want to insert a new column in the front of all the existing columns in a table
use first as in "
alter table
officeproducts
add
columnname
text first
how fo you add another column after an existing one?
use the "after" keyword as in "alter table
tableName
add
newcolumname
after
currentcolumnanme
"
delete a column
drop columnName as in "alter table
tablename
drop
columnName;"
add a column
use the add keyword as in "alter
tablename
add
columntobeadded columndatatype"
delete a table
drop table
tablename
create a table
create table
tablename (column1 column1datatype, etc)
Author
dalbabes
ID
31015
Card Set
MySQL Functions (4&5&6)
Description
Oreilly lesson 4&5
Updated
2012-07-26T16:17:15Z
Show Answers
Home
Flashcards
Preview