Can different databases use different name quotes?

0 votes

Consider a MySQL quote table name using

SELECT * FROM `table_name`;

notice the single quotes

Now, can any other database ever use different char to quote their table name?

Sep 11, 2018 in Database by darklord
• 6,170 points
37 views

1 answer to this question.

0 votes

This use of quotes is called delimited identifiers. It's an important part of SQL because otherwise, you can't use identifiers (e.g. table names and column names) that:

  • Include whitespace: "my table"
  • Include special characters and punctuation: "my-table"
  • Include international characters: "私のテーブル"
  • Are case-sensitive: "MyTable"
  • Match SQL keywords: "table"

The standard SQL language uses double-quotes for delimited identifiers:

SELECT * FROM "my table";

MySQL uses back-quotes by default. MySQL can use standard double-quotes:

SELECT * FROM `my table`;
SET GLOBAL SQL_MODE=ANSI_QUOTES;
SELECT * FROM "my table";

Microsoft SQL Server uses brackets by default. Microsoft can use standard double-quotes:

SELECT * FROM [my table];
SET QUOTED_IDENTIFIER ON;
SELECT * FROM "my table";

InterBase and Firebird need to set the SQL dialect to 3 to support delimited identifiers.

Most other brands of database use double-quotes correctly.

answered Sep 11, 2018 by CodingByHeart77
• 3,690 points

Related Questions In Database

0 votes
1 answer

What are the different authentication modes in SQL Server? How can it be changed?

Windows mode and Mixed Mode – SQL ...READ MORE

answered Oct 29, 2018 in Database by darklord
• 6,170 points
77 views
0 votes
1 answer

How can I change my existing database name?

Hey Partha, I understand your problem, I think this ...READ MORE

answered Jul 4 in Database by sampriti
• 1,100 points
34 views
0 votes
1 answer

Why is not preferable to use mysql_* functions in PHP?

The reasons are as follows: The MySQL extension: Does ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,130 points
60 views
0 votes
1 answer

Different types of SQL Joins

The 4 main kinds of Joins present ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,130 points
164 views
0 votes
1 answer

How to connect Java program to the MySQL database?

You can connect your Java code with ...READ MORE

answered May 11, 2018 in Java by parth295
• 4,640 points
213 views
0 votes
1 answer

Is SELECT * harmful in Database?

There are really three major reasons: Inefficiency in ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,130 points
52 views
0 votes
1 answer

Write a SQL query to find the names of employees that begin with ‘S’

To display the name of the employees ...READ MORE

answered Sep 26, 2018 in Database by darklord
• 6,170 points
55 views
0 votes
1 answer

What is the SQL query to get the third highest salary of an employee from employee_table

You can try out something like this: SELECT ...READ MORE

answered Sep 26, 2018 in Database by darklord
• 6,170 points
481 views
0 votes
1 answer

Difference between single and double quotes in SQL

Single quotes are used to indicate the ...READ MORE

answered Sep 11, 2018 in Database by CodingByHeart77
• 3,690 points
97 views