What are DDL and DML?

The following is adapted from here MySQL What is DDL, DML and DCL?: DDL DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database. CREATE – to create database and its objects like (table, index, views, store procedure, function and triggers). … Read more

How to select the nth row in a SQL database table?

There are ways of doing this in optional parts of the standard, but a lot of databases support their own way of doing it. A really good site that talks about this and other things is http://troels.arvin.dk/db/rdbms/#select-limit. Basically, PostgreSQL and MySQL supports the non-standard: SELECT… LIMIT y OFFSET x Oracle, DB2 and MSSQL supports the … Read more

Explicit vs implicit SQL joins

Performance wise, they are exactly the same (at least in SQL Server). PS: Be aware that the IMPLICIT OUTER JOIN syntax is deprecated since SQL Server 2005. (The IMPLICIT INNER JOIN syntax as used in the question is still supported) Deprecation of “Old Style” JOIN Syntax: Only A Partial Thing

What is the meaning of the prefix N in T-SQL statements and when should I use it?

It’s declaring the string as nvarchar data type, rather than varchar You may have seen Transact-SQL code that passes strings around using an N prefix. This denotes that the subsequent string is in Unicode (the N actually stands for National language character set). Which means that you are passing an NCHAR, NVARCHAR or NTEXT value, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)