Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Domain in MySQL

Tags:

mysql

Please help me to create domain in MySQL. I have tried to run the followoing statement in MySQL but got syntax error:

create domain age as int(2); 
like image 554
hovkar Avatar asked Nov 07 '09 18:11

hovkar


People also ask

What is domain in database?

Domains are data type definitions that resolve to a primitive data type or another domain. In relational database terminology, a domain defines the permitted range of values for an attribute of an entity.

What are domains in SQL environment?

The SQL-92 standard supports a variety of built-in domain types: char(n) (or character(n)): fixed-length character string, with user-specified length. varchar(n) (or character varying): variable-length character string, with user-specified maximum length. int or integer: an integer (length is machine-dependent).


2 Answers

MySQL doesn't support user-defined domains, so it is not possible to run a CREATE DOMAIN statement.

like image 52
Phil Ross Avatar answered Sep 19 '22 04:09

Phil Ross


Your syntax is not ok. I don't think that CREATE DOMAIN is supported by MySQL.

like image 33
mRt Avatar answered Sep 20 '22 04:09

mRt