MySQL

download

Basic Fundamentals

Date Functions

  • CURDATE() – return current date
  • CURRENT DATE() – return current date
  • CURRENT TIME() – return current date

List of Database

SHOW DATABASES;

Current Database

SELECT DATABASE();


MySQL has six distinct table types.

  • MYISAM
  • MERGE
  • ISAM
  • HEAP
  • INNODB
  • BDB

Default type of MySQL is MYISAM.


Difference between MYISAM and InnoDB.

The main Difference is InnoDB support transactions. you can do commit and rollback in InnoDB where as in MYISAM doesn’t support transaction once issue command can’t rollback.

MYISAM  does table locking  where as InnoDB do row locking. if your App does lots of data modification then InnoDB is best and Faster.


Types of PL/SQL trigger

  • Row level trigger
  • Statement level trigger

1) Row level Trigger : An event is triggered for each row updated, inserted and deleted.

2) Statement level Trigger : An event is triggered for each SQL statement executed.


what is max length for dbname, tablename, and fieldname?

ans: 64


For value 0/1 which datatype is used ?

ans: tinyINT


Difference between two date ?

select DATEDIFF(NOW(), ’2006-07-01′);

Basic Fundamentals

Date Functions

  • CURDATE() – return current date
  • CURRENT DATE() – return current date
  • CURRENT TIME() – return current date

List of Database

SHOW DATABASES;

Current Database

SELECT DATABASE();


MySQL has six distinct table types.

  • MYISAM
  • MERGE
  • ISAM
  • HEAP
  • INNODB
  • BDB

Default type of MySQL is MYISAM.


Difference between MYISAM and InnoDB.

The main Difference is InnoDB support transactions. you can do commit and rollback in InnoDB where as in MYISAM doesn’t support transaction once issue command can’t rollback.

MYISAM  does table locking  where as InnoDB do row locking. if your App does lots of data modification then InnoDB is best and Faster.


Types of PL/SQL trigger

  • Row level trigger
  • Statement level trigger

1) Row level Trigger : An event is triggered for each row updated, inserted and deleted.

2) Statement level Trigger : An event is triggered for each SQL statement executed.


what is max length for dbname, tablename, and fieldname?

ans: 64


For value 0/1 which datatype is used ?

ans: tinyINT


Difference between two date ?

select DATEDIFF(NOW(), ’2006-07-01′);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s