Skip to content Skip to sidebar Skip to footer

Is There Any Iso Standard Of How To Write Sql Queries In Ddl?

I am doing my first database project. I would like to know which of the following ways should I use to make SQL queries in DDL. #1 CREATE TABLE employees ( id IN

Solution 1:

It doesn't really matter to the database, and so you should generally go for what's more readable and maintainable. There are a lot of different conventions out there, and I switch between them depending on circumstances all the time. Imo, what's good for a small query isn't the same as what's good for a more-complicated query.

In this case, I think your #3 looks most readable. But that's just my opinion and if there are conventions or existing expectations for how the code looks where you are, stick to that.

Solution 2:

Sql coding Convections suggest :

CREATETABLE employees
(   
id INTEGERPRIMARY KEY,
first_name CHAR(50) NULL,
last_name CHAR(75) NOTNULL,
dateofbirth DATENULL
);

Post a Comment for "Is There Any Iso Standard Of How To Write Sql Queries In Ddl?"