Jump to content

The choice to make in creating a table


ucsiq
 Share

Recommended Posts

I will like you guys to educate me more on creating a table for an organisation, which of the sql syntax will i use and whch is preferable, for example, This is just an Ordinary Table Creationcreate table employee(empCode int identity (100,1) not null,empNme char(10) not null,empCtychar(10)not null,empAdr varchar(50)not null,empPhone char(15)null)Should i add VIEW to this and STORE PROCEDURE, How can i do this?what actually can i do with this table in term of adding security and make it more a little bit complex.

Link to comment
Share on other sites

As far as the table goes, CREATE TABLE will do, unless for some reason the table will be deleted as part of normal datbase operation in which case making it a SP may save time. Making the empCode column PRIMARY KEY and AUTO_INCREMENT would help database organisation and efficiency, especially when searching, although you can't do this if the employees already have codes pre-table creation. There is not mush security-wise in the table itself, that comes in at the database's point of access (from a script or otherwise). Remember to put spaces!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...