Mysql Fun

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Mysql Fun - Presentation Transcript

    1. * ABS(X) Returns the absolute value of X. Mathematical Functions SELECT ABS(-32); 32 * CEIL(X) CEIL() is a synonym for CEILING(). SELECT CEILING(1.23); 2
    2. * MOD() also works on values that have a fractional part and returns the exact remainder after division: SELECT MOD(34.5,3); 1.5 * PI() Returns the value of π (pi). SELECT PI(); 3.141593
    3. * POW(X,Y) Returns the value of X raised to the power of Y. SELECT POW(2,2); 4 * SQRT(X) Returns the square root of a nonnegative number X. SELECT SQRT(4); 2
    4. * FLOOR(X) Returns the largest integer value not greater than X. SELECT FLOOR(1.23); 1 * POWER(X,Y) This is a synonym for POW().
    5. * COT(X) Returns the cotangent of X. SELECT COT(12); -1.5726734063977 * COS(X) Returns the cosine of X, where X is given in radians. SELECT COS(PI()); -1
    6. ADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days) When invoked with the INTERVAL form of the second argument, ADDDATE() is a synonym for DATE_ADD(). The related function SUBDATE() is a synonym for DATE_SUB(). For information on the INTERVAL unit argument, see the discussion for DATE_ADD(). SELECT DATE_ADD('2008-01-02', INTERVAL 31 DAY); '2008-02-02' SELECT ADDDATE('2008-01-02', INTERVAL 31 DAY); '2008-02-02' Date and Time Functions
    7. * CURDATE() Returns the current date as a value in 'YYYY-MM-DD' SELECT CURDATE(); '2008-06-13' * CURTIME() Returns the current time as a value in 'HH:MM:SS' SELECT CURTIME(); '23:50:26'
    8. * DATEDIFF(expr1,expr2) DATEDIFF() returns expr1 – expr2 expressed as a value in days from one date to the other. expr1 and expr2 are date or date-and-time expressions. Only the date parts of the values are used in the calculation. SELECT DATEDIFF('2007-12-31 23:59:59','2007-12-30'); 1
    9. NOW() Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS' SELECT NOW(); '2007-12-15 23:50:26' SECOND(time) Returns the second for time, in the range 0 to 59. SELECT SECOND('10:05:03');
    10. * YEAR(date) Returns the year for date, in the range 1000 to 9999, or 0 for the “zero” date. SELECT YEAR('1987-01-01'); 1987 * MINUTE(time) Returns the minute for time, in the range 0 to 59. SELECT MINUTE('2008-02-03 10:05:03'); 5
      • The Main Features of MySQL
      • Internals and Portability:
      • Written in C and C++.
      • Tested with a broad range of different compilers.
      • Cross-platform support
      • Triggers
      • Cursors
      • Data Types:
      • Many data types: signed/unsigned integers 1, 2, 3, 4, and 8 bytes long, FLOAT, DOUBLE,
      • CHAR, VARCHAR, BINARY, VARBINARY, TEXT, BLOB, DATE, TIME, DATETIME, TIMESTAMP, YEAR, SET, ENUM
      • True Varchar support
      • Statements and Functions:
      • Full operator and function support in the SELECT list and WHERE clause of queries.
      • Full support for SQL GROUP BY and ORDER BY clauses. Support for group functions (COUNT(), AVG(), STD(), SUM(), MAX(), MIN(), and GROUP_CONCAT()).
      • Support for LEFT OUTER JOIN and RIGHT OUTER JOIN with both standard SQL and ODBC syntax.
      • Support for aliases on tables and columns as required by standard SQL.
      • Support for DELETE, INSERT, REPLACE, and UPDATE to return the number of rows that were changed (affected), or to return the number of rows matched instead by setting a flag when connecting to the server.
      • Security:
      • A privilege and password system that is very flexible and secure, and that allows host-based verification.
      • Password security by encryption of all password traffic when you connect to a server.
      • Scalability and Limits:
      • Support for large databases. We use MySQL Server with databases that contain 50 million records. We also know of users who use MySQL Server with 200,000 tables and about 5,000,000,000 rows.
      • Connectivity:
      • Clients can connect to MySQL Server using several protocols:
      • Clients can connect using TCP/IP sockets on any platform.
      • MySQL client programs can be written in many languages. A client library written in C is available for clients written in C or C++.
      • APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are available, allowing MySQL clients to be written in many languages
      • Storage Engines
      • MyISAM
      • The default MySQL storage engine and the one that is used the most in Web, data warehousing, and other application environments.
      • InnoDB
      • A transaction-safe storage engine for MySQL that has commit, rollback, and crash-recovery capabilities to protect user data. InnoDB row-level locking (without escalation to coarser granularity locks) and Oracle-style consistent nonlocking reads increase multi-user concurrency and performance. InnoDB stores user data in clustered indexes to reduce I/O for common queries based on primary keys. To maintain data integrity,
      • InnoDB also supports FOREIGN KEY referential-integrity constraints.
    11. Memory Stores all data in RAM for extremely fast access in environments that require quick lookups of reference and other like data. CSV The CSV storage engine stores data in text files using comma-separated values format.You can use the CSV engine to easily exchange data between other software and applications that can import and export in CSV format. Blackhole The Blackhole storage engine accepts but does not store data and retrievals always return an empty set. The functionality can be used in distributed database design where data is automatically replicated, but not stored locally.
    SlideShare Zeitgeist 2009

    + SHCSHC Nominate

    custom

    123 views, 0 favs, 0 embeds more stats

    Here is the list of all important MySQL functions. more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 123
      • 123 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 1
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories