We often encounter terms like DDL, DML, DQL, DCL, and TCL when using relational database management systems (RDBMSs). But what do they mean?
In this article we’ll look at what DDL stands for and what it does.
We often encounter terms like DDL, DML, DQL, DCL, and TCL when using relational database management systems (RDBMSs). But what do they mean?
In this article we’ll look at what DDL stands for and what it does.
In MySQL, CONVERT() is a built in function that converts a value to another data type. It takes a value of one type and returns a value of the specified type.
We provide the value as an argument when we call the function, as well as the type that we want it converted to.
The CONVERT() function is similar to the CAST() function, which also converts between data types.
When creating a sequence object in SQL Server, the default data type is bigint. However, we can change this so that the sequence uses a data type of our choosing, as long as it’s an integer type (see below for accepted data types).
We can set the data type of a sequence by using the AS argument when defining the sequence.
If you get an error that reads “WRONGTYPE Operation against a key holding the wrong kind of value” when using the ZSCORE command in Redis, it’s because you’re passing a key with the wrong data type.
To fix this issue, make sure that you pass a sorted set to the ZSCORE command.
In MySQL, ROW_COUNT() is a built-in function that returns the number of rows updated, inserted, or deleted by the preceding statement.
The value returned by ROW_COUNT() is often the same as the row count that the mysql client displays following statement execution, as well as the value from the mysql_affected_rows() C API function.
The SQLite changes() function returns the number of database rows that were changed, inserted or deleted by the most recently completed INSERT, DELETE, or UPDATE statement, exclusive of statements in lower-level triggers.
Basically, it allows us to see how many rows are affected when we run any of those statements.
The integer data type is probably one of the more common data types when working with database management systems (and with computing in general). The integer is a numeric data type that allows us to store certain kinds of numbers.
More specifically, an integer is the number zero (0), a positive natural number (e.g. 1, 2, 3, …) or a negative integer with a minus sign (e.g. −1, −2, −3, …). Integers contain no decimal or fractional part.
However, many computing environments distinguish between signed integers and unsigned integers.
Let’s take a look at the difference between signed integers and unsigned integers.
In MySQL, FORMAT_BYTES() is a built in function that converts a numeric byte count to a more human-readable format. It returns a string consisting of the value and a units indicator.
We provide the numeric byte count when we call the function.
If you’re getting error number 1064 that reads something like “1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘INTEGER )’ at line 1“, it could be that you’re using the wrong term for the integer.
MySQL doesn’t let us use just the INTEGER keyword when converting to an integer. We need to use either SIGNED or UNSIGNED, optionally followed by INTEGER or INT. When we do this, it produces a signed or unsigned BIGINT value.