Skip to main content

Posts

Showing posts with the label Programming

Normalization

Normalization is the process of splitting relations into well-structured relations that allow users to insert, delete, and update tuples without introducing database inconsistencies. The focus of normalization is to reduce redundant data to the minimum.  Normalization is also called “Bottom-up approach”, because this technique requires very minute details like every participating attribute and how it is dependant on the key attributes, is crucial. If you add new attributes after normalization, it may change the normal form itself. Through Normalization, the collection of data in a single table is distributed into multiple tables with specific relation. Without normalization many problems can occur when trying to load an integrated conceptual model into the DBMS. These problems arise from relations that are generated directly from user views are called anomalies. There are three types of anomalies: RollNo StudentName CourseNo CourseName Instructor 120 SKL CS-7

Advantages of DBMS over Conventional File System

The principal advantages of DBMS over file processing system: • Flexibility : Because programs and data are independent, programs do not have to be modified when types of unrelated data are added to or deleted from the database, or when physical storage changes. • Fast response to information requests : Because data is integrated into a single database, complex requests can be handled much more rapidly than locating data separately. In many businesses, faster response means better customer service. • Multiple access : Database software allows data to be accessed in a variety of ways (through various key fields), by using several programming languages (both3GL and nonprocedural4GL programs). • Lower user training costs : Users often find it easier to learn such systems and training costs may be reduced. Also, the total time taken to process requests may be less, which would increase user productivity. • Less storage : Theoretically, all occurrences of data items need be stored only on

SQL Syntax

Some of the most important SQL commands are listed below. These below SQL Syntaxes will be suitable for quick reference. SELECT [hint][DISTINCT] select_list FROM table_list [WHERE conditions] [GROUP BY group_by_list] [HAVING search_conditions] [ORDER BY order_list [ASC DESC] ] [FOR UPDATE for_update_options] SQL Select Statement SELECT "column name" FROM "table name" Example: Select salary from emp; SQL Where SELECT "column name" FROM "table name" WHERE "condition" Example: Select salary from emp Where salary > 2000 SQL Distinct SELECT DISTINCT "column name" FROM "table name" Example: Select DISTINCT name from emp; SQL And/Or SELECT "column name" FROM "table name" WHERE "condition" {[ANDOR] "condition"}+ Example: SELECT salary FROM emp WHERE Salary > 1000 OR (Salary <> 275) SQL Between SELECT "column name" FROM "table name" WHERE "column nam

SQL Introduction

SQL stands for Structured Query Language and it is generally referred to as SEQUEL. SQL is simple language to learn. SQL is a Nonprocedural language, as compared to the procedural or third generation languages (3GLs) such as COBOL and C. SQL was developed by IBM in the 1970s. The American National Standards Institute (ANSI) published its first SQL standard in 1986 and a second widely adopted standard in 1989. ANSI released updates in 1992, known as SQL92 and SQL2 , and again in 1999, termed both SQL99 and SQL3 . Each time, ANSI added new features and incorporated new commands and capabilities into the language. SQL is a simple, yet powerful, language used to create, access, and manipulate data and structure in the database. SQL Statements categories:  DDL - Data Definition Language. DDL is used to define, alter, or drop database objects and their privileges. DDL statements will implicitly perform a commit. DDL Statements: Create It is used to create objects(tables, views) in the data

MCQ on Oracle

1. What does a COMMIT statement do to a CURSOR a] Open the Cursor b] Fetch the Cursor c] Close the Cursor d] None of the above   2. Which of the following is TRUE 1] Host variables are declared anywhere in the program 2] Host variables are declared in the DECLARE section a] Only 1 is TRUE b] Only 2 is TRUE c] Both 1 & 2are TRUE d] Both are FALSE   3. Which of the following is NOT VALID is PL/SQL a] Bool boolean; b] NUM1, NUM2 number; c] deptname dept.dname%type; d] date1 date := sysdate   4. Declare fvar number := null; svar number := 5 Begin goto << fproc>> if fvar is null then << fproc>> svar := svar + 5 end if; End; What will be the value of svar after the execution ? a] Error b] 10 c] 5 d] None of the above   5. Which of the following is not correct about an Exception ? a] Raised automatically / Explicitly in response to an ORACLE_ERROR b] An exception will be raised when an error occurs in that block c] Process terminates after completion of error seque