147k views
1 vote
What is DBMS?
create a table emp nd insert values


User Swizard
by
7.3k points

2 Answers

3 votes

Answer:

A database is a collection of related data which represents some aspect of the real world. A database system is designed to be built and populated with data for a certain task.

Step-by-step explanation:

Basic Syntax for CREATE

CREATE TABLE table_name

(

column1 datatype(size),

column2 datatype(size),

column3 datatype(size),

.....

columnN datatype(size),

PRIMARY KEY( one or more columns )

);

Example

create table emp(

empno number(4,0),

ename varchar2(10),

job varchar2(9),

mgr number(4,0),

hiredate date,

sal number(7,2),

deptno number(2,0)

PRIMARY KEY (ID)

);

Field Type Null Key Default Extra

EMPNO number(4,0) N0 PRI

ENAME varchar2(10) YES – NULL

JOB varchar2(9) NO – NULL

MGR number(4,0) NO – NULL

HIRE DATE date NO – NULL

SAL number(7,2) NO – NULL

DEPTNO number(2,0) NO – NULL

User Eddy Bayonne
by
7.2k points
3 votes


\huge \boxed{ \textbf{ {Answer : }}}

  • A database management system (DBMS) is system software for creating and managing databases.
  • A DBMS makes it possible for end users to create, protect, read, update and delete data in a database.

━━━━━━━━━━━━━━━━━━━━━━━━

Example:-

Emp table :-

[ Create table ]

  • mysql-›create table emp ( id int ( 10 ) , name char ( 10 ) , sal int ( 10 ));


\:

Output:-


\begin{array} c  \hline\ \ \text{ \tt\purple{id} }& \text{ \tt \purple{name}} \text{ }& \text{ \tt \purple{sal} } \\ \hline \tt{}& \tt{}& \tt{} \\ \hline \tt{}& \tt{}& \tt{} \\ \hline \tt{}& \tt{}& \tt{} \\ \hline\end{array}


\:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[ Insert value ]

  • mysql-›insert into table emp ( id, name , sal ) values ( 101 , abc , 2500 ));
  • mysql-›insert into table emp ( id, name , sal ) values ( 102 , xyz , 3500 ));
  • mysql-›insert into table emp ( id, name , sal ) values ( 103 , pqr , 5000 ));


\:

Output:-


\begin{array} c  \hline\ \ \text{ \tt\purple{id} }& \text{ \tt \purple{name}} \text{ }& \text{ \tt \purple{sal} } \\ \hline \tt{101}& \tt{abc}& \tt{2500} \\ \hline \tt{102}& \tt{xyz}& \tt{3500} \\ \hline \tt{103}& \tt{pqr}& \tt{5000} \\ \hline\end{array}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

hope it helps ⸙

User Andy Xufuris
by
7.5k points