• +91 9723535972
  • info@interviewmaterial.com

My SQL Interview Questions and Answers

Question - MySQL Extensions to ANSI SQL92?

Answer - MySQL includes some extensions that you probably will not find in other SQL databases. Be warned that if you use them, your code will not be portable to other SQL servers. In some cases, you can write code that includes MySQL extensions, but is still portable, by using comments of the form /*! ... */. In this case, MySQL will parse and execute the code within the comment as it would any other MySQL statement, but other SQL servers will ignore the extensions. For example: SELECT /*! STRAIGHT_JOIN */ col_name FROM table1,table2 WHERE ... If you add a version number after the '!', the syntax will only be executed if the MySQL version is equal to or newer than the used version number: CREATE /*!32302 TEMPORARY */ TABLE (a int); The above means that if you have Version 3.23.02 or newer, then MySQL will use the TEMPORARY keyword. MySQL extensions are listed below: The field types MEDIUMINT, SET, ENUM, and the different BLOB and TEXT types. The field attributes AUTO_INCREMENT, BINARY, NULL, UNSIGNED, and ZEROFILL. All string comparisons are case insensitive by default, with sort ordering determined by the current character set (ISO-8859-1 Latin1 by default). If you don't like this, you should declare your columns with the BINARY attribute or use the BINARY cast, which causes comparisons to be done according to the ASCII order used on the MySQL server host. MySQL maps each database to a directory under the MySQL data directory, and tables within a database to filenames in the database directory. This has a few implications: Database names and table names are case sensitive in MySQL on operating systems that have case-sensitive filenames (like most Unix systems). Database, table, index, column, or alias names may begin with a digit (but may not consist solely of digits). You can use standard system commands to backup, rename, move, delete, and copy tables. For example, to rename a table, rename the `.MYD', `.MYI', and `.frm' files to which the table corresponds. In SQL statements, you can access tables from different databases with the db_name.tbl_name syntax. Some SQL servers provide the same functionality but call this User space. MySQL doesn't support tablespaces as in: create table ral

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners