manjeet is working as a transport coordinator in a public school . There was some problem in a particular route . He has to arrange for an alternative for all those students. He has only one table containing all the details of students. Using which object of databases, he can get the list of students without affecting the original table
Answers
Answer:
A database object is any defined object in a database that is used to store or reference data.Anything which we make from create command is known as Database Object.It can be used to hold and manipulate the data.Some of the examples of database objects are : view, sequence, indexes, etc.
Table – Basic unit of storage; composed rows and columns
View – Logically represents subsets of data from one or more tables
Sequence – Generates primary key values
Index – Improves the performance of some queries
Synonym – Alternative name for an object
Different database Objects :
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
Table – This database object is used to create a table in database.
Syntax :
CREATE TABLE [schema.]table
(column datatype [DEFAULT expr][, ...]);
Example :
CREATE TABLE dept
(deptno NUMBER(2),
dname VARCHAR2(14),
loc VARCHAR2(13));
Output :
DESCRIBE dept;
table output
View – This database object is used to create a view in database.A view is a logical table based on a table or another view. A view contains no data of its own but is like a window through which data from tables can be viewed or changed. The tables on which a view is based are called base tables. The view is stored as a SELECT statement in the data dictionary.