Table Create in SQL and How insert data into table

 Table Create in SQL and How insert data into table


In Sql you can use as editor of code notepad,notepad++ etc. Another way is you can directly type code in comand prompt or sql command line.

we can use notepad open notpad and save file as it is which is table name like your table is "DEPT"

if you not idea about show ss in below:
double qutoes"file name"and .sql extension.

now type in notepad given code:

                                                            create table DEPT
                                                            (
                                                            DEPTNO number(2),
                                                            DNAME varchar2(14),
                                                            LOC varchar2(13)
                                                            );
code is end here.
You can directly paste this code on sql RUN COMMAND LINE and enter. if need to make table permanently save table so after table create enter COMMIT; command with semicolon.

Above table is create  without constraint.we can see another post.Now here we can see how to display created table non commad prompt or sql  run command line.

Using cmd prompt enter in cmd and type "SQLPLUS" enter and ask you to enter USERNAME AND PASSWORD.during installation set password by you enter.
Here i enter USERNAME=> SYSTEM and PASSWORD=>ORACLE and enter.
You can understand following below image:






Now display table table creation.

in prompt  this command write SELECT * FROM DEP;   and enter if you not insert any type of data so its look like it in below image


DESC is describe table struture it use when you not insert any data into table.                                                   



Comments

Popular posts from this blog

SQL plus and Get Started With Oracle Database 11g Express Edition